home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

2 rows where user = 30196 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

type 2

  • issue 1
  • pull 1

state 1

  • open 2

repo 1

  • xarray 2
id node_id number title user state locked assignee milestone comments created_at updated_at ▲ closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
1352315409 PR_kwDOAMm_X8493rR7 6956 Expose `memory` argument for "netcdf4" engine ianliu 30196 open 0     12 2022-08-26T14:04:25Z 2023-03-23T15:51:27Z   FIRST_TIME_CONTRIBUTOR   0 pydata/xarray/pulls/6956

This commit exposes the memory argument for the "netcdf4" engine, allowing one to create a netcdf dataset from a memory buffer, like so:

python buffer: bytes = ... ds = xr.open_dataset("", engine="netcdf4", memory=buffer)

  • [x] Closes #6955
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6956/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1352314936 I_kwDOAMm_X85QmrA4 6955 Expose "memory" argument to the "netcdf4" engine ianliu 30196 open 0     0 2022-08-26T14:04:00Z 2022-08-26T14:04:00Z   NONE      

Is your feature request related to a problem?

As of today, xarray can't open a netcdf residing in a memory buffer, which is possible in netCDF4 library through the memory argument of the netCDF4.Dataset class constructor.

Describe the solution you'd like

It would be nice to create an xarray.Dataset from a netcdf file in memory like so:

python buf: bytes = ... ds = xr.open_dataset("dummy.nc", engine="netcdf4", memory=buf)

But this fails with

``` File ~/.asdf/installs/python/3.9.13/lib/python3.9/site-packages/xarray/backends/api.py:531, in open_dataset(filename_or_obj, engine, chunks, cache, decode_cf, mask_and_scale, decode_times, decode_timedelta, use_cftime, concat_characters, decode_coords, drop_variables, inline_array, backend_kwargs, kwargs) 519 decoders = _resolve_decoders_kwargs( 520 decode_cf, 521 open_backend_dataset_parameters=backend.open_dataset_parameters, (...) 527 decode_coords=decode_coords, 528 ) 530 overwrite_encoded_chunks = kwargs.pop("overwrite_encoded_chunks", None) --> 531 backend_ds = backend.open_dataset( 532 filename_or_obj, 533 drop_variables=drop_variables, 534 decoders, 535 kwargs, 536 ) 537 ds = _dataset_from_backend_dataset( 538 backend_ds, 539 filename_or_obj, (...) 547 kwargs, 548 ) 549 return ds

TypeError: open_dataset() got an unexpected keyword argument 'memory' ```

Describe alternatives you've considered

An alternative is to save the buffer into a temporary file and open it the usual way, but it feels cumbersome when there is already an argument to open directly from memory.

Additional context

No response

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6955/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [active_lock_reason] TEXT,
   [draft] INTEGER,
   [pull_request] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [state_reason] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
);
CREATE INDEX [idx_issues_repo]
    ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
    ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
    ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
    ON [issues] ([user]);
Powered by Datasette · Queries took 641.893ms · About: xarray-datasette