Skip to content

Fix datetime conversion failures observed with NumPy 2.5 - #344

Open
leowerneck wants to merge 1 commit into
lasp:mainfrom
leowerneck:lw/issue343
Open

Fix datetime conversion failures observed with NumPy 2.5#344
leowerneck wants to merge 1 commit into
lasp:mainfrom
leowerneck:lw/issue343

Conversation

@leowerneck

Copy link
Copy Markdown
Collaborator

Overview

Closes #343

Description

This PR fixes datetime conversion failures observed with NumPy 2.5 by:

  • Adopting a representable placeholder year while composing fill/pad timestamps before converting them to NaT, preventing a segmentation fault.
  • Preserving numeric FILLVAL, VALIDMIN, and VALIDMAX metadata on CDF time variables, preventing TT2000 overflow during xarray round trips.

Testing

Running:

uv sync --extra tests
uv run pytest

results in 82 passed, 25 skipped, 46 warnings. Running:

uv run pytest --remote-data

results in previously failing tests passing (though, admittedly, I am getting a couple of persistent urllib.error.HTTPError: HTTP Error 429: Too Many Requests errors locally).

@leowerneck leowerneck changed the title Fixes datetime conversion failures observed with NumPy 2.5 Fix datetime conversion failures observed with NumPy 2.5 Aug 19, 2026
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.

NumPy 2.5 causes segfault and datetime overflow during CDF/xarray conversion

1 participant