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

Handling unwanted execution artefacts + folders #122

Open
najuzilu opened this issue Apr 3, 2020 · 7 comments
Open

Handling unwanted execution artefacts + folders #122

najuzilu opened this issue Apr 3, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@najuzilu
Copy link
Member

najuzilu commented Apr 3, 2020

I keep getting this error. Any suggestions as to what I might be doing wrong?
Screen Shot 2020-04-03 at 10 47 28 AM

@choldgraf
Copy link
Member

I'm guessing this is a jupyter-cache and/or myst-nb problem. I'll move it over to myst-nb as a starter. pinging @chrisjsewell in case he can spot-check this

@choldgraf choldgraf transferred this issue from executablebooks/cli Apr 3, 2020
@najuzilu
Copy link
Member Author

najuzilu commented Apr 3, 2020

I've narrowed down the issue to these two code-blocks:

```{code-cell} ipython3
%%file math2.py
pi = 'foobar'
```

```{code-cell} ipython3
import math2
```

I can't find the location of math2.py.

@mmcky
Copy link
Member

mmcky commented Apr 3, 2020

hey @najuzilu is this an issue with ipython magics? For these sorts of issues I typically write a very small temporary notebook in another (small testing project) with what you think is causing the issue -- it helps on two fronts:

  1. takes less time over building the project multiple times as you try and narrow the bug down
  2. helps identify the key issue and provides a minimal example.

If you're using jupyter-cache the issue might be the split in assets and artefacts @AakashGfude do notebooks execute in the same workspace as the artefacts that are generated by the notebook.

@najuzilu
Copy link
Member Author

najuzilu commented Apr 3, 2020

Ah you're right, I found the file in artefacts under the appropriate hashed folder.

@AakashGfude
Copy link
Member

AakashGfude commented Apr 4, 2020

@mmcky @najuzilu @choldgraf notebooks execute in the same workspace as the artefacts .
Regarding this issue, the artefacts are not the problem, they are properly created with ipython magics and accessed. The problem is the __pycache__ folder which usually gets created with every import statement. In this case, because of the artefacts import statements, I presume..

Now, jupyter-cache specifically checks for artefacts to be a file:-
image

And in this case, __pycache__ is also passed as an artefact, which breaks the system because it is a folder.

We will need to have some checks on what gets added to the array of paths passed as artefacts to jupyter-cache

@mmcky
Copy link
Member

mmcky commented Apr 4, 2020

nice diagnosis @AakashGfude

@chrisjsewell chrisjsewell changed the title Couldn't find cache key for notebook file Handling unwanted execution artefacts + folders Apr 5, 2020
@chrisjsewell chrisjsewell added the bug Something isn't working label Apr 5, 2020
@choldgraf
Copy link
Member

Hey all - does anybody have bandwidth to tackle this one soonishfully? I think that it is reasonable to be a blocker on a "release" of Jupyter Book since many folks may have this issue, and the fix seems relatively straightforward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants