Resolve type consistency in C-Mod validity range metadata - #589
Open
nbarbour13 wants to merge 1 commit into
Open
Resolve type consistency in C-Mod validity range metadata#589nbarbour13 wants to merge 1 commit into
nbarbour13 wants to merge 1 commit into
Conversation
…to disruption_py/machine/cmod/config.toml.
Member
|
alright! you definitely need the decimal point, but do you need the following 0 digit? |
Author
Surprisingly, yes: https://toml.io/en/v1.0.0#float |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
TOML uses strong typing as it parses the config.toml files. Disruption-py physics variables write as floats.
Currently, some validity ranges for C-Mod contain no “.” characters in either the lower or upper bound, prompting TOML to interpret the range bounds as integers (C long long). This causes the resulting netCDF metadata headers to have a type mismatch when viewed with
ncdump -h. While not strictly a problem, this can be cleaned up with edits to theconfig.toml.Example output from current dev branch:

Implementation
Performed a pass over validity ranges for all machines and inserted “.” to prompt type translation to float. Presently, only C-Mod has validity ranges, so all changes were made to
disruption_py/machine/cmod/config.toml. I have added "." characters to all ints for consistency, even in cases where an int was paired with a float (e.g.validity = [0.1, 40]becomesvalidity = [0.1, 40.0]).Out of Scope
This PR is intended as a lightweight change in support of FY26 milestones. A full review and functional integration of validity ranges is left for future work.