Skip to content

Update get_default_fill_value to be compatible with numpy >=2.0.0 #35

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

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions obsarray/templater/dataset_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,15 +454,15 @@ def get_default_fill_value(dtype: numpy.typecodes) -> Union[int, float]:
if dtype == numpy.int8:
return numpy.int8(-127)
if dtype == numpy.uint8:
return numpy.uint8(-1)
return numpy.iinfo(numpy.uint8).max
elif dtype == numpy.int16:
return numpy.int16(-32767)
elif dtype == numpy.uint16:
return numpy.uint16(-1)
return numpy.iinfo(numpy.uint16).max
elif dtype == numpy.int32:
return numpy.int32(-2147483647)
elif dtype == numpy.uint32:
return numpy.uint32(-1)
return numpy.iinfo(numpy.uint32).max
elif dtype == numpy.int64:
return numpy.int64(-9223372036854775806)
elif dtype == numpy.float32:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def read(filename):
description="Measurement data handling in Python",
long_description=read("README.md"),
packages=find_packages(exclude=("tests",)),
install_requires=["comet_maths", "netcdf4==1.6.5", "xarray"],
install_requires=["comet_maths", "netcdf4", "xarray"],
extras_require={
"dev": [
"pre-commit",
Expand Down
Loading