html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/7099#issuecomment-1261015002,https://api.github.com/repos/pydata/xarray/issues/7099,1261015002,IC_kwDOAMm_X85LKY_a,4160723,2022-09-28T14:39:10Z,2022-09-28T14:39:10Z,MEMBER,"Or use `Indexer` objects to group labels + options? This is slightly different than what you suggest:
```python
class Dataset:
def sel(
self,
indexers: Mapping[Any, Any] | Indexer | Iterable[Indexer],
**indexers_kwargs: Any,
):
...
class Indexer:
def __init__(self, labels=None, options=None, **label_kwargs):
...
```
Let's assume a Dataset with `lat` / `lon` coordinates both sharing the same geographic index + another `time` dimension coordinate, then we could write:
```python
indexers = [
Indexer(lon=[2, 15], lat=[45, 48], options={""foo"": ""bar""}),
Indexer(time=""2022-01-01""),
]
ds.sel(indexers)
```
This could also be used to avoid code duplication when using common selection options for different indexes.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1389295853
https://github.com/pydata/xarray/issues/7099#issuecomment-1260905662,https://api.github.com/repos/pydata/xarray/issues/7099,1260905662,IC_kwDOAMm_X85LJ-S-,14808389,2022-09-28T13:20:38Z,2022-09-28T13:20:38Z,MEMBER,"another option would be to allow passing a custom object, like
```python
class Indexer:
def __init__(self, indexer, **options):
...
ds.sel(x=Indexer([0, 2], method=""nearest""))
```
I think we wanted to have something like that, anyways, to be able to specify other behaviors of a slice, like right-exclusive?","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1389295853
https://github.com/pydata/xarray/issues/7099#issuecomment-1260892017,https://api.github.com/repos/pydata/xarray/issues/7099,1260892017,IC_kwDOAMm_X85LJ69x,4160723,2022-09-28T13:11:01Z,2022-09-28T13:11:01Z,MEMBER,"Or we could simply decide that `.sel()` should not accept arbitrary options and handle special cases, e.g., via accessors.
It would actually make sense to have something like `.my_accessor.sel_k_neighbors()`. Not so great to have a separate method just for an optimization option, though.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1389295853
https://github.com/pydata/xarray/issues/7099#issuecomment-1260859023,https://api.github.com/repos/pydata/xarray/issues/7099,1260859023,IC_kwDOAMm_X85LJy6P,4160723,2022-09-28T12:50:25Z,2022-09-28T12:50:25Z,MEMBER,"Another difficulty regarding multi-coordinate indexes: ideally options should be set per index, not per coordinate.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1389295853