-
Notifications
You must be signed in to change notification settings - Fork 110
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
Add sphinx-autocodelink & intersphinx_mapping #85
Conversation
Just curious about this. Like Update: I tried it out and both of those syntaxes work for me so I assume it is the codeautolink that you were referring to |
After a bit of investigation, seems like xarray isn't working because it doesn't have an xarray module doc reference? e.g. for NumPy Consistent with this, So, perhaps adding Sphinx module directive for the xarray module in the xarray docs would fix it. |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
this is awesome. @dcherian you'll have to re-render the lockfile with the new pip package b/c that is what gets used in CI https://github.com/xarray-contrib/xarray-tutorial/tree/main/conda#createupdate-multiplatform-lockfile |
Thanks for the conda lock tip. I'm 50/50 on this PR. When it works, it's great. But I find myself hovering over things that just don't work. Like
will not link Dataset!
^ This supposedly will link though |
gotcha. I'm fine leaving this in draft form and revisiting at some later date, or separate out just the intersphinx piece (maybe just for xarray?) and revisit the code block autolinking later? |
When I was trying it I found that it only seemed to work for full build from clean, not partial builds, which is kind of annoying. |
Yooo thanks for trying autolink out, author here 👋 Did you encounter other bugs besides the one mentioned? ds = xr.DataSet(...) should be linked in terms of the |
8cbf922
to
ebbb121
Compare
a1aec54
to
5a443c6
Compare
5a443c6
to
854eb2c
Compare
The following seems like it should be supported or is it felix-hilden/sphinx-codeautolink#65? Here So i'd expect
https://sphinx-codeautolink.readthedocs.io/en/latest/examples.html#concatenating-examples and https://sphinx-codeautolink.readthedocs.io/en/latest/examples.html#concatenating-examples shows the behaviour I want. |
Yep, it should work as long as the type hints are available 👌 Getting |
Right, but the reference documentation or type hinted importable location of "air" I meant! |
Oh I see the problem now. It comes from this mixin class but the return value is I can change the code to use |
Yep most likely. Fair warning though, I don't think we provide any special support for |
Oh, that's unfortunate indeed. |
I found the culprit! The inventory and documentation entry for So linking |
Oh interesting. Thanks for tracking that down. Would it be feasible to do this as a variable in codeautolink_module_overrides = {
"DataArray": "xarray",
"Dataset": "xarray",
} |
I like the idea! Let's continue the discussion on the linked issue. |
♻️ PR Preview 8df1193 has been successfully destroyed since this PR has been closed. 🤖 By surge-preview |
@dcherian I wanted to revive this one now that I have a previews working again and bumped all the package versions. To get methods like da.resample() and others to link correctly (e.g. https://xarray-contrib-xarray-tutorial-preview-pr-85.surge.sh/intermediate/01-high-level-computation-patterns.html). It sounds like we'd need to add a custom map file to this repository based on felix-hilden/sphinx-codeautolink#131 (comment) So,,, options are 1: merge as-is with limited functionality (I'm happy with this), 2: add a custom map file, or 3: abandon adding this feature |
Merge away! |
xref #82
This somewhat works.