Skip to content

Named Sections and utilities for joining sections (parent/child logic) and I/O #33

Merged
hdrake merged 23 commits intoMOM6-community:masterfrom
hdrake:add-named-Section-class
Aug 30, 2025
Merged

Named Sections and utilities for joining sections (parent/child logic) and I/O #33
hdrake merged 23 commits intoMOM6-community:masterfrom
hdrake:add-named-Section-class

Conversation

@hdrake
Copy link
Copy Markdown
Member

@hdrake hdrake commented Aug 30, 2025

This pull request introduces significant enhancements to the section handling functionality and improves the clarity and consistency of variable naming throughout the sectionate package. The most notable changes are the addition of a new Section class 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:

  • Added a new Section class (and GriddedSection subclass) to sectionate/section.py for representing named hydrographic sections, including methods for copying, reversing, and joining sections, and improved string representation.
  • Introduced a new catalog file Atlantic_transport_arrays.json containing coordinates for major Atlantic hydrographic sections, enabling easier access to standard section definitions.
  • Added a section to 1_creating_an_OSNAP_section.ipynb notebook to demonstrate the Section functionality, including by loading it the preset OSNAP West and OSNAP East sections.

Refactoring and consistency improvements:

  • Refactored variable names related to grid section indices and coordinates from isect, jsect, lonsect, latsect to i_c, j_c, lons_c, lats_c throughout 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:

  • Updated the xgcm dependency in pyproject.toml to require version >= 0.9.0 instead of using the latest from GitHub, improving reproducibility and stability.
  • Updated sectionate/__init__.py to expose the utils module and the load_section function for easier access.

hdrake and others added 22 commits October 8, 2024 12:33
- 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.
@hdrake hdrake requested a review from raphaeldussin August 30, 2025 13:08
@hdrake hdrake self-assigned this Aug 30, 2025
@hdrake hdrake added the enhancement New feature or request label Aug 30, 2025
@hdrake
Copy link
Copy Markdown
Member Author

hdrake commented Aug 30, 2025

@raphaeldussin, this supersedes #21

@hdrake hdrake merged commit 0c81223 into MOM6-community:master Aug 30, 2025
@hdrake hdrake deleted the add-named-Section-class branch September 18, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant