Skip to content

feat: preserve native dtype for SCHISM outputs - #12

Merged
kjnam merged 1 commit into
mainfrom
feat/use_own_type
Nov 9, 2026
Merged

kjnam merged 1 commit into
mainfrom
feat/use_own_type

Conversation

@kjnam

@kjnam kjnam commented Nov 6, 2026

Copy link
Copy Markdown
Member

This commit updates the code to keep the original data type from the SCHISM nc output files. Converting data types can be a performance bottolneck. To achieve this, we are dropping mask_and_scale.

  • Replace xarray mask_and_scale auto-promotion with safe float32 fill/missing value masking in read_schism_nc, open_grid, and open_ts_dataset.
  • Keep integer connectivity (SCHISM_hgrid_face_nodes) as integer types.
  • Support float32 and mixed precision in Numba kernels (_integrate_nodal, _integrate_triangle, _integrate_quad) and fix quad derivative typo.
  • Preserve input dtypes in SxDataArray.depth_average() and integration routines.
  • Update test fixtures and add unit tests validating float32 precision on single and mixed tri-quad meshes.
  • Remove float64 conversion workarounds from documentation notebooks.

This commit updates the code to keep the original data type from the
SCHISM nc output files. Converting data types can be a performance
bottolneck. To achieve this, we are dropping mask_and_scale.

- Replace xarray mask_and_scale auto-promotion with safe float32
fill/missing value masking in read_schism_nc, open_grid, and
open_ts_dataset.
- Keep integer connectivity (SCHISM_hgrid_face_nodes) as integer types.
- Support float32 and mixed precision in Numba kernels
(_integrate_nodal, _integrate_triangle, _integrate_quad) and fix quad
derivative typo.
- Preserve input dtypes in SxDataArray.depth_average() and integration
routines.
- Update test fixtures and add unit tests validating float32 precision
on single and mixed tri-quad meshes.
- Remove float64 conversion workarounds from documentation notebooks.
@kjnam
kjnam requested a review from aesgeorges November 6, 2026 19:18
@kjnam
kjnam merged commit 1167bc7 into main Nov 9, 2026
2 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.

2 participants