Skip to content

DOC: Update docstring for Index.from_variables()#11256

Merged
VeckoTheGecko merged 2 commits intopydata:mainfrom
VeckoTheGecko:options
Mar 23, 2026
Merged

DOC: Update docstring for Index.from_variables()#11256
VeckoTheGecko merged 2 commits intopydata:mainfrom
VeckoTheGecko:options

Conversation

@VeckoTheGecko
Copy link
Copy Markdown
Contributor

@VeckoTheGecko VeckoTheGecko commented Mar 23, 2026

There was no mention of the options keyword

  • Closes None

Docstring of Dataset.set_xindex for reference:

xarray/xarray/core/dataset.py

Lines 4983 to 5003 in bf8da57

def set_xindex(
self,
coord_names: str | Sequence[Hashable],
index_cls: type[Index] | None = None,
**options,
) -> Self:
"""Set a new, Xarray-compatible index from one or more existing
coordinate(s). Existing index(es) on the coord(s) will be replaced.
Parameters
----------
coord_names : str or list
Name(s) of the coordinate(s) used to build the index.
If several names are given, their order matters.
index_cls : subclass of :class:`~xarray.indexes.Index`, optional
The type of index to create. By default, try setting
a ``PandasIndex`` if ``len(coord_names) == 1``,
otherwise a ``PandasMultiIndex``.
**options
Options passed to the index constructor.

There was no mention of the `options` keyword
@VeckoTheGecko
Copy link
Copy Markdown
Contributor Author

image

@VeckoTheGecko VeckoTheGecko merged commit 3a1fb6a into pydata:main Mar 23, 2026
39 of 41 checks passed
@VeckoTheGecko VeckoTheGecko deleted the options branch March 23, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant