Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: indexing.rst finetuning #6685

Merged
merged 1 commit into from
Jun 10, 2022
Merged

Docs: indexing.rst finetuning #6685

merged 1 commit into from
Jun 10, 2022

Conversation

soxofaan
Copy link
Contributor

Just some minor documentation tweaks, feel free to cherry pick.

FYI: for https://docs.xarray.dev/en/stable/user-guide/indexing.html#indexing-with-dimension-names I swapped the two ways for dimension name based indexing, to be in line with order from the "quick overview"

Side question: is it intentional to use dict(space=0) in dimension name based indexing instead of {"space": 0} (which is shorter and probably more widely known) everywhere?

@max-sixty
Copy link
Collaborator

Great improvements @soxofaan !

Side question: is it intentional to use dict(space=0) in dimension name based indexing instead of {"space": 0} (which is shorter and probably more widely known) everywhere?

Personally I find it easier to read; partly because the kwargs are cleaner than the dict syntax. I think others have said that they are more ambivalent. I certainly don't have a strong view, and on the "intro" pages we should use whatever is most understandable to a new user, so happy to take a PR to change those.

@max-sixty max-sixty merged commit aa1d1d1 into pydata:main Jun 10, 2022
@soxofaan
Copy link
Contributor Author

Thanks!

In some situations I also find constructor style dict() better suited than literal {}, but my default/musclememory pick would be the latter still.
I'd just expect that new users are mainly exposed to the literal syntax and are not familiar with the constructor style.

dcherian added a commit to dcherian/xarray that referenced this pull request Jun 12, 2022
* main:
  pass kwargs through from save_mfdataset to to_netcdf (pydata#6686)
  Docs: indexing.rst finetuning (pydata#6685)
  use micromamba instead of mamba (pydata#6674)
  install the development version of `matplotlib` into the upstream-dev CI (pydata#6675)
  Add whatsnew section for v2022.06.0
  release notes for 2022.06.0rc0
  release notes for the pre-release (pydata#6676)
  more testpypi workflow fixes (pydata#6673)
  thin: add examples (pydata#6663)
  Update multidimensional-coords.ipynb (pydata#6672)
  try to finally fix the TestPyPI workflow (pydata#6671)
  pin setuptools in the modify script (pydata#6669)
  fix the python version for the TestPyPI workflow (pydata#6668)
  upload wheels from `main` to TestPyPI (pydata#6660)
  Set keep_attrs for flox (pydata#6667)
dcherian added a commit to bzah/xarray that referenced this pull request Jun 24, 2022
* main: (129 commits)
  docs on specifying chunks in to_zarr encoding arg (pydata#6542)
  [skip-ci] List count under Aggregation (pydata#6711)
  Add `Dataset.dtypes` property (pydata#6706)
  try to import `UndefinedVariableError` from the new location (pydata#6701)
  DOC: note of how `chunks` can be defined (pydata#6696)
  pdyap version dependent client.open_url call (pydata#6656)
  use `pytest-reportlog` to generate upstream-dev CI failure reports (pydata#6699)
  [pre-commit.ci] pre-commit autoupdate (pydata#6694)
  Bump actions/setup-python from 3 to 4 (pydata#6692)
  Fix Dataset.where with drop=True and mixed dims (pydata#6690)
  pass kwargs through from save_mfdataset to to_netcdf (pydata#6686)
  Docs: indexing.rst finetuning (pydata#6685)
  use micromamba instead of mamba (pydata#6674)
  install the development version of `matplotlib` into the upstream-dev CI (pydata#6675)
  Add whatsnew section for v2022.06.0
  release notes for 2022.06.0rc0
  release notes for the pre-release (pydata#6676)
  more testpypi workflow fixes (pydata#6673)
  thin: add examples (pydata#6663)
  Update multidimensional-coords.ipynb (pydata#6672)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants