These are chat archives for ipython/ipython

17th
Dec 2014
Scott Sanderson
@ssanderson
Dec 17 2014 00:09
@dalejung interesting. I'm sort of moving in the opposite direction at the moment; I'm essentially replacing file storage with blob storage in the database and adding a notion of a user_id to facilitate physical machine migration and sharing
right now my tables are just Users, Directories, Files, where files has a content blob, but breaking out a Cells table would be an interesting experiment
ditto Outputs
one cool thing about it is that I get as many checkpoints as I want more or less for free
though I'm not sure how branching notebooks and checkpoints interact
Dale Jung
@dalejung
Dec 17 2014 01:36
@ssanderson so your tables are replicating FS? Like notebooks are stored the Files table?
Scott Sanderson
@ssanderson
Dec 17 2014 01:36
yeah
Dale Jung
@dalejung
Dec 17 2014 01:36
past the output splitting, I would need to switch to a DB backend. It's just that I'm already using my bundlemanager.
I used to primarily use a Gist backend, where nothing stored to disk.
and the notebooks were categorized by tags
what i miss is having my #transient tag
Scott Sanderson
@ssanderson
Dec 17 2014 01:38
what're the semantics of that?
Dale Jung
@dalejung
Dec 17 2014 01:39
It would be based off of notebook title. "Pandas Intro Stuff #pandas #tutorial"
Scott Sanderson
@ssanderson
Dec 17 2014 01:40
what does #transient do though?
Dale Jung
@dalejung
Dec 17 2014 01:40
and then the content manager would build up a registry that related path to gist
oh
when i didn't want to categorize, like real quick one offs
the dashboard would only show the last 10
this was back before the filebrowser ui change
Scott Sanderson
@ssanderson
Dec 17 2014 01:42
gotcha
made more sense with the previous gui
Scott Sanderson
@ssanderson
Dec 17 2014 01:46
you could do something similar by just attaching special semantics to a transient directory I suppose
Dale Jung
@dalejung
Dec 17 2014 16:22
yar. It's weird though, there's something intrinsically more transient with something that doesn't store to disk. Don't ask me why :/
Jonathan Frederic
@jdfreder
Dec 17 2014 17:28

@jasongrout

or perhaps it should only restore the state on refresh with the currently active kernel. That would be more conservative.

This is basically what I tried the first time around, without promises it works fine, with promises it's not possible. When you refresh the page the onBeforeLeave event is the best chance to get something to run before refresh. However, promises execute like setTimeout(f,0) (when the thread enters an idle state), and the browser does not wait for these things to complete before exiting the page.

Brian E. Granger
@ellisonbg
Dec 17 2014 17:56
Doing things with the onBeforeLeave event is always a last ditch things - we shouldn't rely on it for mission critical things
Min RK
@minrk
Dec 17 2014 17:57
no actions should be taken there, only warn before leave.
Scott Sanderson
@ssanderson
Dec 17 2014 19:52
is there any way in the UI to trigger a checkpoint delete?
Thomas Kluyver
@takluyver
Dec 17 2014 20:06
@ssanderson no, I don't think so
Scott Sanderson
@ssanderson
Dec 17 2014 22:00
so I just realized that I can have my ContentsManager take another ContentsManager as a parameter to add automatic database backup on top of any other manager's behavior
mind=blown
Dale Jung
@dalejung
Dec 17 2014 22:10
like for saving, the first CM calls the second CM's save method?
Scott Sanderson
@ssanderson
Dec 17 2014 22:10
and then calls its own
so I can parameterize it with FileContentsManager
b/c there are times when you do actually want a file on the filesystem
e.g., when you're using pandas read_csv or importing from a .py file
Thomas Kluyver
@takluyver
Dec 17 2014 22:18
neat :)
Dale Jung
@dalejung
Dec 17 2014 22:18
i'm confused where saving ipynb to filesystem helps with read_csv?
isn't that more of a kernel path issue
or am i misundertanding
Scott Sanderson
@ssanderson
Dec 17 2014 22:18
saving.ipynb isn't useful
but saving uploaded files is
Dale Jung
@dalejung
Dec 17 2014 22:18
ah gotcha
Scott Sanderson
@ssanderson
Dec 17 2014 22:19
for example, right now, if I upload a csv, it appears in the directory, but if I then go to a notebook and do open(path)
it barfs
because I sent it to the db
Dale Jung
@dalejung
Dec 17 2014 22:20
yeah makes sense. didn't even notice you could upload files
since everything for me is local
Scott Sanderson
@ssanderson
Dec 17 2014 22:20
yeah, if you drag a file into the notebook interface from your desktop
it'll upload it