Added obindices function#22
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new ob_indices CLI subcommand under mitgcm_inputs intended to generate MITgcm open-boundary indices (and optional sponge/nudging indices), and wires it into the main CLI + a launcher script; it also includes dependency / tooling updates and some formatting cleanups.
Changes:
- Added
mitgcm_inputs.ob_indicespackage with logic to compute OB indices + CLI entrypoint. - Registered the new
ob_indicescommand insrc/mitgcm_inputs/__main__.pyand updated a domain-generation launcher to call it. - Updated dependencies/lockfile and pre-commit hook versions; performed small whitespace/formatting cleanups.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/mitgcm_inputs/ob_indices/ob_indices.py | New OB-index generation logic (boundary slicing, component detection, MITgcm run-length encoding). |
| src/mitgcm_inputs/ob_indices/init.py | New CLI subcommand definition and I/O plumbing for ob_indices. |
| src/mitgcm_inputs/main.py | Registers ob_indices subcommand and adjusts logging noise filtering. |
| launcers/all_statics/generate_mer_statics.sh | Runs mitgcm_inputs ob_indices for each domain and adds GNU parallel execution. |
| pyproject.toml | Adds numba dependency and deptry ignore entry. |
| poetry.lock | Updates lockfile (bitsea ref bump and multiple package version bumps; adds numba/llvmlite). |
| .pre-commit-config.yaml | Updates hook versions and removes ruff-format hook. |
| src/mitgcm_inputs/rbcs/scarichi_json_gen.py | Argparse help formatting change only. |
| src/mitgcm_inputs/rbcs/rbcs_gen.py | Argparse help formatting change + whitespace cleanup. |
| src/mitgcm_inputs/rbcs/fiumi_json_gen.py | Argparse help formatting change only. |
| src/mitgcm_inputs/rbcs/init.py | Whitespace cleanup only. |
| src/mitgcm_inputs/surface_deposition/surface_deposition.py | Whitespace cleanup only. |
| src/mitgcm_inputs/surface_deposition/init.py | Whitespace cleanup only. |
| src/mitgcm_inputs/k_extinction/k_extinction.py | Whitespace cleanup only. |
| src/mitgcm_inputs/k_extinction/init.py | Whitespace cleanup only. |
| src/mitgcm_inputs/bottom_fluxes/bottom_fluxes.py | Whitespace cleanup only. |
| src/mitgcm_inputs/bottom_fluxes/init.py | Whitespace cleanup only. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| open_on_boundary = 1 | ||
| else: | ||
| # Here we add a +1 because we need to skip the depth index | ||
| open_on_boundary = mask.shape[domain_index + 1] |
There was a problem hiding this comment.
open_on_boundary uses mask.shape[domain_index + 1], but the boundary coordinate that needs to be reported for EAST/NORTH is the sponge axis size (x for EAST, y for NORTH). With the current indexing, NORTH uses Nx and EAST uses Ny, producing incorrect boundary indices. Use mask.shape[sponge_index + 1] (still +1 to skip the depth dimension) for the end-boundary value.
| open_on_boundary = mask.shape[domain_index + 1] | |
| open_on_boundary = mask.shape[sponge_index + 1] |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.