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

Virtual product warnings (select_unique may have failed) #1203

Open
benjimin opened this issue Oct 6, 2021 · 1 comment
Open

Virtual product warnings (select_unique may have failed) #1203

benjimin opened this issue Oct 6, 2021 · 1 comment

Comments

@benjimin
Copy link
Contributor

benjimin commented Oct 6, 2021

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 {}"
@benjimin
Copy link
Contributor Author

benjimin commented Oct 6, 2021

@uchchwhash any thoughts on either this issue or the linked wps issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants