Skip to content

Commit

Permalink
Mark geomad nodata in landcover level1 (#181)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
emmaai and Emma Ai authored Jan 16, 2025
1 parent 9415af7 commit 23e7313
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/statistician-dive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion docker/env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ dependencies:
- s3fs
- s3transfer
- scikit-image
- scipy
- scipy<1.15
- sentry-sdk
- setuptools-scm
- Shapely>=2.0
Expand Down
2 changes: 1 addition & 1 deletion docker/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion odc/stats/plugins/lc_veg_class_a1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_landcover_plugin_a1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 23e7313

Please sign in to comment.