Skip to content

Commit

Permalink
Merge pull request #1 from wkerzendorf/config/new_default_parser
Browse files Browse the repository at this point in the history
Merged as as requested
  • Loading branch information
mklauser committed Feb 27, 2014
2 parents fab69cc + dbf86a2 commit bc8e50a
Show file tree
Hide file tree
Showing 5 changed files with 245 additions and 0 deletions.
232 changes: 232 additions & 0 deletions tardis/data/tardis_default_config_definition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@

tardis_config_version:
property_type: string
help: Version of the configuration file


supernova:
luminosity_requested:
property_type: quantity
mandatory: True
default: None
help: requested output luminosity for simulation

time_explosion:
property_type: quantity
mandatory: True
default: None
help: time since explosion


atom_data:
property_type: string
mandatory: True
help: path or filename to the Atomic Data HDF5 file


model:
structure:
property_type : container-property

type:
property_type: container-declaration
containers: ['file', 'specific']
_file: ['file_property'] # why list

_specific: ['specific-property']

file_property:
filename:
property_type: string
default: None
mandatory: True
help: file name (with path) to structure model

filetype:
property_type: string
default: None
mandatory: True
help: file type
#### there are only a handful of types available how do we validate that ####

v_inner_boundary:
property_type: quantity
default: 0 km/s
mandatory: False
help: location of the inner boundary chosen from the model

v_outer_boundary:
property_type: quantity
default: inf km/s
mandatory: False
help: location of the inner boundary chosen from the model

specific_property:
velocity:
property_type: quantity_sampled_old
default: None
mandatory: True
help: >
location of boundaries in the velocity field.
There will be n-1 cells as this specifis both the inner and outer velocity components
density:
property_type: container-property
type:
property_type: container-declaration
containers: ['branch85_w7']

_branch85_w7: ['branch85_w7-property'] # list

branch85_w7-property:
time_0:
property_type: quantity
default: 19.9999584 s
mandatory: False
help: This needs no change - DO NOT TOUCH

density_coefficient:
property_type: float
default: 3e29
mandatory: False
help: This needs no change - DO NOT TOUCH


abundances:
#what do we do about that?



plasma:
initial_t_inner:
property_type: quantity
default: None
mandatory: False
help: >
Initial temperature of the black-body at the inner boundary.
If set to `None` will set the temperature to match the output temperature
initial_t_rads:
property_type: quantity
default: 10000 K
mandatory: False
help: initialize the radiation temperature in each cell

disable_electron_scattering:
property_type: bool
default: False
mandatory: False
help: Disables electron scattering. WARNING!! use only for testing - non-physical

ionization:
property_type: string
default: None
mandatory: True
help: Treatment of ionization
#what about different options for validations

excitation:
property_type: string
default: None
mandatory: True
help: Treatment of excitation

radiative_rates_type:
property_type: string
default: None
mandatory: True
help: Treatment the radiative rates

line_interaction_type:
property_type: string
default: None
mandatory: True
help: Treatment the line interaction


montecarlo:
seed:
property_type: int
default: 23111963
mandatory: False
help: Seed for the random number generator

no_of_packets:
property_type: int
default: None
mandatory: True
help: Seed for the random number generator

iterations:
property_type: int
default: None
mandatory: True
help: Number of maximum iterations

black_body_sampling:
property_type: quantity_sampled_old
default: "[1, 1e6, 1e6] angstrom"
mandatory: False
help: >
Sampling of the black-body for energy packet creation
(giving maximum and minimum packet frequency)
last_no_of_packets:
property_type: int
default: None
mandatory: False
help: >
This can set the number of packets for the last run.
If set to None it will remain the same as all other runs.
no_of_virtual_packets:
property_type: int
default: 0
mandatory: False
help: >
Setting the number of virtual packets for the last iteration.
converge_criteria:
property_type : container-property
type:
property_type: container-declaration
containers: ['specific']
_specific: ['specific-property']

specific-property:
damping_constant:
property_type: float
default: None
mandatory: True
help: Damping constant for convergence behaviour

threshold:
property_type: float
default: None
mandatory: True
help: threshold for convergence

fraction:
property_type: float
default: None
mandatory: True
help: fraction of shells that need to have converged to the necessary threshold

hold:
property_type: float
default: None
mandatory: True
help: >
Number of iterations that the simulation needs to run abiding by the convergence criteria
before it is considered converged
spectrum:
property_type: quantity_sampled_old
default: None
mandatory: True
help: Final spectrum sampling


Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ supernova:
default: 10 cm
mandatory: False
help: time since explosion

test:
structure:
property_type : container-property
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions tardis/io/tests/test_actual_default_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This is too test the actual default config

import tardis
from tardis.io.default_config_parser import DefaultParser
import os
import yaml
default_config_fname = os.path.join(tardis.__path__[0], 'data', 'tardis_default_config_definition.yml')


def test_read():
default_config_dict = yaml.load(file(default_config_fname))
DefaultParser(default_config_dict)

0 comments on commit bc8e50a

Please sign in to comment.