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

Fix fuser handling in plugin layer. #8

Merged
merged 5 commits into from
Nov 23, 2021
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
14 changes: 7 additions & 7 deletions docker/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
#
# This file is autogenerated by pip-compile with python 3.8
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile --no-annotate --no-build-isolation --output-file=constraints.txt --strip-extras requirements.txt
#
affine==2.3.0
aiobotocore==1.4.2
aiobotocore==2.0.0
aiohttp==3.7.4.post0
aioitertools==0.8.0
alabaster==0.7.12
argon2-cffi==20.1.0
astroid==2.7.2
async-timeout==3.0.1
attrs==21.2.0
awscli==1.19.106
awscli==1.21.8
azure-core==1.17.0
azure-storage-blob==12.8.1
babel==2.9.1
backcall==0.2.0
bleach==4.0.0
bokeh==2.3.3
boltons==21.0.0
boto3==1.17.106
botocore==1.20.106
boto3==1.19.8
botocore==1.22.8
bottleneck==1.3.2
cachetools==4.2.2
cattrs==1.8.0
Expand All @@ -42,7 +42,6 @@ cryptography==3.4.7
cycler==0.10.0
dask==2021.8.1
dask-image==0.6.0
dataclasses==0.6
datacube==1.8.6
debugpy==1.4.1
decorator==5.0.9
Expand Down Expand Up @@ -115,6 +114,7 @@ notebook==6.4.3
numexpr==2.7.3
numpy==1.21.2
oauthlib==3.1.1
odc-stac==0.2.2
ordered-set==4.0.2
packaging==21.0
pandas==1.3.2
Expand Down Expand Up @@ -168,7 +168,7 @@ rio-stac==0.3.1
rsa==4.7.2
ruamel.yaml==0.17.13
ruamel.yaml.clib==0.2.6
s3transfer==0.4.2
s3transfer==0.5.0
scikit-image==0.18.2
scipy==1.7.1
send2trash==1.8.0
Expand Down
16 changes: 10 additions & 6 deletions docker/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@ datacube[dev]==1.8.6

# need to constrain this one for pip-sake
# Fixing this allows pip resolution without constraints.txt
aiobotocore[boto3,awscli]==1.4.2
aiobotocore[boto3,awscli]==2.0.0

# Make sure dask has all the features enabled
dask[complete]

eodatasets3
eodatasets3>=0.22.0

# not needed for python 3.8 and up, and are not installed,
# but `pip check` doesn't know better
dataclasses
# hdstats for open source version:
hdstats>=0.1.8

# hdstats for faster binary-only version:
# --extra-index-url https://packages.dea.ga.gov.au/
# hdstats==0.1.8.post1

# other top level dependencies of odc. libraries/apps
affine
Expand All @@ -45,7 +48,6 @@ dask_image
deepdiff
fsspec
google-cloud-storage
hdstats>=0.1.7.post5
ipyleaflet
ipywidgets
jinja2
Expand All @@ -69,3 +71,5 @@ toolz
tqdm
xarray
zstandard


2 changes: 1 addition & 1 deletion odc/stats/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.6a"
__version__ = "1.0.7"
3 changes: 2 additions & 1 deletion odc/stats/plugins/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from datacube.utils.geometry import GeoBox
from odc.algo import to_rgba
from odc.algo.io import load_with_native_transform
from odc.algo._masking import _nodata_fuser


class StatsPluginInterface(ABC):
Expand Down Expand Up @@ -40,7 +41,7 @@ def native_transform(self, xx: xr.Dataset) -> xr.Dataset:
return xx

def fuser(self, xx: xr.Dataset) -> xr.Dataset:
return xx
return _nodata_fuser(xx)

def input_data(self, datasets: Sequence[Dataset], geobox: GeoBox) -> xr.Dataset:
xx = load_with_native_transform(
Expand Down
11 changes: 7 additions & 4 deletions odc/stats/plugins/gm.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Geomedian
"""
from typing import Optional, Sequence, Tuple, Iterable
from typing import Optional, Mapping, Sequence, Tuple, Iterable
import xarray as xr
from datacube.model import Dataset
from datacube.utils.geometry import GeoBox
Expand Down Expand Up @@ -30,6 +30,8 @@ def __init__(
):
self.bands = tuple(bands)
self._mask_band = mask_band
if nodata_classes is not None:
nodata_classes = tuple(nodata_classes)
self._nodata_classes = nodata_classes
input_bands = self.bands
if self._nodata_classes is not None:
Expand All @@ -41,11 +43,12 @@ def __init__(
basis=basis_band or self.bands[0],
**kwargs)

if nodata_classes is not None:
nodata_classes = tuple(nodata_classes)

self.cloud_classes = tuple(cloud_classes)
# if filters:
# self.filters: Optional[Mapping] = dict(filters)
self.filters = filters
# else:
# self.filters = None

self._renames = aux_names
self.aux_bands = tuple(
Expand Down