Skip to content

325 fillval bug#326

Merged
bryan-harter merged 2 commits intomainfrom
325-fillval-bug
Jan 9, 2026
Merged

325 fillval bug#326
bryan-harter merged 2 commits intomainfrom
325-fillval-bug

Conversation

@bryan-harter
Copy link
Member

No description provided.

@bryan-harter bryan-harter requested a review from Copilot January 9, 2026 18:57
@bryan-harter bryan-harter linked an issue Jan 9, 2026 that may be closed by this pull request
Copy link

Copilot AI left a comment

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 fixes a bug in the _convert_nans_to_fillval function where np.nan_to_num was being called incorrectly. The old code passed -1e31 as the second positional argument (which is the copy parameter), instead of using the named nan parameter. The fix properly uses nan=fill_value to replace NaN values in variable attributes with the appropriate fill value for each variable's data type.

Key Changes

  • Corrected two calls to np.nan_to_num to use the named parameter nan=fill_value instead of incorrectly passing -1e31 as a positional argument
  • Uses data-type-specific fill values (computed via _dtype_to_fillval) instead of the hardcoded -1e31

@bryan-harter bryan-harter merged commit 9b4c728 into main Jan 9, 2026
18 of 19 checks passed
@bryan-harter bryan-harter deleted the 325-fillval-bug branch January 9, 2026 19:04
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.

FILLVAL Bug?

2 participants