Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lscsoft
PESummary
Commits
b4d82f3a
Commit
b4d82f3a
authored
Oct 27, 2022
by
Charlie Hoy
Browse files
Merge branch 'finalise-v0.13.10' into 'release/0.13.x'
Update 0.13.x release branch for 0.13.10 See merge request
!724
parents
c669e2ce
d7ce8fa0
Pipeline
#471798
failed with stages
in 126 minutes and 56 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
pesummary/core/file/meta_file.py
View file @
b4d82f3a
...
...
@@ -5,7 +5,8 @@ import os
import
numpy
as
np
import
json
import
copy
from
getpass
import
getuser
import
pandas
as
pd
import
pesummary
from
pesummary
import
__version__
from
pesummary.core.inputs
import
PostProcessing
...
...
@@ -47,6 +48,8 @@ def recursively_save_dictionary_to_hdf5_file(
current_path
=
[]
for
k
,
v
in
dictionary
.
items
():
if
isinstance
(
v
,
pd
.
DataFrame
):
v
=
v
.
to_dict
(
orient
=
"list"
)
if
isinstance
(
v
,
dict
):
if
k
not
in
f
[
"/"
+
"/"
.
join
(
current_path
)].
keys
():
f
[
"/"
.
join
(
current_path
)].
create_group
(
k
)
...
...
pesummary/gw/p_astro.py
View file @
b4d82f3a
...
...
@@ -67,8 +67,10 @@ class PAstro(object):
"because not all required parameters have been provided."
)
M_rem
=
computeDiskMass
(
samples
[
"mass_1_source"
],
samples
[
"mass_2_source"
],
samples
[
"a_1"
],
samples
[
"a_2"
]
samples
[
"mass_1_source"
].
to_numpy
(),
samples
[
"mass_2_source"
].
to_numpy
(),
samples
[
"a_1"
].
to_numpy
(),
samples
[
"a_2"
].
to_numpy
()
)
prediction_ns
=
float
(
np
.
sum
(
samples
[
"mass_2_source"
]
<=
3.0
)
/
len
(
samples
[
"mass_2_source"
])
...
...
pesummary/utils/array.py
View file @
b4d82f3a
...
...
@@ -261,3 +261,18 @@ class Array(np.ndarray):
self
.
maxP
=
getattr
(
obj
,
'maxP'
,
None
)
self
.
weights
=
getattr
(
obj
,
'weights'
,
None
)
self
.
key_data
=
getattr
(
obj
,
'key_data'
,
None
)
def
to_numpy
(
self
):
"""Convert Array object to a numpy.ndarray
Returns
-------
data: np.ndarray/tuple
return stored data as a np.ndarray. If weights are stored in the
Array object, return a tuple containing the stored data as a
np.ndarray and the weights as a np.ndarray
"""
_array
=
np
.
asarray
(
self
)
if
self
.
weights
is
None
:
return
_array
return
_array
,
np
.
asarray
(
self
.
weights
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment