... | ... | @@ -20,6 +20,33 @@ |
|
|
- The differences are just due to the difference in floating point storage between
|
|
|
SQL and JSON. I believe this difference is small enough to be negligible
|
|
|
|
|
|
# npy file format
|
|
|
|
|
|
## Related MRs
|
|
|
|
|
|
* https://git.ligo.org/lscsoft/pesummary/-/merge_requests/474
|
|
|
|
|
|
## Test
|
|
|
|
|
|
To check that posterior samples can both be written to `npy` and read back in using both the pesummary's `io` module and the standard numpy `load` function, we ran the following test:
|
|
|
|
|
|
```python
|
|
|
from pesummary.io import read
|
|
|
import numpy as np
|
|
|
|
|
|
f = read(PATH)
|
|
|
f.write(file_format="numpy", filename="example_output.npy", outdir="./")
|
|
|
g = read("./example_output.npy")
|
|
|
assert sorted(f.parameters) == sorted(g.parameters)
|
|
|
np.testing.assert_almost_equal(np.array(f.samples), np.array(g.samples))
|
|
|
|
|
|
numpy = np.load("./example_output.npy")
|
|
|
assert sorted(f.parameters) == sorted(list(numpy.dtype.names))
|
|
|
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.
|
|
|
|
|
|
# CSV file format
|
|
|
|
|
|
## Related MRs
|
... | ... | |