Skip to content

Commit

Permalink
Address some self-deprecations in dc.load
Browse files Browse the repository at this point in the history
- ds.uris -> ds.uri
- don't ask for grid_spec if load_hints are set
  • Loading branch information
Kirill888 committed Jun 20, 2024
1 parent 2313fd3 commit c46fa38
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions datacube/api/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,12 @@ def filter_jan(dataset): return dataset.time.begin.month == 1
"with odc.geo.resxy_ or odc.geo.resyx_")
resolution = resyx_(*resolution)

load_hints = datacube_product.load_hints()
grid_spec = None if load_hints is not None else datacube_product.grid_spec

geobox = output_geobox(like=like, output_crs=output_crs, resolution=resolution, align=align,
grid_spec=datacube_product.grid_spec,
load_hints=datacube_product.load_hints(),
grid_spec=grid_spec,
load_hints=load_hints,
datasets=datasets, geopolygon=None,
**query)
group_by = query_group_by(**query)
Expand Down Expand Up @@ -618,7 +621,7 @@ def find_datasets_lazy(self,
datasets = select_datasets_inside_polygon(datasets, query.geopolygon)

if ensure_location:
datasets = (dataset for dataset in datasets if dataset.uris)
datasets = (dataset for dataset in datasets if dataset.uri)

# If a predicate function is provided, use this to filter datasets before load
if dataset_predicate is not None:
Expand Down

0 comments on commit c46fa38

Please sign in to comment.