Skip to content

Commit

Permalink
Sync obs counts with poly templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Yngve S. Kristiansen authored and yngve-sk committed Sep 19, 2024
1 parent e15b1d6 commit 82a563c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tests/performance_tests/test_dark_storage_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ def get_record_observations(storage, ensemble_id, keyword: str, poly_ran):
if "PSUM" in keyword:
n = int(keyword[4:])
if n < poly_ran["sum_obs_count"]:
count = poly_ran["summary_data_entries"] // poly_ran["sum_obs_every"]
assert len(obs) == count
num_summary_obs = poly_ran["sum_obs_count"] * (
poly_ran["summary_data_entries"] // poly_ran["sum_obs_every"]
)
assert len(obs) == num_summary_obs
assert obs[0].errors[0] == 0.1
assert obs[0].x_axis[0] == "2010-01-02T00:00:00.000000000"
assert obs[0].values[0] == 2.6357
Expand All @@ -56,11 +58,12 @@ def get_record_observations(storage, ensemble_id, keyword: str, poly_ran):
elif "POLY_RES_" in keyword:
n = int(keyword.split("@")[0][9:])
if n < poly_ran["gen_obs_count"]:
count = poly_ran["gen_data_entries"] // poly_ran["gen_obs_every"]
assert len(obs) == count
assert len(obs[0].errors) == 1
assert len(obs[0].x_axis) == 1
assert len(obs[0].values) == 1
num_general_obs = poly_ran["gen_obs_count"]
rows_per_obs = poly_ran["gen_data_entries"] // poly_ran["gen_obs_every"]
assert len(obs) == num_general_obs
assert len(obs[0].errors) == rows_per_obs
assert len(obs[0].x_axis) == rows_per_obs
assert len(obs[0].values) == rows_per_obs
else:
assert len(obs) == 0
else:
Expand Down

0 comments on commit 82a563c

Please sign in to comment.