Skip to content

Commit

Permalink
Generate test for dimensionality check when updating the v_inner_boun…
Browse files Browse the repository at this point in the history
…dary on fly
  • Loading branch information
DeerWhale committed Nov 20, 2023
1 parent a0b1479 commit 345eee3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tardis/model/tests/test_csvy_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,25 @@ def test_compare_models(model_config_fnames):
)


def test_dimensionality_after_update_v_inner_boundary(
model_config_fnames,
):
"""Test that the dimensionality of SimulationState parameters after updating v_inner_boundary
in the context of csvy models specifically"""
csvy_config_file, _ = model_config_fnames
config = Configuration.from_yaml(csvy_config_file)
csvy_model = SimulationState.from_csvy(config)

config.model.v_inner_boundary = csvy_model.velocity[1]
new_csvy_model = SimulationState.from_csvy(config)

assert new_csvy_model.no_of_raw_shells == csvy_model.no_of_raw_shells
assert new_csvy_model.no_of_shells == csvy_model.no_of_shells - 1
assert new_csvy_model.velocity.shape[0] == csvy_model.velocity.shape[0] - 1
assert new_csvy_model.density.shape[0] == csvy_model.density.shape[0] - 1
assert new_csvy_model.volume.shape[0] == csvy_model.volume.shape[0] - 1


@pytest.fixture(scope="module")
def csvy_model_test_abundances(example_csvy_file_dir):
"""Returns SimulationState to use to test abundances dataframes"""
Expand Down

0 comments on commit 345eee3

Please sign in to comment.