-
-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert UVES tutorial to ipython notebook format #43
Conversation
Quick suggestion from a glance: can you change the download to use the astropy download tools? This will add both caching and a progress bar The first code cell would then look like this:
Also, what's going on with the |
Thanks @eteq. I have used the |
Hmm, perhaps... But in the notebook format, it's really not obvious "where" the user is (e.g. what directory). Perhaps extracting to an explicit location is better? Something like:
Then at least the user knows exactly where it's going? Alternatively, you could have the tutorial work without extracting the file, but somewhere you could say "If you wish to extract the file to look at it with a fits image viewer, just to f.extractall(location)". There's also the prosaic problem that this will extract the data file every time someone deploys the notebook.... Not necessarily a serious problem, but possibly mildly annoying for the maintainers. @adrn, what do you think? |
I have used @eteq's suggestion to define a directory path to extract the data in the last commit until this issue is settled. |
Looks fine to me now - @adrn, have any opinions here? |
Hm, that seems fine. @migueldvb Looking good! Can you remove the sphinx markup from the text? Anywhere you see something like |
Thanks @adrn, I'm starting to correct those formatting issues. For references to other tutorials should I use absolute or relative URLs? |
@migueldvb - I think relative URLs make the most sense, as that way we don't have to worry about anything odd that might come from changing registrars and the like. |
Here's a direct link:
|
Every time I look I find another piece of Sphinx markup :) In Acknowledgements, there is |
Hm I also notice a few formatting issues -- are you editing the .ipynb file directly, or through the notebook? Some cells contain text and code, and some code is not properly indented. Could you open in the notebook and review the cells one by one? One other Sphinx relic I've noticed -- some lines end in double colons, but they should just be single colons now. |
I think that all of those formatting issues have been corrected now. |
@migueldvb - You need to include proper CC license information and attribution to Smithsonian Astrophysical Observatory: http://python4astronomers.github.io/#license And probably a good idea to let @hamogu know that his chapter is going new places! :-) |
@migueldvb - the notebook now encompasses everything in Also, the metadata no longer lives in a separate |
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The previous astropy tutorial already covered\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps "The previous ..." -> "A previous ..."
@migueldvb - I think it makes sense for you to add yourself to the list of authors here (as long as @hamogu has no objection). (And one other thing you may or may not know: to see how the final version looks, you can do |
@migueldvb - Since you authored on this notebook, you should be listed |
@taldcroft : Everything should have a licence and CC is fine, if that's what we decided to use for the tutorial notebooks. |
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Then start up IPython with the ``--pylab`` option to enable easy plotting" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we now deliver this as an IPython notebook, IPython must be started already at this point (or how do you read the notebook in the first place?).
Maybe here should be a link to "inline plotting in IPython"or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this sentence can be removed since one can use the inline backend for plotting
@taldcroft, @hamogu - I have included the CC lincense information in commit ba520c9 |
rebasing on top of the master branch |
@eteq I get a
|
@eteq Now I only get warnings when I run the command
I'm not sure how to ger rid of those. |
"License: This tutorial is made available under the terms of the\n", | ||
"[Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0/)\n", | ||
"\n", | ||
"Authors: Moritz Guenther\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should update this with your name too, @migueldvb, so that you get proper credit!
@migueldvb - what warnings are you seeing? I just tried it now and saw no warnings. So other than those two small things I mentioned, I think this may be all set. Or perhaps @hamogu wants to take a final look at it? |
I won't have time to look at this again in the next few weeks, so please |
Thanks @eteq, I have made those changes. I think that the only remaining warning appears when trying to extract the downloaded tarball in a location where the data has already been extracted. I will check later this week because I am missing a dependency to run the |
There is a
Other than that I think that the other issues have been fixed now. |
I think it would make sense to use standard-compliant files for tutorials to avoid this kind of issue. This one can be fixed by just changing RADECSYS to RADESYS. |
@astrofrog That makes sense. How can the tarfile be updated in the python4astronomers download area? |
Either we can update it via the python4astronomers repository: https://github.com/python4astronomers or we could consider hosting it ourselves as part of astropy. Maybe this is a good chance to finally make use of |
Thanks @astrofrog. I have renamed the keyword in the UVES data and made a PR in the python4astronomers repo: python4astronomers/python4astronomers.github.com/pull/3 |
I like @astrofrog's suggestion of switching this to using Once that's done, @migueldvb, you can just change the url variable in the first code cell to |
* Switching to data.astropy.org
The data should be on http://data.astropy.org/tutorials/UVES/ |
@astrofrog - just tried it now and it didn't work, I think because it's |
Ok, @astrofrog updated the file, so this is good to go! I noticed a couple other which should probably be changed while testing, and will just fix those directly as part of the merge process. Thanks, @migueldvb and @hamogu ! |
Convert UVES tutorial to ipython notebook format
Pasted UVES tutorial into an ipython notebook. The cells that nteractively hide/show part of the code in the exercises are not yet implemented in the notebook.