Ouranosinc / xscen

A climate change scenario-building analysis framework.
https://xscen.readthedocs.io/
Apache License 2.0
15 stars 2 forks source link

Double preprocess in catalog.to_dataset() #245

Closed sarahclaude closed 1 year ago

sarahclaude commented 1 year ago

Setup Information

Description

When using preprocess with Datacatalog.to_dataset() I get the error: TypeError: intake_esm.core.esm_datastore.to_dask() got multiple values for keyword argument 'preprocess' linked to xscen/catalog.py", line 458, in to_dataset ds = cat.to_dask(preprocess=preprocess, **kwargs)

Steps To Reproduce

def preprocess(ds):
    return ds

dataset = catalog.to_dataset(preprocess=preprocess)

Additional context

Preprocess is sent two times to intake esmf

Contribution

aulemahal commented 1 year ago

Dang.

This line: https://github.com/Ouranosinc/xscen/blob/7fa182831f7eb38c4ac4c183613319d38a7cadae/xscen/catalog.py#L414 should be a .pop.