Best practices for documentation of projects #179
Replies: 2 comments 4 replies
-
You can try VSCode : there is many extensions allowing to render both Jupyter Notebook and Markdown file on the side (I'm sure they have something for rst files). Only drawback, you may need one or two days to get use to it (but it's worth it 😉) About project documentation I believe there is three approaches here :
Not so found of 1 and 3 : python scripts, even well documented, are not very nice to describe theoretical concepts and add equations, which we have plenty of. Markdown or rst is nice for that, but you need to update it by hand each time you change the code (and re-execute on you side the parts of code, copy-paste their output, generate and store the figures somewhere, ...). So not that easy to automatize either. I do prefer the Jupyter Notebook approach :
In general, I would suggest :
Eventually, there could be some specific approach for project and examples using parallelization (in space and/or time) ... |
Beta Was this translation helpful? Give feedback.
-
https://docs.readthedocs.io/en/stable/guides/jupyter.html Seems like a pretty neat alternative to current pySDC tutorial format ... ? |
Beta Was this translation helpful? Give feedback.
-
It becomes increasingly clear to me that good documentation of what you did is just as important as good implementation, since the progress is otherwise lost extremely quickly.
I thought we could have a discussion on how to best document a project.
I started writing in jupyter notebooks because they allow for easy-going combination of text, markdown and images, but they have certain drawbacks. In particular, they are hard to integrate with the CI-pipeline to the point that I gave up on integrating them into the website.
Also, plots I showed there are generated locally on my laptop and not updated when the code is changed.
And another drawback is that git is not great with notebooks. You can display the rendered notebook on gh just fine, but showing diffs is a messy affair to the point that I usually add them to the commit without checking what changed.
Finally, I failed to include python variables in the markdown cells.
In the future, I will, for these reasons, try to keep everything within a README.rst file, which gh also displays nicely.
What kept me from doing this was that I didn't have a good editor for this, but a quick google search directed me to
restview
, which is a tool that displays the rendered html version of your rst file in a browser and updates automatically every time the rst file is saved.While writing equations and inserting images in rst is not as nice as in jupyter, the immediate rendering allows for a somewhat smooth experience and comes with the benefit of not having to use jupyter.
Instead, I can use my favourite code editor, which, as it turns out, even supports spell checking.
I am sure that I will struggle to get images displayed on gh a bit, since the paths to the plots are different when executing on my local laptop and when the CI pipeline creates the plots, but I am sure I can find a way to deal with this.
Anyways, I am sure you all have much more experience with these things and I would appreciate some discussion on what are the best tools to use and other advice.
Beta Was this translation helpful? Give feedback.
All reactions