Skip to content

GridCoords constructor with @properties and @cached_properties#187

Closed
kadri-nizam wants to merge 8 commits intoMPoL-dev:mainfrom
kadri-nizam:#152-coordinates
Closed

GridCoords constructor with @properties and @cached_properties#187
kadri-nizam wants to merge 8 commits intoMPoL-dev:mainfrom
kadri-nizam:#152-coordinates

Conversation

@kadri-nizam
Copy link
Copy Markdown
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
Comment thread src/mpol/coordinates.py Outdated
Comment thread src/mpol/coordinates.py Outdated
Comment thread src/mpol/coordinates.py Outdated
Comment thread src/mpol/coordinates.py
Copy link
Copy Markdown
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.

Comment thread src/mpol/coordinates.py
iancze added a commit that referenced this pull request Jan 5, 2024
Updated #187: GridCoords constructor with `@properties` and `@cached_properties`
@iancze
Copy link
Copy Markdown
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