-
Notifications
You must be signed in to change notification settings - Fork 148
Add axes
and get_axis_dim
to BaseGrid and other cleanup
#2080
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
Conversation
Wasn't used anymore in the codebase
Overloaded behaviour that wasn't justified/used in the rest of the codebase.
Was in environment.yaml file - wasn't in the pyproject.toml file though
These variables mainly apply to structured grids. With the new API, they aren't needed in the codebase (we can add this on the repective grid classes if needed).
Also added some simple tests in test_uxgrid.py
parcels/basegrid.py
Outdated
@abstractmethod | ||
def get_axis_dim(self, axis: str) -> int: | ||
""" | ||
Return the dimensionality (number of cells/edges) along a specific axis. |
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.
Return the dimensionality (number of cells/edges) along a specific axis. | |
Return the dimensionality (number of cells/faces) along a specific axis. |
I think that this should be cells/faces and not 'edges'. This is what we ravel against - so edges don't really apply (since particles can't occupy that)
We can remove the helper function now that we have the understanding in UxGrid that the vertical position is explicitly relative to the vertical layers. |
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.
Looks good; one question below
Changes:
axes
andget_axis_dim()
to the BaseGrid class with corresponding implementations in the UxGrid and XGrid classes. Also moved ravel/unravel logic to the BaseGrid class (fixes Addingaxes
andget_axis_dim
to BaseGrid #2056)lon, lat, depth
from the Field classOpen questions:
@fluidnumerics-joe, the implementation of
Field.depth
differed fromUxGrid.depth
- with the former using a helper functionget_vertical_location_from_dims
. Is this function still needed, or can we remove it?Chose the correct base branch (
main
for v3 changes,v4-dev
for v4 changes)Fixes Adding
axes
andget_axis_dim
to BaseGrid #2056Added tests
Added documentation