Skip to content

pointCollection/grid/data.py : write boolean fields as bytes, with a … - #68

Merged
SmithB merged 1 commit into
mainfrom
bool_grid_fields
Nov 9, 2026
Merged

SmithB merged 1 commit into
mainfrom
bool_grid_fields

Conversation

@SmithB

@SmithB SmithB commented Nov 9, 2026

Copy link
Copy Markdown
Owner

…nodata value of 255

to_h5 and to_nc created boolean datasets with the NaN fill value used for other fields, which failed, and the exception was swallowed, so boolean fields (e.g. LSsurf's z0 and dz masks) were silently left out of the files. Boolean fields are now written as uint8 (0 and 1) with a fill value of 255; they read back as float. The in-memory fields are unchanged.

tests/test_grid_bool_fields.py : tests for the above (h5 and nc, 2-D and 3-D)

…nodata value of 255

to_h5 and to_nc created boolean datasets with the NaN fill value used for
other fields, which failed, and the exception was swallowed, so boolean
fields (e.g. LSsurf's z0 and dz masks) were silently left out of the files.
Boolean fields are now written as uint8 (0 and 1) with a fill value of 255;
they read back as float.  The in-memory fields are unchanged.

tests/test_grid_bool_fields.py : tests for the above (h5 and nc, 2-D and 3-D)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SmithB
SmithB merged commit 6f8267f into main Nov 9, 2026
2 checks passed
@SmithB
SmithB deleted the bool_grid_fields branch November 10, 2026 19:43
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