Skip to content

Fix record parsing with NumPy 2 - #14

Merged
cfbastarz merged 2 commits into
mainfrom
codex/fix-typeerror-in-read_records-method
Sep 30, 2026
Merged

cfbastarz merged 2 commits into
mainfrom
codex/fix-typeerror-in-read_records-method

Conversation

@cfbastarz

Copy link
Copy Markdown
Collaborator

Motivation

  • Fix a TypeError: data type '|a5' not understood raised when creating np.dtype because the |a5 alias was removed in NumPy 2.
  • Preserve the exact five-byte layout of the variable-name fields in GSI .gcv background-error records so binary parsing remains correct.

Description

  • Replace the removed |a5 dtype with the supported fixed-width byte-string dtype S5 for the eight identifier fields (sf, vp, t, q, oz, cw, ps, sst) in gsiberror/__init__.py.
  • Keep all numeric and shaped record definitions unchanged so the file-layout and parsing order are preserved.
  • Remove trailing whitespace on the modified lines to satisfy git diff --check style checks.

Testing

  • Ran python -m compileall -q gsiberror which completed successfully though it emitted preexisting SyntaxWarnings unrelated to this change.
  • Ran git diff --check and a code search (rg) to confirm removal of |a5 and presence of S5 in the updated fields, both of which passed.
  • Attempted to install numpy>=2 and run an end-to-end runtime test but installation failed due to the environment network/proxy restrictions, so runtime verification against NumPy 2 could not be executed.

Codex Task

@cfbastarz
cfbastarz merged commit 0ebca34 into main Sep 30, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant