Named Sections and utilities for joining sections (parent/child logic) and I/O #33
Merged
hdrake merged 23 commits intoMOM6-community:masterfrom Aug 30, 2025
Merged
Conversation
- Implemented new `GriddedSection` class that combines a `Section` with a `grid` and upon instantiation calls the `grid_section` method, which calls the more general `grid_section` on the properties of the `Section`. It stores both the original section coordinates and the grid-following section coordinates as class attributes. - Adds sections to the initial tutorial notebook to showcase both `Section` and `GriddedSection` - Makes the display(Section) more informative and prettier - Adds display(GriddedSection) - Documents `join_sections` - Bumps version to `0.3.0` from `0.2.2`
Fix typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Also added Docstrings for all of the new utility functions
This PR finally replaces the dependency on un-released xgcm features in the main branch (which prevented registering sectionate with conda) with the requirement that the xgcm version be at least v0.9.0.
Upgrade xgcm to v0.9.0
Member
Author
|
@raphaeldussin, this supersedes #21 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant enhancements to the section handling functionality and improves the clarity and consistency of variable naming throughout the
sectionatepackage. The most notable changes are the addition of a newSectionclass for representing hydrographic sections, the introduction of a comprehensive catalog of Atlantic transport arrays, and a refactor of grid section variable names for clarity and consistency.New features and enhancements:
Sectionclass (andGriddedSectionsubclass) tosectionate/section.pyfor representing named hydrographic sections, including methods for copying, reversing, and joining sections, and improved string representation.Atlantic_transport_arrays.jsoncontaining coordinates for major Atlantic hydrographic sections, enabling easier access to standard section definitions.1_creating_an_OSNAP_section.ipynbnotebook to demonstrate theSectionfunctionality, including by loading it the presetOSNAP WestandOSNAP Eastsections.Refactoring and consistency improvements:
isect,jsect,lonsect,latsecttoi_c,j_c,lons_c,lats_cthroughout the section grid utilities for improved clarity and naming consistency. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Dependency and import updates:
xgcmdependency inpyproject.tomlto require version>= 0.9.0instead of using the latest from GitHub, improving reproducibility and stability.sectionate/__init__.pyto expose theutilsmodule and theload_sectionfunction for easier access.