-
Notifications
You must be signed in to change notification settings - Fork 20
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
Include the UM version as a field property when reading UM files #778
Conversation
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.
One small code-related suggestion, but overall this is all good. Please merge when ready.
# Convert the UM version to a string and provide it as a | ||
# CF property. E.g. 405 -> '4.5', 606.3 -> '6.6.3', 1002 | ||
# -> '10.2' | ||
a, b = divmod(int(self.um_version), 100) |
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 was wondering why, for the fraction component, you didn't just accept the raw numeric and then seeing this I realise it is to do with the floating point conversion:
>>> divmod(606.3, 100)
(6.0, 6.2999999999999545)
Might be worth a one-line comment, since I was curious enough to look into that?
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.
Good idea: b0119f5
Fixes #777
Changes to:
are not relevant to this PR, but are just some linting that crept in from somewhere else.