Skip to content

Commit

Permalink
test pd load from parquet
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdicaprio committed Jun 10, 2024
1 parent 28046fd commit 1c2f849
Showing 1 changed file with 51 additions and 1 deletion.
52 changes: 51 additions & 1 deletion tests/test_end_to_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,58 @@ def mock_config():

monkeypatch.setattr(toshi_hazard_post.local_config, 'get_config', mock_config)
load_mock.return_value = pd.read_parquet(parquet_filepath)
df = pd.read_parquet(parquet_filepath)
e_100 = np.array(
[
1.08094662e-01,
1.08094662e-01,
1.08085223e-01,
1.07998222e-01,
1.07720889e-01,
1.07164048e-01,
1.00059994e-01,
7.83751309e-02,
6.05159029e-02,
4.78485823e-02,
3.88501808e-02,
1.80388670e-02,
7.12142605e-03,
3.78514500e-03,
2.29136948e-03,
1.49269367e-03,
2.91913282e-04,
8.44983224e-05,
2.94818801e-05,
1.15311404e-05,
4.88225760e-06,
2.19345452e-06,
1.03349475e-06,
5.05957019e-07,
2.55615760e-07,
6.96675642e-08,
1.97543848e-08,
5.25937427e-09,
1.00168707e-09,
3.23859828e-11,
1.38331568e-11,
1.38331568e-11,
1.38331568e-11,
1.38331568e-11,
1.38331568e-11,
1.38331568e-11,
1.38331568e-11,
1.38331568e-11,
1.38331568e-11,
1.38331568e-11,
1.38331568e-11,
1.38331568e-11,
1.38331568e-11,
1.38331568e-11,
]
)
np.testing.assert_allclose(df.loc[100, 'values'], e_100)

agg_args = AggregationArgs(args_filepath)
run_aggregation(agg_args)
aggs = save_mock.mock_calls[0].args[0]
np.testing.assert_allclose(aggs, aggs_expected, rtol=1e-7, atol=1e-6)
np.testing.assert_allclose(aggs, aggs_expected, rtol=1e-7, atol=2e-5)

0 comments on commit 1c2f849

Please sign in to comment.