pull_requests: 1090975368
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1090975368 | PR_kwDOAMm_X85BBvaI | 7185 | closed | 0 | indexes section in the HTML repr | 14808389 | To see the effect, try this: <details> ```python import xarray as xr from xarray.core.indexes import Index class CustomIndex(Index): def __init__(self, names, options): self.names = names self.options = options @classmethod def from_variables(cls, variables, options): names = list(variables.keys()) return cls(names, options) def __repr__(self): options = ( {"names": repr(self.names)} | {str(k): str(v) for k, v in self.options.items()} ) return f"CustomIndex({', '.join(k + '=' + v for k, v in options.items())})" def _repr_html_(self): header_row = "<tr><td>KDTree params</td></tr>" option_rows = [ f"<tr><td>{option}</td><td>{value}</td></tr>" for option, value in self.options.items() ] return f"<left><table>{header_row}{''.join(option_rows)}</table></left>" ds = xr.tutorial.open_dataset("rasm") ds1 = ds.set_xindex(["xc", "yc"], CustomIndex, param1="a", param2="b") with xr.set_options(display_style="text"): display(ds1) with xr.set_options(display_style="html"): display(ds1) ``` </details> ~The repr looks a bit strange because I've been borrowing the variable CSS classes.~ Edit: @benbovy fixed that for me Also, the discussion about what `_repr_inline_` should include from #7183 is relevant here as well. - [x] Follow-up to #6795, depends on #7183 - [x] Tests added - [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst` | 2022-10-18T15:25:34Z | 2022-10-20T06:59:05Z | 2022-10-19T21:12:46Z | 2022-10-19T21:12:46Z | 8f34b32cd77c7e7e2e559c1ced9adf3100ecf40d | 0 | 317a6e06514bf98fcb28d5e17d6c92a0a0e8f694 | 7379923de756a2bcc59044d548f8ab7a68b91d4e | MEMBER | 13221727 | https://github.com/pydata/xarray/pull/7185 |
Links from other tables
- 2 rows from pull_requests_id in labels_pull_requests