scipy: DOC: Interactive notebooks in stats tutorials are not working in version 1.15 docs.
Issue with current documentation:
It appears that the interactive notebooks in the stats tutorials are not working in the new version 1.15 docs. The kernel selection menu does not list any available kernels. This was first pointed out to me by @mdhaber. The devdocs are still working as expected. See https://docs.scipy.org/doc/scipy/tutorial/stats/hypothesis_chi2_contingency.html for an example of a notebook that isn’t working, and https://scipy.github.io/devdocs/tutorial/stats/hypothesis_chi2_contingency.html for the corresponding working notebook in the devdocs.
The notebooks work properly when I build them locally off the v1.15.0 branch. In the dev console on Firefox, I see an error for the stable docs which doesn’t appear for the dev docs, message pasted in the additional context section below.
Idea or request for content:
@agriyakhetarpal, do you know what might be going on? I remember that you’re working on documentation for how to change the pyodide kernel version for the built documentation, and I think that may be helpful here. As far as I know, I don’t think there is anything special @tylerjereddy needs to do during the release process to make these work.
Additional context (e.g. screenshots, GIFs)
No kernel found in the kernel selection menu:
The error I’m seeing in the dev console
Uncaught (in promise) TypeError: e is undefined
Ce toc.js:513
s toc.js:421
s toc.js:419
c toc.js:480
d index.es6.js:555
emit index.es6.js:513
emit index.es6.js:112
_onCellInViewportChanged widget.js:652
d index.es6.js:555
emit index.es6.js:513
emit index.es6.js:112
set inViewport widget.js:164
attachWidget windowing.js:198
insertWidget index.es6.js:2516
_updateForDeferMode widget.js:758
_runOnIdleTime widget.js:727
_runOnIdleTime widget.js:743
Here’s the relevant code from toc.js. Line 513 is the one with if (heading.type === Cell.HeadingType.Markdown) {
/**
* Get the element id for an heading
* @param heading Heading
* @param parser The markdownparser
* @returns The element id
*/
export async function getIdForHeading(heading, parser, sanitizer) {
let elementId = null;
if (heading.type === Cell.HeadingType.Markdown) {
elementId = await TableOfContentsUtils.Markdown.getHeadingId(parser,
// Type from TableOfContentsUtils.Markdown.IMarkdownHeading
heading.raw, heading.level, sanitizer);
}
else if (heading.type === Cell.HeadingType.HTML) {
// Type from TableOfContentsUtils.IHTMLHeading
elementId = heading.id;
}
return elementId;
}
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 22 (22 by maintainers)
I made a PR to
jupyterlite-sphinx, https://github.com/jupyterlite/jupyterlite-sphinx/pull/271, with a patch that makes themake distdoc build work locally for me.jupyterlite-sphinxcallsjupyterusingsubprocess.run, and the virtual environmentbuild/envisn’t active when this runs, so at least on my machine, a different jupyter was getting used. I changed it to make it sojupytergets called with the current Python executable.Thanks @agriyakhetarpal
~I’ve rebuilt the docs and cleared cache, and now see the same behavior locally as I do on the deployed docs. The devdocs work, but the kernel cannot be found for the version 1.15.0 docs.~ Trying again, I think I did something wrong.
make distlooks like this in the docs makefile,and when running
make dist, the logging showsjupyterlite-pyodide-kernelbeing installed. Perhaps rather than not being installed, the kernel is not being found. ~That the kernel is found for the devdocs makes it seem unlikely the kernel wasn’t installed.~Nevermind, the devdocs when building locally just link to the actual deployed devdocs, and then when I went back to version 1.15.0, it was the actually deployed stable docs. The only behavior I’m seeing locally is the file not found error for the stable docs, regardless of clearing cache and rebuilding.
Thanks @lesteve.
I thought it might be that too, but
jupyterlite-pyodide-kernelis in the doc requirements everywhere it should be.https://github.com/scipy/scipy/blob/6e246d0b54dd55dc69232a0caae6772228a7ac25/requirements/doc.txt#L13-L14
https://github.com/scipy/scipy/blob/6e246d0b54dd55dc69232a0caae6772228a7ac25/pyproject.toml#L114-L115
https://github.com/scipy/scipy/blob/6e246d0b54dd55dc69232a0caae6772228a7ac25/environment.yml#L50-L51
so should be getting installed.
You don’t misremember. There are instances of both. Examples sections are opened inline within the page (though not enabled now), and tutorials are opened in a separate tab.