Skip to content

Commit

Permalink
Merge pull request #54 from Jena-Earth-Observation-School/fix_override
Browse files Browse the repository at this point in the history
Fix: Override common load parameters
  • Loading branch information
maawoo authored May 2, 2024
2 parents f513174 + 381db98 commit fe80ad4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sdc/products/_ancillary.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ def override_common_params(params: dict[str, Any],
from odc.stac import load as odc_stac_load
allowed = inspect.getfullargspec(odc_stac_load).kwonlyargs

for key in kwargs:
for key, val in kwargs.items():
if key not in allowed:
raise ValueError(f"Parameter '{key}' is not allowed.")
params.update(kwargs)
if val is not None:
params[key] = val

if verbose:
print(f"[INFO] odc.stac.load parameters: {params}")
return params
Expand Down

0 comments on commit fe80ad4

Please sign in to comment.