4 ms·
> I think out-of-order or unknown-order execution is the biggest source of my own mistakes / bugs. To avoid the state problem, I start each cell (or, in org-mo
by jpeloquin 8y ago
> I think out-of-order or unknown-order execution is the biggest source of my own mistakes / bugs.
To avoid the state problem, I start each cell (or, in org-mode, each src block) with a command to set up the environment for that cell, usually by importing a script named something like setup_abc123.py. Cells are not allowed to reference code or results from other cells except through the filesystem, which is under the watchful eye of git. In this workflow, cells exist only to write plots or tables into the notebook for human consumption.
This workflow, for me, has completely eliminated errors due to hidden state dependencies. Before I adopted it I made a serious state-related error every couple of days, which was intolerable.
As a bonus, using a single script to set up the analysis environment makes it trivial to start a new analysis, even with an entirely different tool chain.