astropy-tutorials

78 views
Skip to first unread message

Adrian Price-Whelan

unread,
Oct 11, 2013, 2:43:52 PM10/11/13
to astro...@googlegroups.com, Foster, Jonathan, Kelle Cruz
Got a preliminary "publishing system" set up for the iPython notebooks. I lay out the details below -- so feel free to ignore -- but writing it down so people know that this is being worked on!

The astropy-tutorials repository will have 3 branches that you might care about:

- master: Where tutorials go when they're accepted to the repo. When people write a tutorial, they issue a pull request to master, we iterate until we like it, then it gets merged into master.

- production: Where we move completed tutorials (from master) when we're ready to publish them to the website. It may seem unnecessary to have the extra branch, but there may be a case where we want to publish several tutorials simultaneously, or have a development version of the site or whatever.

- gh-pages: When commits are pushed to the production branch, a script automatically runs on Travis to nbconvert the notebooks into static html pages and essentially builds the index of tutorials. They then get automatically pushed to this branch, which will show up at http://astropy.github.io/astropy-tutorials/ -- we'll set up a subdomain at tutorials.astropy.org to point to this site.

I have a proof-of-concept of this running on my fork (adrn/astropy-tutorials). You can see the multiple branches here: https://github.com/adrn/astropy-tutorials, and the result of the automated nbconvert (for one tutorial) here: adrn.github.io/astropy-tutorials/FITS-header.html

Now on to beautification and making an index page...if anyone wants to help with structure, let me know. Of course, we still need content so please have a look through the issues here to see what people *should* be working on: https://github.com/astropy/astropy-tutorials/issues and look here to see other ideas: https://github.com/astropy/astropy-tutorials/wiki

Thanks especially to Mike D. and Erik T.!

- Adrian

--

Adrian M. Price-Whelan ~ Columbia University ~ http://adrian.pw

Thomas Robitaille

unread,
Nov 3, 2013, 5:23:44 PM11/3/13
to astropy-dev mailing list, Foster, Jonathan, Kelle Cruz
Hi Adrian (and anyone else using and publishing notebooks),

Just for information, you might be interested in the following package:

https://github.com/paulgb/runipy

which makes it easy to run notebooks from the command-line, which is
handy to do before publishing to ensure that all the prompts are
correctly numbered. I have a few PRs open to that package at the
moment which might be handy for the tutorials. If all the datafiles
needed are in the repository, you could even consider using runipy on
Travis.

You might also want to check out the setup.py file in this repository:

https://github.com/astrofrog/py4sci

which contains lecture notes in notebook format. It allows you to do:

python setup.py run # run all notebooks
python setup.py build # convert all notebooks to HTML
python setup.py deploy # upload all notebooks

I originally tried to use Travis, but got annoyed at the delay when
Travis is under heavy load, so I decided that using the deploy command
above is just as easy, and instantaneous.

Cheers,
Tom
> --
> You received this message because you are subscribed to the Google Groups
> "astropy-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to astropy-dev...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Nathan Goldbaum

unread,
Nov 4, 2013, 3:12:28 PM11/4/13
to astro...@googlegroups.com, Foster, Jonathan, Kelle Cruz
Hi all,

I just want to chime in with something that might be helpful. Last week I managed to created a custom sphinx extension that converts an unevaluated notebook into an evaluated, inline notebook inside of a sphinx document.  This uses runipy to script the notebook evaluation and IPython's nbconvert to convert the notebook into html that can be embedded inside of another document.


Please let me know if this sounds useful for the project - I'll happily supply more details.

-Nathan

Stuart Mumford

unread,
Nov 4, 2013, 3:15:15 PM11/4/13
to astropy-dev
Nathan,

That would be really useful for SunPy as well, could you extract that out into something more standalone?

Stuart

Nathan Goldbaum

unread,
Nov 4, 2013, 4:28:20 PM11/4/13
to astro...@googlegroups.com
The extensions are now available on my github: https://github.com/ngoldbaum/RunNotebook

I wasn't sure how to package sphinx extensions using a setup.py file, so I just included the extensions in the root directory and won't attempt uploading them to pypi.

Contributions are very welcome - I'd love to make these more than just prototypes.

-Nathan

Erik Tollerud

unread,
Nov 5, 2013, 8:30:34 PM11/5/13
to astropy-dev
Thanks Nathan,

This is fantastic, and probably exactly what we need to get everything
going with the astropy-tutorials. Thanks for pulling it together!
Erik
Reply all
Reply to author
Forward
0 new messages