issues: 1812008663
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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1812008663 | I_kwDOAMm_X85sAQ7X | 8002 | Improve discoverability of index build options | 4160723 | open | 0 | 2 | 2023-07-19T13:54:09Z | 2023-07-19T17:48:51Z | MEMBER | Is your feature request related to a problem?Currently Describe the solution you'd likeWhat about something like this? ```python ds.set_xindex("x", MyCustomIndex.with_options(foo=1, bar=True)) ords.set_xindex("x", *MyCustomIndex.with_options(foo=1, bar=True)) ``` This would require adding a ```python xarray.core.indexesclass Index: @classmethod def with_options(cls) -> tuple[type[Self], dict[str, Any]]: return cls, {} ``` ```python third-party codefrom xarray.indexes import Index class MyCustomIndex(Index):
``` Thoughts? Describe alternatives you've consideredBuild options are also likely defined in the Index constructor, e.g., ```python third-party codefrom xarray.indexes import Index class MyCustomIndex(Index):
``` However, the Index constructor is not public API (only used internally and indirectly in Xarray when setting a new index from existing coordinates). Any other idea? Additional contextNo response |
{
"url": "https://api.github.com/repos/pydata/xarray/issues/8002/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
13221727 | issue |