Use Jupytext notebooks
The idea is to store notebooks as markdown files, so that under Git it's easier to understand the changes.
It's the very first time I'm using Jupytext, and I don't guarantee I did all correctly:
- I converted all notebooks with
jupytext --to md
, and then removed the original ipynb files. - I added Juytext in the conda environment.
- I added a
jupytext-config
file to ensure the new Markdown files are directly interpreted as notebooks (I don't use the "pairing" possibility that keeps a ipynb file along the Markdown file
Feel free to tell me if it can be done in a better way!
A known limitation in current configuration is that with Binder the Markdown files are not loaded by default as notebooks (but with 'open with' it works...)
Merge request reports
Activity
requested review from @vrouvrea
assigned to @sgilles
added 1 commit
- 9132efe2 - Fix the configuration file for Jupytext so that Markdown notebooks are...
It was indeed not running properly if I tried in a new environment.
I have therefore patched the Jupytext configuration file: both its name and the syntax used were incorrect.
Seems to work properly for me locally; can't manage to run Binder properly for some reason (404 error obtained??? I'll investigate this)
@vrouvrea Please nonetheless tell me if it's the same for you locally!
UPDATE On subsequent try I managed to create and run a Binder instance; the files were properly rendered as notebooks but it didn't manage to connect the kernel... Doesn't seem to be a good day for Binder?
Edited by GILLES SebastienOk that's weird as it works well on @poli 's former Linux laptop. But on the other hand I really don't manage to make it run properly on Binder (but Binder is capricious - @poli and I had to use an ugly workaround to keep finding properly the kernels as conda installation doesn't seem to work properly).
As you say the best is to take a bit of time to look it together next time we're both at Turing
added 1 commit
- 8099c841 - Try changing ordering in environment (in Binder JupyterLab doesn't seem to...
I have checked this morning:
-
Seems to work as expected on Linux as well
-
For Binder, changing the ordering of requirements in the yaml file seems to improve launch of notebook (for some reason if JupyterLab was before Jupytext the Lab version was not generated and the url with Lab gave a 404). However in the Binder instance the toml file doesn't seem to be considered, and the files are not loaded as notebooks.
-
Weirdly enough, shuffling the dependencies in the Yaml may induce lack of kernels found in Binder
@poli suggested a workaround for this:
- Create a
binder/postBuild
file in the repository - Inside explicitly call
conda
to install xeus-cling:
#!/bin/bash conda install -y xeus-cling -c conda-forge
- Create a
added 4 commits
Toggle commit listadded 7 commits
- 556f3ee1 - Try adding Binder requirement file.
- 3c8461fd - Add version for Jupytext in requirements.
- f3267b56 - Try renaming binder directory .binder.
- ad43c25d - Moving Xeus-cling in environment.yml.
- ba1d915a - #113 (closed) Rename .binder binder.
- 52f338b8 - #113 (closed) Remove activate command, and add -y to conda install.
- 9c809fda - #113 (closed) Try using pyproject.toml.
Toggle commit list