-
Notifications
You must be signed in to change notification settings - Fork 3
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
Closes #61: Added Rs dataset, updated README, and added pull request template #64
Closes #61: Added Rs dataset, updated README, and added pull request template #64
Conversation
SRDB/convert.py
Outdated
target_units_obj = cfunits.Units(target_units) | ||
|
||
# Handle specific cases with intermediate conversion steps | ||
if original_units == 'g m-2 y-1' and target_units == 'kg m-2 s-1': |
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.
I am a little unclear on why this "if" block is necessary. I don't use cfunits
but cf-units
, I know it is confusing. But both wrap UDUNITS2. Are they unable to directly convert g m-2 y-1
to kg m-2 s-1
?
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.
Yeah, it gave me an error, which is why I threw in the if-statement. I can give cf-units a try! I didn't realize there were two different ones... :-)
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.
At one point I had some PR's to them and they didn't respond and I made the switch. I wonder if it is because y
is not a unit in the UDUNITS database. You may try y-1
--> yr-1
and then see if the package just converts the 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.
What do you think of:
original_units = original_units.replace("y-1","yr-1")
and then your conform line?
.github/
. It probably has too much on it, and I haven't checked to see if it formats correctly. But I figure better than nothing! Let me know what you think about that too!Note: Oops, I forgot to remove the extra files via the .gitignore. Will remove those in next commit.
Pic of the Rs dataset: