Convert input.f90 to python#3552
Conversation
42c78b6 to
b765375
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3552 +/- ##
==========================================
+ Coverage 31.20% 31.59% +0.39%
==========================================
Files 83 84 +1
Lines 19945 20112 +167
==========================================
+ Hits 6223 6355 +132
- Misses 13722 13757 +35 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ccf63cc to
9faa9da
Compare
|
Differences seen in the once-through input files at 0% tolerance come from a slight difference parsing in Python vs Fortran. A difference is seen in the ST once through when parsing the following variables in Python instead of Fortran where the error accumulates more so due to the naive implementation (sum the digits multiplied by their place value). I have taken some of these variables and written a test into But all passed when using my new Python parser. Note that Fortran even had problem parsing simple numbers with one decimal place (ie they had an error that was large enough that Python did not consider them equal) |
9faa9da to
b6d7fd2
Compare
jonmaddock
left a comment
There was a problem hiding this comment.
This is great Tim, SO much better. Just some clarifying comments required please. Did you check out cerberus for this?
| variable_config, | ||
| ) | ||
|
|
||
| # again its the input name not the target name |
There was a problem hiding this comment.
Can this comment be clarified?
29498a7 to
fb5a88e
Compare
fb5a88e to
6bd85b4
Compare
jonmaddock
left a comment
There was a problem hiding this comment.
Great, I'm happy with this. Did you look into cerberus?
6bd85b4 to
25f4001
Compare
@jonmaddock I didn't end up using cerberus because the validation we implement here is very minimal and existing at the time of investigation. In future, it will be worth looking at this as we convert our data structure and IO formats. |
Converts PROCESS input file parsing, validation, and actioning (mostly setting variables) to Python
Limitations
Regression failures
It seems there is a slight rounding difference that is causing the regression tests to fail. At the moment, some of the optimising runs fail because they slightly drift off their usual course. This can observed by amending the
test_parse_realonmainand adding:[ ("0.546816593988753", 0.546816593988753), ("0.6", 0.6), ]The test fails with
It should be noted that this failure only happens when the difference is big enough, for example neither of the following fail despite asserting that the same parsed value is exactly equal to two slightly different values:
[ ("0.008", 0.0080000000000000002), ("0.008", 0.008), ]None of these tests fail on this branch
Notes
factor,ftolas an input anymore, they are HYBRD variables and should be removed.nvaras it should be obsoletedr_blkt_inboardanddr_blkt_outboard+i_blanket_type == 3because this just printed a message. It should be checked that the docs make this very clear.PROCESS/source/fortran/input.f90
Lines 1281 to 1307 in 6fc1dea
PROCESS/source/fortran/input.f90
Lines 1636 to 1643 in 6fc1dea