Skip to content

NetCDFSource does not use input parameters #150

@fralc

Description

@fralc

I have prepared a catalog.yml with this content:

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions