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

GridCoords constructor with @properties and @cached_properties #187

Closed
wants to merge 8 commits into from

Conversation

kadri-nizam
Copy link
Contributor

@kadri-nizam kadri-nizam commented Apr 5, 2023

Resolves #152

Repeated identical calculations for defining certain attributes are now done only once in the constructor and accessed via @properties. Non-identical attributes are set as @cached_properties and only computed once on first call.

@kadri-nizam kadri-nizam requested a review from iancze April 6, 2023 00:20
src/mpol/coordinates.py Outdated Show resolved Hide resolved
src/mpol/coordinates.py Outdated Show resolved Hide resolved
src/mpol/coordinates.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@iancze iancze 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 looks good and is ready to merge, but would appreciate finding a different variable for spatial frequency than f, preferably one that retains interpretability as u or v.

iancze added a commit that referenced this pull request Jan 5, 2024
Updated #187: GridCoords constructor with `@properties` and `@cached_properties`
@iancze
Copy link
Collaborator

iancze commented Jan 5, 2024

Merged into WIP-v0.3 branch by updated #250 . Thanks for the contribution, @kadri-nizam !

@iancze iancze closed this Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GridCoords object has many instance attributes that could be made methods decorated with property
2 participants