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

check notebooks #17

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

zacharyburnett
Copy link
Member

@zacharyburnett zacharyburnett commented Jul 21, 2022

workflows are currently run here: https://github.com/zacharyburnett/tutorials/actions/workflows/test.yml

I disabled the Python 3.10 workflow for MacOS because it had errors with installation

@zacharyburnett zacharyburnett force-pushed the workflow_checks branch 2 times, most recently from 16ee497 to e8ee6c0 Compare July 21, 2022 18:56
@zacharyburnett
Copy link
Member Author

zacharyburnett commented Jul 22, 2022

python -m nbcollection execute .
[nbcollection (INFO)]: Collected 7 notebook files
[nbcollection (INFO)]: Finished running notebook 'Anatomy_of_an_ASDF_file.ipynb' (8.13 seconds) ✅
[nbcollection (INFO)]: Finished running notebook 'Validation_and_Dealing_with_Errors.ipynb' (1.10 seconds) ✅
[nbcollection (ERROR)]: Notebook 'Your_second_ASDF_converter.ipynb' errored ❌
[nbcollection (ERROR)]: Notebook 'Your_first_ASDF_converter.ipynb' errored ❌
[nbcollection (INFO)]: Finished running notebook 'Reading_a_JWST_ASDF_file.ipynb' (119.88 seconds) ✅
[nbcollection (INFO)]: Finished running notebook 'High_Level_Introduction_to_ASDF.ipynb' (1.17 seconds) ✅
[nbcollection (INFO)]: Finished running notebook 'ASDF_and_World_Coordinate_Systems.ipynb' (5.97 seconds) ✅
[nbcollection (ERROR)]: Notebook 'Your_second_ASDF_converter.ipynb' errored: An error occurred while executing the following cell:
------------------
import numpy as np
import asdf
from myconverters.photo_id import PhotoID
from myconverters.traffic_citation import TrafficCitation
------------------
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Input In [38], in <cell line: 3>()
      1importnumpyasnp
      2importasdf
----> 3frommyconverters.photo_idimport PhotoID
      4frommyconverters.traffic_citationimport TrafficCitation
ModuleNotFoundError: No module named 'myconverters'
ModuleNotFoundError: No module named 'myconverters'
[nbcollection (ERROR)]: Notebook 'Your_first_ASDF_converter.ipynb' errored: An error occurred while executing the following cell:
------------------
import asdf
import numpy as np
import mfconverter.photo_id as pid
image = np.zeros((10,10), dtype=np.byte)
p = pid.PhotoID('man', 'invisible', image)
af = asdf.AsdfFile()
af.tree = {'id': p}
af.write_to('test1.asdf', auto_inline=200)
------------------
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Input In [18], in <cell line: 3>()
      1importasdf
      2importnumpyasnp
----> 3importmfconverter.photo_idaspid
      4 image = np.zeros((10,10), dtype=np.byte)
      5 p = pid.PhotoID('man', 'invisible', image)
ModuleNotFoundError: No module named 'mfconverter'
ModuleNotFoundError: No module named 'mfconverter'
Traceback (most recent call last):
  File "/usr/share/miniconda/envs/asdf-tutorial-Linux-py3.10-latest/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/share/miniconda/envs/asdf-tutorial-Linux-py3.10-latest/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/share/miniconda/envs/asdf-tutorial-Linux-py3.10-latest/lib/python3.10/site-packages/nbcollection/__main__.py", line 37, in <module>
    main()
  File "/usr/share/miniconda/envs/asdf-tutorial-Linux-py3.10-latest/lib/python3.10/site-packages/nbcollection/__main__.py", line 33, in main
    commands[parsed.command](args)
  File "/usr/share/miniconda/envs/asdf-tutorial-Linux-py3.10-latest/lib/python3.10/site-packages/nbcollection/commands/execute.py", line 24, in execute
    nbcollection.execute()
  File "/usr/share/miniconda/envs/asdf-tutorial-Linux-py3.10-latest/lib/python3.10/site-packages/nbcollection/converter.py", line 144, in execute
    raise RuntimeError(f"{len(exceptions)} notebooks raised unexpected "
RuntimeError: 2 notebooks raised unexpected errors while executing cells: ['Your_second_ASDF_converter.ipynb', 'Your_first_ASDF_converter.ipynb'] — see above for more details about the failing cells. If any of these are expected errors, add a Jupyter cell tag 'raises-exception' to the failing cells.
Error: Process completed with exit code 1.

@WilliamJamieson
Copy link

The CI doesn't appear to be running on github.

@zacharyburnett
Copy link
Member Author

The CI doesn't appear to be running on github.

yes, it's running in the fork but it seems not be running in this repository (perhaps because it's not in the main branch). I'm not sure why that is, but for this PR at least we can see the runs in the fork

@WilliamJamieson
Copy link

Trying close/reopen

@WilliamJamieson
Copy link

Could you add a simple .pre-commit-config.yaml file to this? We can try merging and seeing if we can run the CI then.

@WilliamJamieson WilliamJamieson marked this pull request as ready for review October 5, 2022 14:04
@braingram
Copy link

Am I reading this right that the CI job to check notebooks is not yet running in the main branch?

Also, there are errors in the 2 notebooks: Your_first_ASDF_converter.ipynb and Your_second_ASDF_converter.ipynb

Both of these notebooks have cells that write files to disk (in a folder created in the home directory). Is this sort of pattern supported by nbcollection?

So far I've been unable to replicate those errors locally and am instead running into other errors.

@perrygreenfield
Copy link
Contributor

The problem with these tutorials is when relevant schemas are updated, so do the example files need to be. It's almost like there needs to be a script to reconstruct the example files without manual intervention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants