Skip to content

Commit

Permalink
Merge pull request #597 from karandesai-96/relpaths-in-test-w7
Browse files Browse the repository at this point in the history
Use abundances, densities filepaths relative to w7 config file.
  • Loading branch information
wkerzendorf committed Jun 24, 2016
2 parents f8ba93a + 4bfe224 commit 88cdd30
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
16 changes: 3 additions & 13 deletions tardis/tests/tests_slow/test_w7.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,7 @@ def setup(self, request, reference, data_path, atomic_data_fname,
This method does initial setup of creating configuration and performing
a single run of integration test.
"""
self.config_file = os.path.join(data_path, "config_w7.yml")
self.abundances = os.path.join(data_path, "abundances_w7.dat")
self.densities = os.path.join(data_path, "densities_w7.dat")

# The available config file doesn't have file paths of atom data file,
# densities and abundances profile files as desired. We load the atom
# data seperately and provide it to tardis_config later. For rest of
# the two, we form dictionary from the config file and override those
# parameters by putting file paths of these two files at proper places.
config_yaml = yaml_load_config_file(self.config_file)
config_yaml['model']['abundances']['filename'] = self.abundances
config_yaml['model']['structure']['filename'] = self.densities
self.config_file = os.path.join(data_path, "config.yml")

# Load atom data file separately, pass it for forming tardis config.
self.atom_data = AtomData.from_hdf5(atomic_data_fname)
Expand All @@ -49,7 +38,8 @@ def setup(self, request, reference, data_path, atomic_data_fname,
assert self.atom_data.uuid1 == kurucz_data_file_uuid1

# Create a Configuration through yaml file and atom data.
tardis_config = Configuration.from_config_dict(config_yaml, self.atom_data)
tardis_config = Configuration.from_yaml(
self.config_file, atom_data=self.atom_data)

# We now do a run with prepared config and get radial1d model.
self.result = Radial1DModel(tardis_config)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
atom_data: kurucz_cd23_chianti_H_He.h5
model:
abundances:
filename: tardis_w7_13d_abundances.dat
filename: abundances.dat
filetype: simple_ascii
type: file
structure:
filename: tardis_w7_13d_densities.dat
filename: densities.dat
filetype: simple_ascii
type: file
v_inner_boundary: 12000.000 km/s
Expand All @@ -16,8 +16,10 @@ montecarlo:
start: 1 angstrom
stop: 1000000 angstrom
iterations: 20
last_no_of_packets: 2.0e+5
no_of_packets: 4.0e+4
# originally 2.0e+5
last_no_of_packets: 2.0e+3
# originally 4.0e+2
no_of_packets: 4.0e+2
no_of_virtual_packets: 10
nthreads: 2
seed: 23111963
Expand All @@ -36,4 +38,4 @@ spectrum:
supernova:
luminosity_requested: 9.44 log_lsun
time_explosion: 13. day
tardis_config_version: v1.0
tardis_config_version: v1.0
File renamed without changes.

0 comments on commit 88cdd30

Please sign in to comment.