Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning in pp file saving #5492

Open
Tracked by #5466
acchamber opened this issue Sep 12, 2023 · 0 comments
Open
Tracked by #5466

DeprecationWarning in pp file saving #5492

acchamber opened this issue Sep 12, 2023 · 0 comments

Comments

@acchamber
Copy link
Contributor

🐛 Bug Report

When you run the Iris pytest, the following warning appears

lib/iris/tests/system_test.py: 1 warning
lib/iris/tests/test_cdm.py: 1 warning
lib/iris/tests/test_cube_to_pp.py: 58 warnings
lib/iris/tests/test_file_save.py: 8 warnings
lib/iris/tests/test_pp_cf.py: 6 warnings
lib/iris/tests/integration/test_pp.py: 2 warnings
lib/iris/tests/integration/fast_load/test_fast_load.py: 188 warnings
lib/iris/tests/unit/fileformats/um/fast_load/test_FieldCollation.py: 16 warnings
  /net/home/h05/achamber/git/iris/lib/iris/fileformats/pp.py:1199: DeprecationWarning: NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays.  The conversion of -99 to uint32 will fail in the future.
  For the old behavior, usually:
      np.array(value).astype(dtype)
  will give the desired result (the cast overflows).
    lb[index] = header_elem

Simply replacing the offending line with `lb[index] = np.array(header_elem).astype(dtype) causes new errors, and I'm not familiar enough with the PP saving functions to be aware what is and isn't a problem. Reporting this so it's recorded for future viewing by someone with better understanding of the PP format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants