Skip to content

fix: handle temporal state vars in synchronize(); silence NaN cast wa…#154

Merged
profsergiocosta merged 1 commit into
developfrom
fix-rasterbackend
Jun 15, 2026
Merged

fix: handle temporal state vars in synchronize(); silence NaN cast wa…#154
profsergiocosta merged 1 commit into
developfrom
fix-rasterbackend

Conversation

@profsergiocosta

Copy link
Copy Markdown
Contributor

…rning

  • sync_model.py: SyncRasterModel.synchronize() now takes arr[0] when a state variable is stored as (time, y, x) — happens when to_lucc_data() loads a variable that has temporal catalog entries. After the first step the model writes back 2D arrays so subsequent snapshots are 2D.
  • io/raster.py: fill NaN/inf with the band nodata value before casting to integer dtype, eliminating the RuntimeWarning from float→int16 cast when raster arrays contain masked cells.

…rning

- sync_model.py: SyncRasterModel.synchronize() now takes arr[0] when a
  state variable is stored as (time, y, x) — happens when to_lucc_data()
  loads a variable that has temporal catalog entries. After the first step
  the model writes back 2D arrays so subsequent snapshots are 2D.
- io/raster.py: fill NaN/inf with the band nodata value before casting to
  integer dtype, eliminating the RuntimeWarning from float→int16 cast when
  raster arrays contain masked cells.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@profsergiocosta profsergiocosta merged commit 40e06dc into develop Jun 15, 2026
4 checks passed
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.

1 participant