Skip to content
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

Add "Spectrum Plot" tutorial to Learn Astropy repo #423

Closed
wants to merge 1 commit into from
Closed

Add "Spectrum Plot" tutorial to Learn Astropy repo #423

wants to merge 1 commit into from

Conversation

kakirastern
Copy link
Contributor

Fixes #331.

Adding new content to the Learn Astropy repo as the "Spectrum Plot" tutorial originally authored by Jeff Mangum. Original source can be accessed at: https://github.com/jmangum/spectrumplot. Consent has been obtained from Mangum to use his original material. This version is an expanded version of the original. Previously tested on Google Colab and the tutorial has been running successfully.

@kakirastern
Copy link
Contributor Author

May need to add requirements.txt to the new spectrumplot directory containing the tutorial material including the Jupyter notebook. Once that has been done will remove the [WIP] tag from the PR heading.

@kakirastern kakirastern changed the title [WIP] Add "Spectrum Plot" tutorial to Learn Astropy repo Add "Spectrum Plot" tutorial to Learn Astropy repo Feb 10, 2020
@kakirastern
Copy link
Contributor Author

@kakirastern
Copy link
Contributor Author

Am testing the setup tonight but unfortunately is not in form so kept making minor mistakes... Once the PR passes the CircleCI tests will then rebase and squash all commits into one.

@kakirastern
Copy link
Contributor Author

My apologies for the many CircleCI failures. This tutorial works locally but for some reason needs much effort to get it to work on Learn Astropy as well. Will try smarter instead of harder from now on.

@kakirastern
Copy link
Contributor Author

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/home/circleci/project/venv/lib/python3.7/site-packages/nbformat/reader.py", line 14, in parse_json
    nb_dict = json.loads(s, **kwargs)
  File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.7/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 311 column 32 (char 11034)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/circleci/project/venv/lib/python3.7/site-packages/sphinx/config.py", line 348, in eval_config_file
    execfile_(filename, namespace)
  File "/home/circleci/project/venv/lib/python3.7/site-packages/sphinx/util/pycompat.py", line 81, in execfile_
    exec(code, _globals)
  File "/home/circleci/project/tutorials/conf.py", line 164, in <module>
    process_notebooks(nb_tutorials_path, **processkwargs)
  File "/home/circleci/project/scripts/convert.py", line 238, in process_notebooks
    nbc.execute()
  File "/home/circleci/project/scripts/convert.py", line 94, in execute
    nb = nbformat.read(f, as_version=IPYTHON_VERSION)
  File "/home/circleci/project/venv/lib/python3.7/site-packages/nbformat/__init__.py", line 140, in read
    return reads(fp.read(), as_version, **kwargs)
  File "/home/circleci/project/venv/lib/python3.7/site-packages/nbformat/__init__.py", line 73, in reads
    nb = reader.reads(s, **kwargs)
  File "/home/circleci/project/venv/lib/python3.7/site-packages/nbformat/reader.py", line 58, in reads
    nb_dict = parse_json(s, **kwargs)
  File "/home/circleci/project/venv/lib/python3.7/site-packages/nbformat/reader.py", line 17, in parse_json
    raise NotJSONError(("Notebook does not appear to be JSON: %r" % s)[:77] + "...")
nbformat.reader.NotJSONError: Notebook does not appear to be JSON: '{\n "cells": [\n  {\n   "cell_type": "m...

make: *** [Makefile:43: html] Error 2

Exited with code exit status 2

@kakirastern
Copy link
Contributor Author

TODO: Will need to move cube file to http://data.astropy.org server to make things work, as suggested in http://learn.astropy.org/contributing.html#data-files. Planning to do so next.

@kakirastern
Copy link
Contributor Author

Moving additional contents, including the data cube FITS file, to https://github.com/astropy/astropy-data/ via PR astropy/astropy-data#86. Will need to follow up soon before this PR can be finalized.

@kakirastern
Copy link
Contributor Author

Now am getting the expected 404 error. Will try to resolve this during one of the upcoming telecons soon.

@bsipocz
Copy link
Member

bsipocz commented Feb 26, 2020

this needs a review from the @astropy/learn-astropy-maintainers team before I'm comfortable to merge the fits file into astropy-data

@kakirastern
Copy link
Contributor Author

@bsipocz Thanks for the notice! I will follow the matter up during one of the upcoming Learn Astropy telecons so that the maintainers will be aware of the situation and will review this PR accordingly.

Add requirements.txt file for spectrumplot tutorial

Downgrade Astropy version to pass CircleCI

Add extra space to last line of file

Update all versions of required packages to debug

Update required pyspeckit version to dev version in notebook

Debug

Try in-notebook installation of regions to debug

Remove kernel specs in notebook using GitHub interface

Debug by changing path name for cubefile

Change download file code

Clean metadata

Move extra files into astropy-data

Debug notebook
@adrn adrn requested a review from eblur March 2, 2020 15:44
@eblur
Copy link
Contributor

eblur commented Apr 6, 2020

I've reviewed approximately half of the notebook in detail. At this moment, it needs much more exposition and explanation of what is going to be done in the notebook and why. I've made a lot of notes for places were more explanatory material needs to be.

However, I am concerned that several of the packages used in this tutorial are in the actively process of being replaced by specutils in some way. I recommend that we clean, perhaps rewrite, this tutorial during the Astropy spectroscopy sprint to make it as up-to-date with the Astropy ecosystem as possible.

@kakirastern
Copy link
Contributor Author

I've reviewed approximately half of the notebook in detail. At this moment, it needs much more exposition and explanation of what is going to be done in the notebook and why. I've made a lot of notes for places were more explanatory material needs to be.

However, I am concerned that several of the packages used in this tutorial are in the actively process of being replaced by specutils in some way. I recommend that we clean, perhaps rewrite, this tutorial during the Astropy spectroscopy sprint to make it as up-to-date with the Astropy ecosystem as possible.

Sure, can do more exposition and explanation with a rewrite during Spectroscopy Sprint 2020 this week.

@kakirastern
Copy link
Contributor Author

@eblur I kind of get the idea of how you would like this tutorial to go, and will rewrite the tutorial significantly to match with your expectations.

@kakirastern kakirastern self-assigned this Jul 8, 2020
@kakirastern kakirastern removed their assignment Jul 8, 2020
@eteq eteq closed this Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Tutorial: Turning jmangum/spectrumplot into Learn Astropy tutorial
4 participants