nbval
nbval copied to clipboard
Is sharing state between cells and expected and testable use case?
As title. I very often work with notebooks which first generate a dataset then proceed to analyse it across a number of interdependent cells. I would assume that most users would have a similar pattern. I have however found that testing a notebook fails unless I import all cell dependencies into each cell, which to me is an anti-pattern.
Am I missing a configuration which allows me to use the notebook global scope within each cell/test? I admit I am not an expert at the inner workings of ipython notebooks.
Do you have a small example you can share to illustrate this? The global variables are meant to persist from one cell to the next by default, it shouldn't need any configuration.
On Wed, 4 Dec 2024, 04:46 jstathakis, @.***> wrote:
As title. I very often work with notebooks which first generate a dataset then proceed to analyse it across a number of interdependent cells. I would assume that most users would have a similar pattern. I have however found that testing a notebook fails unless I import all cell dependencies into each cell, which to me is an anti-pattern.
Am I missing a configuration which allows me to use the notebook global scope within each cell/test? I admit I am not an expert at the inner workings of ipython notebooks.
— Reply to this email directly, view it on GitHub https://github.com/computationalmodelling/nbval/issues/214, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACQB5NIQT3QTJFSRK6ZQ232D2CJXAVCNFSM6AAAAABS7HJAROVHI2DSMVQWIX3LMV43ASLTON2WKOZSG4YTMNJVGA3TKMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>