From c7c17256673519d016307e595b5c9819add1bfe1 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Thu, 30 Jun 2022 14:33:14 +0100 Subject: [PATCH] tests: pandas io tests extended. --- tests/pandas_test.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/pandas_test.py b/tests/pandas_test.py index 610f980f..d4833656 100644 --- a/tests/pandas_test.py +++ b/tests/pandas_test.py @@ -3,14 +3,15 @@ import pandas as pd import pyerrors as pe def test_df_export_import(tmp_path): + my_dict = {"int": 1, + "float": -0.01, + "Obs1": pe.pseudo_Obs(87, 21, "test_ensemble"), + "Obs2": pe.pseudo_Obs(-87, 21, "test_ensemble2")} for gz in [True, False]: - my_df = pd.DataFrame([{"int": 1, - "float": -0.01, - "Obs1": pe.pseudo_Obs(87, 21, "test_ensemble"), - "Obs2": pe.pseudo_Obs(-87, 21, "test_ensemble2")}]) + my_df = pd.DataFrame([my_dict] * 10) 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(), gz=gz) + reconstructed_df = pe.input.pandas.load_df((tmp_path / 'df_output').as_posix(), auto_gamma=True, gz=gz) assert np.all(my_df == reconstructed_df) pe.input.pandas.load_df((tmp_path / 'df_output.csv').as_posix(), gz=gz)