Commit b4d82f3a authored by Charlie Hoy's avatar 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
......@@ -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)
......
......@@ -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"])
......
......@@ -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)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment