pull_requests: 677702179
This data as json
id | node_id | number | state | locked | title | user | body | created_at | updated_at | closed_at | merged_at | merge_commit_sha | assignee | milestone | draft | head | base | author_association | auto_merge | repo | url | merged_by |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
677702179 | MDExOlB1bGxSZXF1ZXN0Njc3NzAyMTc5 | 5532 | closed | 0 | Remove self from classes in How to add new backends docs | 14371165 | 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* ``` <!-- Feel free to remove check-list items aren't relevant to your change --> - [x] Passes `pre-commit run --all-files` | 2021-06-25T07:48:32Z | 2021-07-02T16:07:16Z | 2021-06-25T08:12:59Z | 2021-06-25T08:12:59Z | 697e9a9cdc2678cd867f774cb81a2032211ba942 | 0 | f39e73c1751fc88154db44af83cc8dadbe91456d | 0ba275bad0bb1d80d7b766f049860a78e45858eb | MEMBER | 13221727 | https://github.com/pydata/xarray/pull/5532 |
Links from other tables
- 0 rows from pull_requests_id in labels_pull_requests