Skip to content

Avoid xarray to cast ints to float64 just to add a NaN#27

Merged
spiani merged 1 commit into
mainfrom
bugfix_open_rivers_with_filler
Apr 22, 2026
Merged

Avoid xarray to cast ints to float64 just to add a NaN#27
spiani merged 1 commit into
mainfrom
bugfix_open_rivers_with_filler

Conversation

@spiani

@spiani spiani commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@spiani spiani self-assigned this Apr 22, 2026
Copilot AI review requested due to automatic review settings April 22, 2026 10:34

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 aims to prevent xarray from decoding integer river maps into float64 (to represent missing values as NaN) when generating OB indices, reducing unnecessary dtype changes and associated overhead.

Changes:

  • Adjust xarray.open_dataset usage for reading the rivers variable to disable masking/scaling.
  • Update a debug log message in OB indices generation.
  • Reduce logging noise by raising the numba logger level.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/mitgcm_inputs/ob_indices/ob_indices.py Tweaks a debug log message emitted during boundary strip extraction.
src/mitgcm_inputs/ob_indices/__init__.py Changes how the rivers dataset is opened to avoid xarray masking/scaling behavior.
src/mitgcm_inputs/__main__.py Adds numba to the list of loggers whose verbosity is reduced.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/mitgcm_inputs/ob_indices/ob_indices.py
Comment thread src/mitgcm_inputs/ob_indices/__init__.py
@spiani spiani merged commit c238c06 into main Apr 22, 2026
5 checks passed
@spiani spiani deleted the bugfix_open_rivers_with_filler branch April 22, 2026 10:39
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