Proposal: separate template and config#17
Conversation
The existence of a notebook template is a very nice thing, since we can define common blocks of code that we always rely on... However the current implementation have a huge chunk right in the beginning of the file with all the boilerplate code (e.g. configuring jupyter extensions and the way things are displayed in the notebook). I wonder if using a single file to centralise all this "boilerplate jupyter configuration" makes sense... The idea is not to replace the template, but rather get unimportant things (like configuring how many columns pandas will display), out of the way. This way a person can have a single line on top of the file: ```ipynb %run ./config.ipynb ``` and start writing some text for good'old literal programming, and the readers will not be distracted by the usual chores... This approach also allow users to change things in one place (e.g. font size for the graphs) and have it automatically changing in all the notebooks, which can be quite neat.
|
Thanks for this PR @abravalheri. I am a bit hesitant since I often change the defaults on a per notebook basis. For instance, I decrease the default plot size if I have many plots in a notebook. The same goes for the default settings of Pandas regarding the display options, seaborn and other things. Having a global config for all my notebooks might have unintended effects, i.e. I might be happy with one notebook by tweaking the settings in the global config while an older notebook suddenly starts looking strange when I rerun it later. So from my point of view and workstyle, I would rather not use a global config notebook. How about we open up a discussion about it, maybe we get some feedback from the users of this extension? This might be also related to the usage of JupyText which splits notebooks up a content and visualization part where only the content part goes into Git. I am not experienced enough with it and just wanted to point it out. |
|
No problems @FlorianWilhelm, I am just brainstorming here :) -- in the end of the day, it is very easy for the users to adapt the default template with their own conventions, being them configuration per notebook or a global config file. I stumbled upon jupytext when I was writing this PR, because editing the Looking on the internet, I found: https://dev.to/canas/get-jupyter-notebook-diff-with-github-actions-4b90, which does not seem that bad, but I supposing diffing markdown is much easier. I am completely in favour of a community discussion... what would be the best way of doing that? Github discussions? Twitter? |
The existence of a notebook template is a very nice thing, since we can define common blocks of code that we always rely on...
However the current implementation have a huge chunk right in the beginning of the file with all the boilerplate code (e.g. configuring jupyter extensions and the way things are displayed in the notebook).
I wonder if using a single file to centralise all this "boilerplate jupyter configuration" makes sense... The idea is not to replace the template, but rather get unimportant things (like configuring how many columns pandas will display), out of the way.
This way a person can have a single line on top of the file:
%run ./config.ipynband start writing some text for good'old literal programming, and the readers will not be distracted by the usual chores... (that is what I find myself doing these days: my template is just
%run ./config.ipynb...)This approach also allow users to change things in one place (e.g. font size for the graphs) and have it automatically changing in all the notebooks, which can be quite neat.