datacube-core
datacube-core copied to clipboard
Virtual product warnings (select_unique may have failed)
VirtualDatasetBag.group verbosely issues "UserWarning: select_unique may have failed" three times, saying that False is not True, a GeoBox is not None, and None is not a Geometry.
To replicate:
import yaml, datacube.virtual
from datacube.utils.geometry import Geometry, CRS
feat = Geometry({'type': 'Polygon', 'coordinates': (((147.28271484375003, -35.89238773935897), (147.03277587890628, -35.663990911348115), (146.65237426757815, -35.90684930677119), (147.09182739257815, -36.15894422111004), (147.28271484375003, -35.89238773935897)),)}, CRS('EPSG:4326'))
spec = yaml.safe_load("""
juxtapose:
- collate:
- product: ls5_fc_albers
group_by: solar_day
measurements: [BS, PV, NPV]
- product: ls7_fc_albers
group_by: solar_day
measurements: [BS, PV, NPV]
- product: ls8_fc_albers
group_by: solar_day
measurements: [BS, PV, NPV]
- product: wofs_albers
measurements: [water]
group_by: solar_day
fuse_func: digitalearthau.utils.wofs_fuser""") #datacube_wps.processes.wofls_fuser
product = datacube.virtual.construct(**spec)
dc = datacube.Datacube()
bag = product.query(dc, geopolygon=feat, time=("2019-03-05", "2019-07-10"))
print(bag)
box = product.group(bag)
print(box)
Output on dev sandbox (datacube 1.8.5):
<VirtualDatasetBag of 68 datacube datasets>
<VirtualDatasetBox of shape {'time': 17, 'y': 2208, 'x': 2268}>
/env/lib/python3.8/site-packages/datacube/virtual/utils.py:16: UserWarning: select_unique may have failed: GeoBox(Geometry({'type': 'Polygon', 'coordinates': (((146.62349744588062, -35.70273335048077), (146.69355477162244, -36.19687547403131), (147.31908398863132, -36.13696212625085), (147.2461000005716, -35.643186470762565), (146.62349744588062, -35.70273335048077)),)}, CRS('EPSG:4326'))) is not the same as None
warnings.warn("select_unique may have failed: {} is not the same as {}"
/env/lib/python3.8/site-packages/datacube/virtual/utils.py:16: UserWarning: select_unique may have failed: False is not the same as True
warnings.warn("select_unique may have failed: {} is not the same as {}"
/env/lib/python3.8/site-packages/datacube/virtual/utils.py:16: UserWarning: select_unique may have failed: None is not the same as Geometry({'type': 'Polygon', 'coordinates': (((147.28271484375003, -35.89238773935897), (147.03277587890628, -35.663990911348115), (146.65237426757815, -35.90684930677119), (147.09182739257815, -36.15894422111004), (147.28271484375003, -35.89238773935897)),)}, CRS('EPSG:4326'))
warnings.warn("select_unique may have failed: {} is not the same as {}"
@uchchwhash any thoughts on either this issue or the linked wps issue?