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.
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
Dimensionless Units #55
base: main
Are you sure you want to change the base?
Dimensionless Units #55
Changes from 1 commit
668c052
c05ba93
b1ef7f2
7900103
9da4cf8
367a1fc
7d9d910
0d7f331
9b0b05e
1c5b69b
e88b52a
cc4f159
78f82a6
c6c8a7f
6fbc69f
aa51c32
aaa1f19
0ba5fac
6bb99ff
d066700
64d94ae
4eb1478
36fcefd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This is not a check. You just call the actual conversion function. That's supposed to happen in
process
. I think you instead should see if the variable has supplied dimensionless units, and if those are defined in a way that pint will be able to handle it.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.
okay. will rewrite it.
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.
Question: how to know the unit in the netcdf file without accessing it. I can check the
cmor_variable
(table unit) alone from the rule object if it dimensionless and if the unit mapping is found in dimensionless_units but how about the source units. Ifmodel_variable
is defined then I can check it as well but that means the user wants to usemodel_variable
instead of the units found in the netcdf file.consider the following table
If I just check the
tableunit
, then I can not catchsidmasstranx
failing and forsitimefrac
the check will fail as it is dimensionless and there is no entry in the mapping for it yet but if the user puts an mapping entry for this variable then it still fails as source units (from netcdf file or user defined modelunits) are still dimensionless and the unit conversion function does not consider using mapping for source units.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.
The re-written code only deals with dimensionless variables (i.e., ignoring
sidmasstranx
case) and addresses the rest of the cases.