Skip to content

Commit

Permalink
Remove refdata reference from .py files, tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
atharva-2001 committed Aug 23, 2024
1 parent 8d79980 commit 9fa3464
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
15 changes: 5 additions & 10 deletions tardis/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ def pytest_configure(config):


def pytest_addoption(parser):
parser.addoption(
"--tardis-refdata", default=None, help="Path to Tardis Reference Folder"
)
parser.addoption(
"--tardis-regression-data",
default=None,
Expand Down Expand Up @@ -144,15 +141,13 @@ def generate_reference(request):
else:
return option


@pytest.fixture(scope="session")
def tardis_ref_path(request):
tardis_ref_path = request.config.getoption("--tardis-refdata")
if tardis_ref_path is None:
pytest.skip("--tardis-refdata was not specified")
def tardis_regression_path(request):
tardis_regression_path = request.config.getoption("--tardis-regression-data")
if tardis_regression_path is None:
pytest.skip("--tardis-regression-data was not specified")
else:
return Path(os.path.expandvars(os.path.expanduser(tardis_ref_path)))

return Path(os.path.expandvars(os.path.expanduser(tardis_regression_path)))

@pytest.fixture(scope="session")
def tardis_snapshot_path(request):
Expand Down
4 changes: 2 additions & 2 deletions tardis/io/model/readers/tests/test_arepo_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@


@pytest.fixture()
def arepo_snapshot_fname(tardis_ref_path):
return Path(tardis_ref_path) / "arepo_data" / "arepo_snapshot.json"
def arepo_snapshot_fname(tardis_regression_path):
return Path(tardis_regression_path) / "arepo_data" / "arepo_snapshot.json"


@pytest.fixture
Expand Down
4 changes: 2 additions & 2 deletions tardis/plasma/tests/test_complete_plasmas.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ class TestPlasma:
scalars_properties = ["time_explosion", "link_t_rad_t_electron"]

@pytest.fixture(scope="class")
def chianti_he_db_fpath(self, tardis_ref_path):
return (tardis_ref_path / "atom_data" / "chianti_He.h5").absolute()
def chianti_he_db_fpath(self, tardis_regression_path):
return (tardis_regression_path / "atom_data" / "chianti_He.h5").absolute()

@pytest.fixture(scope="class", params=CONFIG_LIST, ids=idfn)
def config(self, request):
Expand Down
8 changes: 4 additions & 4 deletions tardis/tests/fixtures/atom_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@


@pytest.fixture(scope="session")
def atomic_data_fname(tardis_ref_path):
def atomic_data_fname(tardis_regression_path):
atomic_data_fname = (
tardis_ref_path / "atom_data" / "kurucz_cd23_chianti_H_He.h5"
tardis_regression_path / "atom_data" / "kurucz_cd23_chianti_H_He.h5"
)

atom_data_missing_str = (
Expand Down Expand Up @@ -44,11 +44,11 @@ def kurucz_atomic_data(atomic_dataset):


@pytest.fixture # (scope="session")
def nlte_atomic_data_fname(tardis_ref_path):
def nlte_atomic_data_fname(tardis_regression_path):
"""
File name for the atomic data file used in NTLE ionization solver tests.
"""
atomic_data_fname = tardis_ref_path / "nlte_atom_data" / "TestNLTE_He_Ti.h5"
atomic_data_fname = tardis_regression_path / "atom_data" / "nlte_atom_data" / "TestNLTE_He_Ti.h5"

atom_data_missing_str = (
f"{atomic_data_fname} atomic datafiles " f"does not seem to exist"
Expand Down

0 comments on commit 9fa3464

Please sign in to comment.