Skip to content

Commit

Permalink
Update plasma tests to use chianti_he_db dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
vg3095 committed Aug 18, 2017
1 parent e73b09d commit 2e0a628
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tardis/plasma/tests/test_complete_plasmas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand All @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand All @@ -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

0 comments on commit 2e0a628

Please sign in to comment.