nteract / scrapbook

A library for recording and reading data in notebooks.
https://nteract-scrapbook.readthedocs.io
BSD 3-Clause "New" or "Revised" License
281 stars 26 forks source link

What happens when running `glue` from an ipython console #42

Open BenRussert opened 5 years ago

BenRussert commented 5 years ago

It is convenient to use an ipython console to quickly look for scraps using sb.read_notebooks, so I wondered what would happen if I try glue outside a notebook environment like this.

When I tried this, there was no error message or anything so my question is:

Should there be an error message? Does anything happen? Should something happen?

MSeal commented 5 years ago

I think at least a warning if not an error should be raised when not connected to a zeromq channel. The only hesitation in raising an error is that users would need to branch code that side-effects a glue call when used outside of a notebook, which might be unexpected. Plus detection of such a state appears to be difficult currently, so kernel usages in other contexts could be problematic if we raised an error when we shouldn't be.

So I'd vote for a warning event so there is at least visibility into the fact that the glue action is not recording any references to data. A place to think about this more is around glue calls to remote stores. Should we still save the remote data or fail fast with an exception if we likely know that the reference will be lost?