Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Comparison values in Plasma Unit Tests with reference HDF file #774

Merged
merged 27 commits into from
Aug 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6778992
Add reference HDF file for plasma tests
vg3095 Aug 3, 2017
f005039
Add plasma test class
vg3095 Aug 7, 2017
83d6603
Move plasma_ref_path inside tests class
vg3095 Aug 7, 2017
f783cc8
Use tardis-refdata option in Plasma tests
vg3095 Aug 8, 2017
69dd3dd
Added some new tests for plasma
vg3095 Aug 8, 2017
fccbf1a
Delete old plasma test files
vg3095 Aug 8, 2017
4060d4e
Add generate-reference option for Plasma Tests
vg3095 Aug 8, 2017
38ebff8
Fix indentation inside TestNLTEPlasma
vg3095 Aug 8, 2017
9cd60b3
Use atomic_data_fname fixture in plasma tests
vg3095 Aug 8, 2017
6b548dc
Use git checkpoint of PR#2 for tardis-refdata
vg3095 Aug 10, 2017
34e0412
Use tardis_ref_path fixture in plasma tests
vg3095 Aug 10, 2017
79ff2fc
Parametrize plasma tests
vg3095 Aug 11, 2017
a5e3e1e
Combine list of properties in plasma tests
vg3095 Aug 11, 2017
4e49f52
Use plasma as a class level fixture in tests
vg3095 Aug 11, 2017
a5f3758
Use yield fixture for HDF file in plasma tests
vg3095 Aug 18, 2017
74d2eb6
Add some more plasma tests
vg3095 Aug 18, 2017
32f1efa
Fix to use chianti_he_db dataset for NLTE config
vg3095 Aug 18, 2017
ad965c8
Update plasma tests to use chianti_he_db dataset
vg3095 Aug 18, 2017
f914c81
Generate different plasma config using fixture
vg3095 Aug 18, 2017
cf59431
Add a base plasma config
vg3095 Aug 18, 2017
bf4c5d4
Remove unused fixture
vg3095 Aug 18, 2017
cde7889
Generate plasma tests using list of config options
vg3095 Aug 19, 2017
cd1a6df
Fix negative power error in HeliumNLTE
vg3095 Aug 19, 2017
8e52780
Test for recomb-nlte option in plasma
vg3095 Aug 19, 2017
3632663
Add plasma test for delta treatment
vg3095 Aug 19, 2017
b2b53ce
Use w_epsilon when radiative_rates_type is detailed in plasma tests
vg3095 Aug 19, 2017
d178387
Add warning that nlte_data can't be saved
vg3095 Aug 22, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ before_install:
- if [[ $TEST_MODE == 'spectrum' ]]; then git lfs install --skip-smudge; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git clone $TARDIS_REF_DATA_URL $HOME/tardis-refdata; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then cd $HOME/tardis-refdata; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git fetch origin pull/2/head:plasma-ref2; fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only temporary, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is temporary.

- if [[ $TEST_MODE == 'spectrum' ]]; then git checkout plasma-ref2; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="atom_data/kurucz_cd23_chianti_H_He.h5" origin; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="plasma_reference/" origin; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then cd $TRAVIS_BUILD_DIR; fi
Expand Down
3 changes: 3 additions & 0 deletions tardis/io/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ def get_properties(self):
data['atom_data_uuid'] = self.atomic_data.uuid1
if 'atomic_data' in data:
data.pop('atomic_data')
if 'nlte_data' in data:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a warning here that nlte_data can not be saved.

logger.warning("nlte_data can't be saved")
data.pop('nlte_data')
return data

def to_hdf(self, file_path, path='', name=None, collection=None):
Expand Down
2 changes: 1 addition & 1 deletion tardis/plasma/properties/nlte.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def calculate(level_boltzmann_factor,
helium_population.ix[0,0] = 0.0
#He II excited states
he_two_population = level_boltzmann_factor.ix[2,1].mul(
(g.ix[2,1].ix[0]**(-1)))
(g.ix[2,1].ix[0]**(-1.0)))
helium_population.ix[1].update(he_two_population)
#He II ground state
helium_population.ix[1,0] = 1.0
Expand Down
2 changes: 1 addition & 1 deletion tardis/plasma/properties/partition_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def _main_nlte_calculation(
else:
collision_matrix = nlte_data.get_collision_matrix(
species, t_electrons
) * previous_electron_densities.values
) * previous_electron_densities
else:
collision_matrix = r_ul_matrix.copy()
collision_matrix.fill(0.0)
Expand Down
260 changes: 0 additions & 260 deletions tardis/plasma/tests/conftest.py

This file was deleted.

42 changes: 42 additions & 0 deletions tardis/plasma/tests/data/plasma_base_test_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
tardis_config_version: v1.0

supernova:
luminosity_requested: 2.8e9 solLum
time_explosion: 13 day

atom_data: kurucz_atom_pure_simple.h5

model:

structure:
type: specific

velocity:
start: 1.1e4 km/s
stop: 2.0e4 km/s
num: 20

density:
type: branch85_w7

abundances:
type: uniform
He: 1

plasma:
ionization: lte
excitation: lte
radiative_rates_type: dilute-blackbody
line_interaction_type: macroatom

montecarlo:
seed: 23111963
no_of_packets : 1.0e+5
iterations: 10
last_no_of_packets: 1.0e+5
no_of_virtual_packets: 5

spectrum:
start: 500 angstrom
stop: 20000 angstrom
num: 10000
Loading