Skip to content

Conversation

davidhassell
Copy link
Collaborator

Fixes #777

Changes to:

  • cf/weights.py
  • cf/field.py
  • cf/test/test_Data.py

are not relevant to this PR, but are just some linting that crept in from somewhere else.

@davidhassell davidhassell added enhancement New feature or request um/pp Relating to UM or PP format files dataset read Relating to reading datasets labels May 30, 2024
@davidhassell davidhassell added this to the NEXT VERSION milestone May 30, 2024
Copy link
Member

@sadielbartholomew sadielbartholomew left a 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)
Copy link
Member

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea: b0119f5

@davidhassell davidhassell merged commit e367231 into NCAS-CMS:main Jun 11, 2024
@davidhassell davidhassell deleted the um-version branch June 11, 2024 09:10
@davidhassell davidhassell modified the milestones: NEXT VERSION, 3.16.3 Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dataset read Relating to reading datasets enhancement New feature or request um/pp Relating to UM or PP format files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request UM version to be passed through pp conversion
2 participants