Skip to content

Commit

Permalink
Update sync_hdf_store method in RegressionData class
Browse files Browse the repository at this point in the history
  • Loading branch information
wkerzendorf committed Dec 16, 2023
1 parent ccf0a99 commit 71f1317
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions tardis/plasma/tests/test_complete_plasmas.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,10 @@ def plasma(
self,
chianti_he_db_fpath,
config,
tardis_ref_data,
):
config["atom_data"] = str(chianti_he_db_fpath)
sim = Simulation.from_config(config)
self.regression_data.sync_hdf_store(sim.plasma)
self.regression_data.sync_hdf_store(sim.plasma, update_fname=False)
return sim.plasma

@pytest.mark.parametrize("attr", combined_properties)
Expand Down
5 changes: 3 additions & 2 deletions tardis/tests/fixtures/regression_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ def sync_str(self, data):
with fpath.open("r") as fh:
return fh.read()

def sync_hdf_store(self, tardis_module):
self.fname = f"{self.fname_prefix}.h5"
def sync_hdf_store(self, tardis_module, update_fname=True):
if update_fname:
self.fname = f"{self.fname_prefix}.h5"
if self.enable_generate_reference:
self.fpath.parent.mkdir(parents=True, exist_ok=True)
with pd.HDFStore(self.fpath, mode="w") as store:
Expand Down

0 comments on commit 71f1317

Please sign in to comment.