[CCPPETMR/SIRF] spyder or jupyter notebooks for interactive demos (#170)

0 views
Skip to first unread message

Kris Thielemans

unread,
May 10, 2018, 8:29:29 AM5/10/18
to CCPPETMR/SIRF, Subscribed

for the course, we've decided on jupyter notebooks (assuming it all works!). That will lead to duplication of demos and therefore bugs.

One solution might be to swap to jupyter notebooks and tell people about the spyder plug-in to use jupyter notebooks in spyder. I haven't tried this yet.

By the way, there seems to be a nice feature of jupyter notebooks to be able to generate a new notebook with all output, and then convert it to HTML (or Latex or ...), see here. This would be good for generating documentation.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Edoardo Pasca

unread,
May 10, 2018, 10:21:08 AM5/10/18
to CCPPETMR/SIRF, Subscribed

And I've made a script to convert spyder scripts to jupyter notebooks! We can close the circle.

Kris Thielemans

unread,
May 10, 2018, 10:23:10 AM5/10/18
to CCPPETMR/SIRF, Subscribed

:-) I knew you were not a copy-paste guy.

will be interesting to see the output... Note that there are some fixes on the demos already.

Edoardo Pasca

unread,
May 10, 2018, 11:35:57 AM5/10/18
to CCPPETMR/SIRF, Subscribed

After the first file I painstakingly translated I went for the more interesting way. Which enabled me to update the notebook you've updated!

I've got a question: it seems that you need to run the PET interactive samples in a single thread, as one is needed for the other step. Shall I put it all in one notebook?

MR notebooks work like charm.

BTW, you can already try it on any machine with SIRF installed (and jupyter)

Kris Thielemans

unread,
May 10, 2018, 11:49:53 AM5/10/18
to CCPPETMR/SIRF, Subscribed

great.

RE the PET interactive ones question, does each notebook run with its own kernel? If not, I'd rather avoid it. It otherwise would become a very large notebook. Maybe we could put some stuff in then to avoid the dependency. To discuss tomorrow?

BTW: try, yes. great. but where are they? :-;

Edoardo Pasca

unread,
May 10, 2018, 12:14:48 PM5/10/18
to CCPPETMR/SIRF, Subscribed

they are here https://github.com/CCPPETMR/SIRF-Exercises/tree/notebook

Yes, each notebook runs on a different kernel, and to make a notebook connect to another kernel is quite a hack.

Kris Thielemans

unread,
Jun 1, 2018, 6:29:03 AM6/1/18
to CCPPETMR/SIRF, Subscribed

notebook convert can output spyder, and/or check the spyder notebook plug-in.

Casper da Costa-Luis

unread,
Jun 1, 2018, 6:29:43 AM6/1/18
to CCPPETMR/SIRF, Subscribed

Casper da Costa-Luis

unread,
Jun 1, 2018, 6:31:47 AM6/1/18
to CCPPETMR/SIRF, Subscribed

from the link above, we could do ipython nbconvert --config mycfg.py which should hopefully allow us to replace # <codecell> with #%% automatically. If it doesn't we can always run our own script to do the replacement.

Casper da Costa-Luis

unread,
Jun 1, 2018, 9:28:48 AM6/1/18
to CCPPETMR/SIRF, Subscribed

update: jupyter nbconvert --to python now does # In [*] instead. This seems to be supportend by spyder (spyder-ide/spyder#1783). I've tested this with latest jupyter and spyder via conda (and nbstripout via pip). I'd recommend:

nbstripout file.ipynb && jupyter nbconvert --to python file.ipynb

Kris Thielemans

unread,
Aug 30, 2019, 10:16:55 AM8/30/19
to CCPPETMR/SIRF, Subscribed

would need to be done at install time (see #181) I think

Reply all
Reply to author
Forward
0 new messages