intake / intake/intake-xarray

NetCDFSource does not use input parameters

Open
#150 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
76
Forks
36
PR merge metrics
No merged PRs in 30d

Description

I have prepared a `catalog.yml` with this content:

```yaml
metadata:
description: Sample catalog
information.
version: 1
plugins:
source:
- module: intake_xarray
sources:
this_source:
args:
storage_options:
client_kwargs:
endpoint_url: https://mys3
verify: false
key: mykey
secret: mysecret
urlpath: s3://thispath/{{ date.strftime('%Y/%m/%Y%m%d') }}.nc
chunks: {}
xarray_kwargs:
engine: h5netcdf
description: CREATE sample
driver: netcdf
metadata: {}
parameters:
date:
default: '2025-01-01T00:00:00'
description: Date and hour of data.
min: '2020-01-01T00:00:00'
type: datetime
```

then I tried to open the dataset in this way:

```python
from datetime import datetime
import intake

cat = intake.open_catalog('catalog.yml')
ds = cat.this_source(date=datetime(2024, 1, 1)).read()
```

It turns out that the output data is always related to the default `date` value (2025-01-01) whatever value I pass to the reader.

Indeed, it seems that the input parameter value is not used by the reader. I verified the same approach/syntax with an Intake csv source and it works perfectly.

This problem was alread reported here: https://stackoverflow.com/questions/79690222/why-intake-xarray-netcdfsource-seems-to-not-use-user-input-parameters

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.