-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Adding Config Value Validation for Different Parameters via Config File #1554
Adding Config Value Validation for Different Parameters via Config File #1554
Conversation
I will be adding the validation for the Density as well ... But I have a query @Rodot-, Do we need to validate other parameters or other ways of parsing data such as the |
34fe02c
to
6c6fc89
Compare
Codecov Report
@@ Coverage Diff @@
## master #1554 +/- ##
==========================================
+ Coverage 68.18% 68.24% +0.05%
==========================================
Files 73 73
Lines 6308 6373 +65
==========================================
+ Hits 4301 4349 +48
- Misses 2007 2024 +17
Continue to review full report at Codecov.
|
These tests should be part of the JSON Schema, not if statements in code. See e.g. https://json-schema.org/understanding-json-schema/reference/numeric.html The schema are located in /tardis/io/schemas |
6e78ebb
to
e87a51f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far. I think @Rodot- can provide more parameters that should have additional validation.
A couple I can think of: Any physical quantity should be positive (temperatures, velocities, times, densities, etc). time_explosion can't be zero. For various density profiles, make sure that the start velocity is lower than the stop velocity. |
Hello, @andrewfullard @Rodot- ... While going through the code for validating the different parameters in the |
Another thing that is troubling me, |
f7fd1d9
to
a46c2cd
Compare
a8af420
to
af08045
Compare
Could you add some tests where you make sure that it fails on invalid config files in all of the places you added checks for? |
2cc7e0b
to
e8622bd
Compare
e8622bd
to
22ba5a4
Compare
9ff0082
to
ac10a4f
Compare
949bb07
to
3832d91
Compare
Hello @Rodot-, I have added the tests for all the required sections that are being validated in the |
@DhruvSondhi This is looking good, we just need some docstrings added to the tests then we should be good to merge |
@Rodot- @andrewfullard Should I squash all the commits? |
c5e7d2f
to
1cb311b
Compare
…le (tardis-sn#1554) * Adding Config Validation for Uniform Abundance via Schema * Adding Validation for time_explosion * Validating based on different sections * Fixing CSVY Tests Implementation * Added Configuration Validation Tests * Added Docstrings for the validation tests
This PR aims to implement config validation for values that are passed through the
.yml
file.This Implements #1343
Description
This PR aims to implement validation for values that can be passed through the tardis configuration file.
These are aimed at Density & Abundances in the current iteration.
Motivation and context
The tardis configuration file allows for non-realistic values to be passed without raising any errors. This PR aims to fix this & implement validation for the values so as to allow only real physics values to be added
How has this been tested?
Examples
None at current status :)
Type of change
Checklist