Skip to content
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

Improver api changes #2031

Merged
merged 2 commits into from
Sep 20, 2024
Merged

Improver api changes #2031

merged 2 commits into from
Sep 20, 2024

Conversation

cpelley
Copy link
Contributor

@cpelley cpelley commented Sep 17, 2024

Some left over changes to IMPROVER api to support eppgl_precip_type configuration for EPP.

  • improver.utilities.cube_manipulation missing from api list (needed for EPP).
  • Updated StandardiseMetadata plugin so that arguments have been moved to the init to make in line with IMPROVER guidelines.

Issues

@cpelley cpelley requested a review from mspelman07 September 19, 2024 09:05
Copy link
Contributor

@mspelman07 mspelman07 left a comment

Choose a reason for hiding this comment

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

I think this PR is good. All the tests pass and I've just added one question for my interest rather than being a blocker to merging.

cube.rename(self._new_name)
if self._new_units:
cube.convert_units(self._new_units)
if self._coords_to_remove:
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious why you added the underscores to start of these. i.e. why not update it as self.new_name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good software design - all data should be hidden within its class so that users don't accidentally (or purposely) change data owned by the class (hidden in the Python sense by convention, not truly 'hidden').

If you are interested, a recommended reading:
"Object-Oriented Design Heuristics" by Arthur J. Riel

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to feed curiosity, if you wanted to expose this data to users, it would be exposed via setter and getter methods.

@cpelley cpelley merged commit cc8fa30 into master Sep 20, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants