Skip to content

Commit

Permalink
Fix warnings about numpy._NoValue
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill888 committed Dec 16, 2024
1 parent bf77295 commit 62b7c5e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions odc/geo/_xr_interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
)
from .overlap import compute_output_geobox
from .roi import roi_is_empty
from .types import Nodata, Resolution, SomeNodata, SomeResolution, SomeShape, xy_
from .types import Nodata, Resolution, SomeNodata, SomeResolution, SomeShape, Unset, xy_

# pylint: disable=import-outside-toplevel
# pylint: disable=too-many-lines
Expand Down Expand Up @@ -80,6 +80,8 @@
("lat", "lon"),
]

_NoValue = Unset()


@dataclass
class GeoState:
Expand Down Expand Up @@ -1024,11 +1026,11 @@ def nodata(self) -> Nodata:
encoding = self._xx.encoding

for k in ["nodata", "_FillValue"]:
nodata = attrs.get(k, numpy._NoValue)
if nodata is numpy._NoValue:
nodata = encoding.get(k, numpy._NoValue)
nodata = attrs.get(k, _NoValue)
if nodata is _NoValue:
nodata = encoding.get(k, _NoValue)

if nodata is numpy._NoValue:
if nodata is _NoValue:
continue

if nodata is None:
Expand Down

0 comments on commit 62b7c5e

Please sign in to comment.