From 2e0a62802cc014dd080f63e6399221a2c8fa27d5 Mon Sep 17 00:00:00 2001 From: Vaibhav Gupta Date: Fri, 18 Aug 2017 19:33:47 +0530 Subject: [PATCH] Update plasma tests to use chianti_he_db dataset --- tardis/plasma/tests/test_complete_plasmas.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tardis/plasma/tests/test_complete_plasmas.py b/tardis/plasma/tests/test_complete_plasmas.py index 6d3aacc81f2..a855ec3fb2b 100644 --- a/tardis/plasma/tests/test_complete_plasmas.py +++ b/tardis/plasma/tests/test_complete_plasmas.py @@ -13,9 +13,9 @@ class BasePlasmaTest(object): #This can then be inherited for different Plasma setup @pytest.fixture(scope="class") - def plasma(self, atomic_data_fname, tardis_ref_path, data): + def plasma(self, chianti_he_db_fpath, tardis_ref_path, data): config = data['config'] - config['atom_data'] = atomic_data_fname + config['atom_data'] = chianti_he_db_fpath sim = Simulation.from_config(config) if pytest.config.getvalue("--generate-reference"): @@ -28,6 +28,10 @@ def plasma(self, atomic_data_fname, tardis_ref_path, data): data['reference_file_path'])) return sim.plasma + @pytest.fixture(scope="class") + def chianti_he_db_fpath(self): + return os.path.abspath(os.path.join('tardis', 'tests', 'data', 'chianti_he_db.h5')) + @pytest.fixture(scope="class") def data(self): pass @@ -136,7 +140,7 @@ def test_zeta_data(self, plasma, reference): assert_almost_equal(actual, expected.values) -class TestPlasmaSetupIII(BasePlasmaTest): +class TestPlasmaSetupIII(TestNLTEPlasma): @pytest.fixture(scope="class") def data(self, tardis_ref_path): @@ -166,7 +170,7 @@ def test_j_blues_detailed_properties(self, plasma, reference, attr): pdt.assert_almost_equal(actual, expected) -class TestPlasmaSetupIV(BasePlasmaTest): +class TestPlasmaSetupIV(TestNLTEPlasma): @pytest.fixture(scope="class") def data(self, tardis_ref_path): @@ -177,7 +181,7 @@ def data(self, tardis_ref_path): 'tardis', 'plasma', 'tests', 'data', 'plasma_test_config_nlte.yml') config = Configuration.from_yaml(plasma_data['config_path']) config.plasma.radiative_rates_type = 'blackbody' - #config.plasma.nlte.coronal_approximation = True + config.plasma.nlte.coronal_approximation = True #config.plasma.helium_treatment = 'numerical-nlte' plasma_data['config'] = config return plasma_data