You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UXarray attempts to encode many different models into UGRID conventions, and this works well in most cases, but for HEALPix in particular there was a need to switch to different behavior in various places in order to get accurate results. In particular, the following all have special cases for how to handle HEALPix, in order to provide more accurate results by default: Grid.node_lon, Grid.node_lat, Grid.face_node_connectivity, Grid.face_areas.
Should this functionality be split off into a HealpixGrid subclass of Grid, just overriding any relevant methods? Refactoring like this would have main benefits of (1) easier code maintenance, (2) much easier to quickly see "which methods behave differently for HEALPix grids?" since they would all be grouped into one place, and (3) users who aren't using HEALPix don't need to think about it anymore, because HEALPix-specific docs and logical branches would no longer appear in the base Grid class.
One downside might be that it is a departure from the original design philosophy of wanting all grids to be encoded into UGRID conventions. But, I would argue that this departure has already occurred, it is just being hidden in the form of branching logic inside the Grid class, instead of separated to its own class.
Adding broad support for spectral elements was recently marked as not planned (see #1402), maybe because it would be too much of a lift and require weaving lots of if statements throughout existing grid methods? But, if there is some desire to treat spectral elements more accurately, perhaps a SpectralElementsGrid subclass could be created. Refactoring HEALPix branching logic into HealpixGrid subclass might be a good place to start, setting a precedent that could be followed later by something like SpectralElementsGrid, if desired.
developer experienceMakes the codebase easier to read, debug, maintain, or extend.designDesign of an API, feature, or user interface (not just implementation details)
1 participant
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
UXarray attempts to encode many different models into UGRID conventions, and this works well in most cases, but for HEALPix in particular there was a need to switch to different behavior in various places in order to get accurate results. In particular, the following all have special cases for how to handle HEALPix, in order to provide more accurate results by default:
Grid.node_lon,Grid.node_lat,Grid.face_node_connectivity,Grid.face_areas.Should this functionality be split off into a HealpixGrid subclass of Grid, just overriding any relevant methods? Refactoring like this would have main benefits of (1) easier code maintenance, (2) much easier to quickly see "which methods behave differently for HEALPix grids?" since they would all be grouped into one place, and (3) users who aren't using HEALPix don't need to think about it anymore, because HEALPix-specific docs and logical branches would no longer appear in the base Grid class.
One downside might be that it is a departure from the original design philosophy of wanting all grids to be encoded into UGRID conventions. But, I would argue that this departure has already occurred, it is just being hidden in the form of branching logic inside the Grid class, instead of separated to its own class.
Adding broad support for spectral elements was recently marked as not planned (see #1402), maybe because it would be too much of a lift and require weaving lots of if statements throughout existing grid methods? But, if there is some desire to treat spectral elements more accurately, perhaps a SpectralElementsGrid subclass could be created. Refactoring HEALPix branching logic into HealpixGrid subclass might be a good place to start, setting a precedent that could be followed later by something like SpectralElementsGrid, if desired.
All reactions