Uh oh!
There was an error while loading. Please reload this page.
Add cross-links to API docstring from tutorial and user-guide - #8311
Conversation
Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
dcherian
commented
Oct 19, 2023
Thanks @amanbagrecha . I changed the links to more general pages. |
amanbagrecha
commented
Oct 22, 2023
Thanks @dcherian for the edits. I reverted the docs you made for
|
keewis
left a comment
There was a problem hiding this comment.
I wonder if we should be using the intersphinx entries in https://tutorial.xarray.dev/objects.inv?
If so, you'd need to add
"xarray-tutorial": ("https://tutorial.xarray.dev/", None),to intersphinx_mapping
Uh oh!
There was an error while loading. Please reload this page.
| -------- | ||
| Dataset.weighted | ||
| `Weighted array reductions <https://docs.xarray.dev/en/stable/user-guide/computation.html#weighted-array-reductions>`_ |
There was a problem hiding this comment.
you can use sphobjinv su -u https://docs.xarray.dev/en/latest computation to find the appropriate link, in this case
:std:label:`/user-guide/computation.rst#weighted-array-reductions`(though maybe we need to add label directives to user-guide/computation to make this easier? E.g. add
.. _weighted-array-reductions:just before that section... not sure if - is a allowed character in labels, though)
There was a problem hiding this comment.
many thanks! I made the necessary changes.
amanbagrecha
commented
Oct 22, 2023
I added xarray-tutorial to intersphinx_mapping. Though I am confused how to use it. I tried |
keewis
commented
Oct 22, 2023
not sure, you might have to use a prefix: :doc:`xarray-tutorial:fundamentals/03.4_weighted`where the prefix is the value you put as the |
amanbagrecha
commented
Oct 22, 2023
Thanks this worked. Now I'm struggling to find a way to link just the section as in https://tutorial.xarray.dev/intermediate/01-high-level-computation-patterns.html#label-space-windows-or-bins-groupby. Since tutorials are in markdown, I cannot add a directive I think. |
keewis
commented
Oct 22, 2023
I think this should be possible (not sure though, especially given jupyter-book/jupyter-book#1767), but might need changes to the tutorial. @dcherian, any ideas? |
dcherian
commented
Oct 23, 2023
No ideas but this is a major improvement. So let's just go ahead with a link to the whole page. |
keewis
commented
Nov 2, 2023
was there anything else you'd like to change, @amanbagrecha? Otherwise I think we can undo the |
keewis
left a comment
There was a problem hiding this comment.
we might have to revisit the links once xarray-tutorial has section targets, but for now this looks good to me. Thanks a lot, @amanbagrecha
| Dataset.isel | ||
| DataArray.sel | ||
| :doc:`xarray-tutorial:intermediate/indexing/indexing` |
There was a problem hiding this comment.
this should be valid, though. So we might need to fix napoleon to allow this.
There was a problem hiding this comment.
it appears we had a similar issue more than two years ago when we first introduced :doc: links to See Also (see #5176), where we concluded that this is a bug in napoleon (nobody got around to reporting / fixing that since then, though).
There was a problem hiding this comment.
OK well this is an improvement in any case. Merging.
dcherian
commented
Nov 5, 2023
Thanks @amanbagrecha this is a great contribution. Welcome to Xarray! |



Tests addedUser visible changes (including notable bug fixes) are documented inwhats-new.rstNew functions/methods are listed inapi.rstCross links for