Skip to content

Commit bcbc2ac

Browse files
authored
Merge pull request #35 from comet-toolkit/type_fixes
Update `get_default_fill_value` to be compatible with numpy >=2.0.0
2 parents e69e81f + 8866481 commit bcbc2ac

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

obsarray/templater/dataset_util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,15 +454,15 @@ def get_default_fill_value(dtype: numpy.typecodes) -> Union[int, float]:
454454
if dtype == numpy.int8:
455455
return numpy.int8(-127)
456456
if dtype == numpy.uint8:
457-
return numpy.uint8(-1)
457+
return numpy.iinfo(numpy.uint8).max
458458
elif dtype == numpy.int16:
459459
return numpy.int16(-32767)
460460
elif dtype == numpy.uint16:
461-
return numpy.uint16(-1)
461+
return numpy.iinfo(numpy.uint16).max
462462
elif dtype == numpy.int32:
463463
return numpy.int32(-2147483647)
464464
elif dtype == numpy.uint32:
465-
return numpy.uint32(-1)
465+
return numpy.iinfo(numpy.uint32).max
466466
elif dtype == numpy.int64:
467467
return numpy.int64(-9223372036854775806)
468468
elif dtype == numpy.float32:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def read(filename):
2525
description="Measurement data handling in Python",
2626
long_description=read("README.md"),
2727
packages=find_packages(exclude=("tests",)),
28-
install_requires=["comet_maths", "netcdf4==1.6.5", "xarray"],
28+
install_requires=["comet_maths", "netcdf4", "xarray"],
2929
extras_require={
3030
"dev": [
3131
"pre-commit",

0 commit comments

Comments
 (0)