home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 929923036

This data as json

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
929923036 MDExOlB1bGxSZXF1ZXN0Njc3NzAyMTc5 5532 Remove self from classes in How to add new backends docs 14371165 closed 0     2 2021-06-25T07:48:32Z 2021-07-02T16:07:16Z 2021-06-25T08:12:59Z MEMBER   0 pydata/xarray/pulls/5532

Copy pasting the examples in http://xarray.pydata.org/en/stable/internals/how-to-add-new-backend.html resulted in crashes. Make the docs copy/paste friendly by removing the self arguments.

Example: ```python expected = xr.Dataset( dict(a=2 * np.arange(5)), coords=dict(x=("x", np.arange(5), dict(units="s"))) )

class CustomBackend(xr.backends.BackendEntrypoint): def open_dataset( self, filename_or_obj, drop_variables=None, **kwargs, ): return expected.copy(deep=True)

xr.open_dataset("fake_filename", engine=CustomBackend) TypeError: open_dataset() missing 1 required positional argument: 'filename_or_obj' This works if self is removed:python expected = xr.Dataset( dict(a=2 * np.arange(5)), coords=dict(x=("x", np.arange(5), dict(units="s"))) )

class CustomBackend(xr.backends.BackendEntrypoint): def open_dataset( filename_or_obj, drop_variables=None, **kwargs, ): return expected.copy(deep=True)

xr.open_dataset("fake_filename", engine=CustomBackend) <xarray.Dataset> Dimensions: (a: 5, x: 5) Coordinates: * a (a) int32 0 2 4 6 8 * x (x) int32 0 1 2 3 4 Data variables: empty ```

  • [x] Passes pre-commit run --all-files
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5532/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 pull

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 2 rows from issue in issue_comments
Powered by Datasette · Queries took 1.284ms · About: xarray-datasette