-
-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Testing TARDIS | ||
-------------- | ||
|
||
Testing a code like TARDIS is an important step to making sure that the output is trustworthy. The TARDIS team has opted | ||
to use the py.test testing framework for use with TARDIS (and some astropy extensions of it). To run the tests download | ||
the desired version of TARDIS and run it with:: | ||
|
||
python setup.py test | ||
|
||
This will run the currently implemented tests (which are not as many as there should be) | ||
|
||
To quickly test TARDIS with any atomic dataset (it will only see if it in general runs):: | ||
|
||
python setup.py test --args="--atomic-dataset=<path_to_dataset> -s" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
tardis_config_version: v1.0 | ||
|
||
supernova: | ||
luminosity_requested: 2.8e9 Lsun | ||
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 | ||
O: 0.19 | ||
Mg: 0.03 | ||
Si: 0.52 | ||
S: 0.19 | ||
Ar: 0.04 | ||
Ca: 0.03 | ||
|
||
plasma: | ||
ionization: lte | ||
excitation: lte | ||
radiative_rates_type: dilute-blackbody | ||
line_interaction_type: macroatom | ||
|
||
montecarlo: | ||
seed: 23111963 | ||
no_of_packets : 2.0e+5 | ||
iterations: 5 | ||
last_no_of_packets: 5.0e+5 | ||
no_of_virtual_packets: 5 | ||
|
||
spectrum: | ||
start: 500 angstrom | ||
stop: 20000 angstrom | ||
num: 10000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
# file for setting up tests | ||
#py.test configuration | ||
|
||
def pytest_addoption(parser): | ||
parser.addoption("--atomic-dataset", dest='atomic-dataset', default=None, help="filename for atomic dataset") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import pytest | ||
import os | ||
import yaml | ||
from tardis import io, model, simulation | ||
from tardis.io.config_reader import TARDISConfiguration | ||
from numpy.testing import assert_array_almost_equal | ||
|
||
@pytest.mark.skipif(not pytest.config.getvalue("atomic-dataset"), | ||
reason='--atomic_database was not specified') | ||
class TestSimpleRun(): | ||
""" | ||
Very simple run | ||
""" | ||
|
||
@classmethod | ||
@pytest.fixture(scope="class", autouse=True) | ||
def setup(self): | ||
self.atom_data_filename = pytest.config.getvalue('atomic-dataset') | ||
assert os.path.exists(self.atom_data_filename) | ||
self.config_yaml = yaml.load(open('tardis/io/tests/data/tardis_configv1_verysimple.yml')) | ||
self.config_yaml['atom_data'] = self.atom_data_filename | ||
|
||
self.config = TARDISConfiguration.from_config_dict(self.config_yaml) | ||
self.model = model.Radial1DModel(self.config) | ||
simulation.run_radial1d(self.model) | ||
|
||
|
||
def test_structure(self): | ||
pass |