... | @@ -32,14 +32,21 @@ To check that posterior samples can both be written to CSV and read back in usin |
... | @@ -32,14 +32,21 @@ To check that posterior samples can both be written to CSV and read back in usin |
|
|
|
|
|
```python
|
|
```python
|
|
from pesummary.io import read
|
|
from pesummary.io import read
|
|
|
|
import numpy as np
|
|
|
|
|
|
f = read()
|
|
f = read(PATH)
|
|
f.write(file_format="csv", filename=".csv", outdir="./")
|
|
f.write(file_format="csv", filename="example_output.csv", outdir="./")
|
|
g = read("./.csv")
|
|
g = read("./example_output.csv")
|
|
assert f.parameters == g.parameters
|
|
assert sorted(f.parameters) == sorted(g.parameters)
|
|
assert f.samples == g.samples
|
|
np.testing.assert_almost_equal(f.samples, 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]))
|
|
```
|
|
```
|
|
|
|
|
|
|
|
We ran this with `PATH` indicating the path to a `LALInference hdf5` file and a `bilby json` file and worked as expected.
|
|
|
|
|
|
## Reviewer comments
|
|
## Reviewer comments
|
|
|
|
|
|
# Preliminary watermark
|
|
# Preliminary watermark
|
... | | ... | |