From 23e7313e19018b9e388937c9974cd5ec5cea196b Mon Sep 17 00:00:00 2001 From: Emma Ai Date: Thu, 16 Jan 2025 10:44:31 +1030 Subject: [PATCH] Mark geomad nodata in landcover level1 (#181) * mark landcover level1 as nodata when geomad nodata * pin datacube<1.9 * fix landcover level1 test * fix failed action * pin scipy<1.15 due to geomad --------- Co-authored-by: Emma Ai --- .github/workflows/statistician-dive.yml | 2 +- docker/env.yaml | 2 +- docker/requirements.txt | 2 +- odc/stats/plugins/lc_veg_class_a1.py | 3 ++- setup.cfg | 2 +- tests/requirements.txt | 2 +- tests/test_landcover_plugin_a1.py | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/statistician-dive.yml b/.github/workflows/statistician-dive.yml index 8c457f57..2fd5d3e9 100644 --- a/.github/workflows/statistician-dive.yml +++ b/.github/workflows/statistician-dive.yml @@ -47,7 +47,7 @@ jobs: wagoodman/dive:v0.12.0 --ci-config /.dive-ci ${ORG}/${IMAGE}:_build - name: Docker image size check - uses: wemake-services/docker-image-size-limit@master + uses: wemake-services/docker-image-size-limit@2.0.0 with: image: ${{ env.ORG }}/${{ env.IMAGE}}:_build size: "3 GiB" diff --git a/docker/env.yaml b/docker/env.yaml index 3a3b64ef..23d1a808 100644 --- a/docker/env.yaml +++ b/docker/env.yaml @@ -112,7 +112,7 @@ dependencies: - s3fs - s3transfer - scikit-image - - scipy + - scipy<1.15 - sentry-sdk - setuptools-scm - Shapely>=2.0 diff --git a/docker/requirements.txt b/docker/requirements.txt index 53c6ce57..09575bc8 100644 --- a/docker/requirements.txt +++ b/docker/requirements.txt @@ -1,6 +1,6 @@ --extra-index-url https://packages.dea.ga.gov.au/ -datacube[performance,s3]>=1.8.17 +datacube[performance,s3]<1.9 hdstats==0.1.8.post1 numexpr @ git+https://github.com/pydata/numexpr@a99412e odc-algo @ git+https://github.com/opendatacube/odc-algo@adb1856 diff --git a/odc/stats/plugins/lc_veg_class_a1.py b/odc/stats/plugins/lc_veg_class_a1.py index 91074166..a0928b43 100644 --- a/odc/stats/plugins/lc_veg_class_a1.py +++ b/odc/stats/plugins/lc_veg_class_a1.py @@ -212,9 +212,10 @@ def l3_class(self, xx: xr.Dataset): # Mask nans and pixels where non of classes applicable l3_mask = expr_eval( - "where((e<=0)|(e==254), nodata, e)", + "where((e<=0)|(e==254)|(g!=g), nodata, e)", { "e": l3_mask, + "g": si5.squeeze(0), }, name="mark_nodata", dtype="uint8", diff --git a/setup.cfg b/setup.cfg index ba01f18d..7f7cd778 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,7 +22,7 @@ install_requires = botocore click>=8.0.0 dask - datacube!=1.8.14 + datacube<1.9 distributed numpy odc-cloud[ASYNC]>=0.2.5 diff --git a/tests/requirements.txt b/tests/requirements.txt index 8c4faafb..cf18641b 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,5 +1,5 @@ --extra-index-url https://packages.dea.ga.gov.au/ -datacube>=1.8.17 +datacube<1.9 # for pytest-depends deepdiff future_fstrings diff --git a/tests/test_landcover_plugin_a1.py b/tests/test_landcover_plugin_a1.py index 5c49083a..09244fa4 100644 --- a/tests/test_landcover_plugin_a1.py +++ b/tests/test_landcover_plugin_a1.py @@ -242,7 +242,7 @@ def test_l3_classes(dataset): [223, 221, 210, 125], [223, 223, 223, 210], [223, 221, 223, 223], - [221, 223, 223, 223], + [221, 255, 223, 223], ] ], dtype="uint8",