Skip to content

Commit f1a90dd

Browse files
committed
Fix warnings about numpy._NoValue
1 parent fa4a84c commit f1a90dd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

odc/geo/_xr_interop.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
)
5151
from .overlap import compute_output_geobox
5252
from .roi import roi_is_empty
53-
from .types import Nodata, Resolution, SomeNodata, SomeResolution, SomeShape, xy_
53+
from .types import Nodata, Resolution, SomeNodata, SomeResolution, SomeShape, Unset, xy_
5454

5555
# pylint: disable=import-outside-toplevel
5656
# pylint: disable=too-many-lines
@@ -80,6 +80,8 @@
8080
("lat", "lon"),
8181
]
8282

83+
_NoValue = Unset()
84+
8385

8486
@dataclass
8587
class GeoState:
@@ -1024,11 +1026,11 @@ def nodata(self) -> Nodata:
10241026
encoding = self._xx.encoding
10251027

10261028
for k in ["nodata", "_FillValue"]:
1027-
nodata = attrs.get(k, numpy._NoValue)
1028-
if nodata is numpy._NoValue:
1029-
nodata = encoding.get(k, numpy._NoValue)
1029+
nodata = attrs.get(k, _NoValue)
1030+
if nodata is _NoValue:
1031+
nodata = encoding.get(k, _NoValue)
10301032

1031-
if nodata is numpy._NoValue:
1033+
if nodata is _NoValue:
10321034
continue
10331035

10341036
if nodata is None:

0 commit comments

Comments
 (0)