Skip to content

Added obindices function#22

Merged
spiani merged 14 commits into
mainfrom
ob_indices
Mar 16, 2026
Merged

Added obindices function#22
spiani merged 14 commits into
mainfrom
ob_indices

Conversation

@spiani

@spiani spiani commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 12, 2026 16:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_indices package with logic to compute OB indices + CLI entrypoint.
  • Registered the new ob_indices command in src/mitgcm_inputs/__main__.py and 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.

Comment thread src/mitgcm_inputs/ob_indices/__init__.py
Comment thread src/mitgcm_inputs/ob_indices/__init__.py Outdated
Comment thread pyproject.toml
Comment thread launcers/all_statics/generate_mer_statics.sh Outdated
Comment thread src/mitgcm_inputs/ob_indices/__init__.py Outdated
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]

Copilot AI Mar 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
open_on_boundary = mask.shape[domain_index + 1]
open_on_boundary = mask.shape[sponge_index + 1]

Copilot uses AI. Check for mistakes.
Comment thread src/mitgcm_inputs/ob_indices/ob_indices.py Outdated
spiani and others added 5 commits March 12, 2026 17:42
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>
@spiani spiani merged commit 3b1cdb6 into main Mar 16, 2026
1 check passed
@spiani spiani deleted the ob_indices branch March 16, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants