mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
Merge branch 'develop' into documentation
This commit is contained in:
commit
b5eb4a0bfd
5 changed files with 16 additions and 4 deletions
BIN
tests/data/compute_drho_fails.json.gz
Normal file
BIN
tests/data/compute_drho_fails.json.gz
Normal file
Binary file not shown.
|
@ -1282,3 +1282,8 @@ def test_f_string_obs():
|
|||
print(f"{o1:+3}")
|
||||
print(f"{o1:-1}")
|
||||
print(f"{o1: 8}")
|
||||
|
||||
def test_compute_drho_fails():
|
||||
obs = pe.input.json.load_json("tests/data/compute_drho_fails.json.gz")
|
||||
obs.gm()
|
||||
assert np.isclose(obs.dvalue, 0.0022150779611891094)
|
||||
|
|
|
@ -46,10 +46,9 @@ def test_nan_df_export_import(tmp_path):
|
|||
my_df.loc[1, "int"] = np.nan
|
||||
|
||||
for gz in [True, False]:
|
||||
pe.input.pandas.dump_df(my_df, (tmp_path / 'df_output').as_posix(), gz=gz)
|
||||
reconstructed_df = pe.input.pandas.load_df((tmp_path / 'df_output').as_posix(), auto_gamma=True, gz=gz)
|
||||
with pytest.warns(UserWarning, match="nan value in column int will be replaced by None"):
|
||||
warnings.warn("nan value in column int will be replaced by None", UserWarning)
|
||||
pe.input.pandas.dump_df(my_df, (tmp_path / 'df_output').as_posix(), gz=gz)
|
||||
reconstructed_df = pe.input.pandas.load_df((tmp_path / 'df_output').as_posix(), auto_gamma=True, gz=gz)
|
||||
assert reconstructed_df.loc[1, "int"] is None
|
||||
assert np.all(reconstructed_df.loc[:, "float"] == my_df.loc[:, "float"])
|
||||
assert np.all(reconstructed_df.loc[:, "Obs1"] == my_df.loc[:, "Obs1"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue