Skip to content

Feature to retrieve the underlying store #5175

Closed
@stephenykp

Description

@stephenykp

Is your feature request related to a problem? Please describe.
It would be useful if I could retrieve the underlying store from an xarray Dataset object. There was previously a workaround that allowed this, but that was recently removed.

dataset._file_obj.ds  # Doesn't work anymore :(

Describe the solution you'd like
Ideally I'd like the API to be extended so the underlying store can be retrieved. Something like:

>>> dataset = xr.open_dataset('/path/to/file.nc')
>>> nc_dataset = dataset.store
>>> type(nc_dataset)
<class 'netCDF4._netCDF4.Dataset'>

Describe alternatives you've considered
I'd be fine using the old workaround if that was still an option. If anyone knows of a different workaround I would be fine with that, but a better long-term solution would be an actual user-facing function for accessing the store.

I might be using the 'store' terminology incorrectly, but hopefully my request is clear with the above example.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions