... | ... | @@ -38,11 +38,11 @@ f = read(PATH) |
|
|
f.write(file_format="csv", filename="example_output.csv", outdir="./")
|
|
|
g = read("./example_output.csv")
|
|
|
assert sorted(f.parameters) == sorted(g.parameters)
|
|
|
np.testing.assert_almost_equal(f.samples, g.samples)
|
|
|
np.testing.assert_almost_equal(np.array(f.samples), np.array(g.samples))
|
|
|
|
|
|
numpy = np.genfromtxt("./example_output.csv", delimiter=",", names=True)
|
|
|
assert sorted(f.parameters) == sorted(list(numpy.dtype.names))
|
|
|
np.testing.assert_almost_equal(f.samples, np.array([list(i) for i in numpy]))
|
|
|
np.testing.assert_almost_equal(np.array(f.samples), np.array([list(i) for i in numpy]))
|
|
|
```
|
|
|
|
|
|
We ran this with `PATH` indicating the path to a `LALInference hdf5` file and a `bilby json` file and worked as expected.
|
... | ... | @@ -95,7 +95,7 @@ for event in ["GW190412", "GW190521"]: |
|
|
f = fetch_open_data(event, unpack=True, read_file=True, path=f"{event}.h5")
|
|
|
g = read(f"{event}/{event}.h5")
|
|
|
assert sorted(f.labels) == sorted(g.labels)
|
|
|
np.testing.assert_almost_equal(f.samples, g.samples)
|
|
|
np.testing.assert_almost_equal(np.array(f.samples), np.array(g.samples))
|
|
|
```
|
|
|
|
|
|
with output:
|
... | ... | |