opendatacube / datacube-wps

Web Processing Service running on opendatacube
Other
7 stars 3 forks source link

Latest datacube version breaks a test #111

Open benjimin opened 3 years ago

benjimin commented 3 years ago

Bumping the datacube version (from 1.8.3 to 1.8.4dev) causes an error in the Fractional Cover Drill test.

Test report for version-bump commit: https://github.com/opendatacube/datacube-wps/runs/3030084203

Roughly what the code is doing:

# thing = datacube.virtual.construct(…) # probably..
bag = thing.query(dc, time, geopolygon)
box = thing.group(bag)
# guard rail function
… list(box.shape) # seems to complain about box.load_natively
VirtualProductException: shape requires known geobox
whatnick commented 3 years ago

We can mark this as Pytest XFail and move on. https://docs.pytest.org/en/latest/how-to/skipping.html

benjimin commented 2 years ago

Datacube is now up to 1.8.6, time to re-check...

benjimin commented 2 years ago

This error can be replicated by running the example in https://github.com/opendatacube/datacube-core/issues/1203 except using datacube_wps.processes.wofls_fuser instead of digitalearthau.utils.wofs_fuser.

This produces a <natively loaded VirtualDatasetBox> rather than one with a defined shape, hence the error. Tested in the wps image using datacube 1.8.6.

The fusers are slightly different:

def wofs_fuser(dest, src):
    empty = (dest & 1).astype(numpy.bool)
    both = ~empty & ~((src & 1).astype(numpy.bool))
    dest[empty] = src[empty]
    dest[both] |= src[both]
def wofls_fuser(dest, src):
    where_nodata = (src & 1) == 0
    np.copyto(dest, src, where=where_nodata)
    return dest
benjimin commented 2 years ago

Retried this linked example in a modified wps image with datacube 1.8.5 (the version where .shape succeeds in dev sandbox) and using digitalearthau for the fuser; still reproduced "natively loaded" failure.

Suggests the fault is some other difference between the environments? (Both are using python 3.8.10. Could the difference be in the database index? e.g. here the VirtualDatasetBag was returned with 46 not 68 datasets..)