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

Implementation of config parser validation and completion #80

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3ef9b5b
The first alpha of the default config parser. THIS PR IS FOR FILE EXC…
mklauser Feb 3, 2014
c8860be
Code clean up
mklauser Feb 4, 2014
de677f8
Exceptions added.
mklauser Feb 5, 2014
fab69cc
I added two test files.
mklauser Feb 14, 2014
36a72d1
exponential density profile fixed
mklauser Feb 17, 2014
396a678
exponential density profile fixed
mklauser Feb 18, 2014
2c2e183
added missing return
mklauser Feb 18, 2014
281342e
merging the exponential density profile hotfix to the master
mklauser Feb 18, 2014
5409bec
add file
mklauser Feb 18, 2014
f64d02b
delete the default config parser from master for pr
mklauser Feb 18, 2014
b1efeae
i fixed a typo in the default parser
mklauser Feb 19, 2014
c50d0ea
new parametrized exponential density profile
mklauser Feb 19, 2014
6afed4c
moving around the test structure to adhere to TARDIS standards
wkerzendorf Feb 26, 2014
e3f10e0
adding prelimiary tardis_default_config_definition and a very very si…
wkerzendorf Feb 26, 2014
dbf86a2
fixed default quantity_range_sampled by using string. Need to think a…
wkerzendorf Feb 26, 2014
bc8e50a
Merge pull request #1 from wkerzendorf/config/new_default_parser
mklauser Feb 27, 2014
f312aae
Merge branch 'default-parser' of github.com:mklauser/tardis into defa…
mklauser Feb 28, 2014
cb74219
add a new test file for the default config parser
mklauser Feb 28, 2014
913c27f
the property type functions are now changed to classes
mklauser Mar 4, 2014
2956493
new quantity_range and quantity_range_sampled dtype in the default co…
mklauser Mar 5, 2014
2b2cd91
added a new logger, allowed_value and -type.
mklauser Mar 7, 2014
9dad90c
New tests and doku
mklauser Mar 10, 2014
38af9bb
Code clean up; New from_yaml method for Config;
mklauser Mar 18, 2014
93581a8
changed tardis default config
mklauser Mar 24, 2014
22046bb
new abundances type
mklauser Mar 25, 2014
3148500
documentation for the default config parser
mklauser Mar 25, 2014
2d805cd
New Version with support for the config given in the paper. New lagac…
mklauser Mar 31, 2014
641cf9b
New paper like config.
mklauser Apr 8, 2014
78b081e
new version of config
mklauser Apr 22, 2014
ca6e410
rebase
mklauser Apr 23, 2014
99689df
remove paper_def.yml
mklauser Apr 23, 2014
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
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 @@

Copy link
Member

Choose a reason for hiding this comment

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

@ssim this is what a config definition taking @mklauser's new configparser would look like. We believe we can also use that to easily generate a help file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok - looks good.

tardis_config_version:
property_type: string
help: Version of the configuration file
Copy link
Member

Choose a reason for hiding this comment

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

is a default keyword required or is it optional - same question about mandatory. What I'm asking is there a default for default, mandatory and help. Either way is fine - should be noted in the documentation.



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
Copy link
Member

Choose a reason for hiding this comment

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

why is _file a list? I understand that in containers you list the containers and then I presume that with _file you tell what the definition for this container is. I'm also wondering if you really need _file (maybe you do) and can just say there needs to be a <containtername>-property for every container.


_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 ####
Copy link
Member

Choose a reason for hiding this comment

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

So I haven't seen the constraints in there. It was in one of the earlier versions. Anyways there is like 3 filetypes allower ['artis', 'tardis_simple', 'some other filetype'] how do I tell this here (and also how do I tell it must be >0, e.g.). Putting this in the documentation and tests will also help future users and us see the usage cases.


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
Copy link
Member

Choose a reason for hiding this comment

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

I really do like your new range sampled using the [0, 10000, 1] syntax. Unfortunately, I wasn't aware of it when we were submitting the paper. The old syntax is a dictionary with keywords {start: 10 km/s, stop:20, km/s, num:10000} - is it easy to implement this as a property_type quantity_sampled_old? Otherwise, I can just write it out (specify each start, stop, and num as individual parameters.

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?
Copy link
Member

Choose a reason for hiding this comment

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

abundances are a difficult topic, Which we might have discussed. There are 92 elements and I think making an entry with default 0 for all of them is not sensible. How do we do that? Maybe we can just skip this key and leave as is when we validate a yaml file.




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


Loading