MyST-NB icon indicating copy to clipboard operation
MyST-NB copied to clipboard

Code-cell reading from files using :load: should not use cache if the file has changed

Open gibberblot opened this issue 1 year ago • 0 comments

Describe the bug

I use the :load: tags for code-cells so much in my book; e.g.:

:load: <path>

This is documented as an experimental feature.

When I change the file as , I expect that this cell should be executed instead of reading from the cache.

But instead, it reads from the cache.

This means I have to force execution, or change the cell just to get it to re-execute.

Thanks! Tim

p.s. I love this functionality!

Reproduce the bug

In any jupyterbook, create the file test.py with the following:

print("1")

Load it in a code cell:

:load: test.py

and build the book.

Now change test.py to:

print("2")

and re-build. You will still get the output ("1"), and it is clear from the execution log that this was cached.

List your environment

Jupyter Book : 1.0.0 External ToC : 1.0.1 MyST-Parser : 2.0.0 MyST-NB : 1.0.0 Sphinx Book Theme : 1.1.2 Jupyter-Cache : 0.6.1 NbClient : 0.7.4

Python 3.10.12

WSL on Windows 11

gibberblot avatar Sep 07 '24 05:09 gibberblot