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

trying to bring my material up-to-date with astropy-tutorials main #2

Merged
merged 54 commits into from
Jul 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
5673b0b
Update Quantities notebook
May 3, 2020
5cab0ad
pin sphinx version
adrn May 18, 2020
234dfa2
use to_value
adrn May 18, 2020
fe36fd4
fix pin
adrn May 18, 2020
49c9aac
pin again
adrn May 18, 2020
5e6369e
Merge pull request #449 from kakirastern/update-quantities
adrn May 18, 2020
387ecde
Update contributing doc to add uploading data files to Zenodo info
Jul 22, 2020
195ad6a
Apply suggestions from code review
Sep 2, 2020
21968ff
Merge pull request #455 from kakirastern/update-contributing-doc-for-…
eblur Sep 2, 2020
4d59237
Add SkyCoord1 tutorial notebook
Mar 30, 2020
eef5521
apw edits to new tutorial
adrn Sep 16, 2020
f51ed4f
Merge pull request #1 from adrn/apw-celestial-coords1
Sep 16, 2020
92c20d9
Rename the path for the tutorial
Sep 16, 2020
a9c8332
Update requirements.txt to remove requests from list
Sep 16, 2020
a677700
Remove requests from pip-requirements.txt
Sep 16, 2020
0292080
Merge pull request #453 from kakirastern/celestial-coords1
adrn Sep 16, 2020
486d82e
fix multi-line code in UVES tutorial - fixes #448
adrn Sep 16, 2020
d77c1b0
TST: Remove Travis
pllim Nov 18, 2020
b3254ea
use dev version of astroquery - fixes #463
adrn Nov 18, 2020
a2cc1b6
oops - replace the other astroquery line
adrn Nov 18, 2020
5aa40b4
Merge pull request #468 from pllim/rm-travis
adrn Nov 18, 2020
149e644
upgrade pip
adrn Nov 18, 2020
351b94a
oh, also install wheel
adrn Nov 18, 2020
80dc4e0
Merge pull request #470 from adrn/dev-astroquery
adrn Nov 18, 2020
1ee0e33
add new notebooks based on 2020 AAS workshop content
adrn Sep 16, 2020
61a13c6
move coordinates tutorials into same directory
adrn Sep 16, 2020
101b00a
editing
adrn Sep 23, 2020
d720948
add data file for other tutorials and sketch transforms
adrn Sep 29, 2020
24e049f
updates to transforms tutorial
adrn Sep 30, 2020
3bc6fe3
aitoff plots
adrn Oct 7, 2020
f2b00d9
more words
adrn Nov 5, 2020
24a6b4f
finished transforms tutorial
adrn Nov 11, 2020
95d5381
words
adrn Nov 11, 2020
2d05660
fix permissions
adrn Nov 18, 2020
9c952ce
swap 3 and 4
adrn Nov 18, 2020
465c840
words about velocities
adrn Nov 18, 2020
0f984db
oops number in title
adrn Nov 18, 2020
aa916c2
learning goals
adrn Nov 18, 2020
add55cd
crossmatch tutorial
adrn Nov 18, 2020
876af92
oops, fix failure
adrn Nov 18, 2020
693a6c3
add fits files for locally cached tables
adrn Nov 18, 2020
175675d
comment out old exercise
adrn Nov 18, 2020
858937b
remove output from notebooks
adrn Nov 18, 2020
7a22b14
DOC: Replace astropy channel with conda-forge [ci skip]
pllim Nov 30, 2020
4c5b0be
Merge pull request #471 from pllim/rm-astropy-channel
adrn Dec 2, 2020
6337837
MNT: Replace master with main
pllim Mar 9, 2021
f6dfbd3
Revert out-of-scope changes
pllim Mar 9, 2021
b6117a4
github reviews
adrn Apr 27, 2021
7d539f3
remove exercises
adrn May 6, 2021
0e628ee
Merge pull request #460 from adrn/coordinates-overhaul
adrn May 10, 2021
e3f22e6
Fix bug in color-excess.ipynb
krislars May 18, 2021
a8effec
Merge pull request #486 from krislars/patch-1
adrn May 18, 2021
7c80520
Merge pull request #477 from pllim/replace-with-main
adrn May 20, 2021
9c1f89f
Merge branch 'master' into main
eblur Jul 8, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ pip-run: &pip-install
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r pip-requirements.txt --progress-bar off
pip install --progress-bar off sphinx pytest
pip install --progress-bar off sphinx-astropy sphinx-bootstrap-theme nbconvert==5.6.1
python3 -m pip install --upgrade pip wheel
python3 -m pip install -r pip-requirements.txt --progress-bar off
python3 -m pip install --progress-bar off "sphinx>=2.0,<3.0" pytest
python3 -m pip install --progress-bar off sphinx-astropy sphinx-bootstrap-theme nbconvert==5.6.1

jobs:

Expand Down
51 changes: 0 additions & 51 deletions .travis.yml

This file was deleted.

31 changes: 26 additions & 5 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Overview

Each tutorial is a `Jupyter notebook <http://jupyter.org/>`_ file. Each notebook is saved in a separate directory within the ``tutorials/notebooks``
subdirectory in this project. For an example, let's look at the source notebook
of the `FITS-header <https://github.com/astropy/astropy-tutorials/tree/master/tu
of the `FITS-header <https://github.com/astropy/astropy-tutorials/tree/main/tu
torials/notebooks/FITS-header/>`_ tutorial. Within
``tutorials/notebooks/FITS-header``, there is a single Jupyter notebook file
that contains the text and code for the tutorial, and any small data files used
Expand Down Expand Up @@ -188,7 +188,7 @@ your ``requirements.txt`` file would look like:
numpy>=1.13

To see an example, have a look at the FITS-header `requirements.txt file <https:
//github.com/astropy/astropy-tutorials/blob/master/tutorials/notebooks/FITS-head
//github.com/astropy/astropy-tutorials/blob/main/tutorials/notebooks/FITS-head
er/requirements.txt>`_.

Push the notebook and other files from your local branch up to your fork of the
Expand All @@ -211,7 +211,10 @@ If your tutorial includes large data files (where large means >~ 1 MB), we don't
want to include them in the ``astropy/astropy-tutorials`` git repository, as
that will drastically slow down cloning the repository. Instead, we encourage
use of the `astropy.utils.download_files` function, and will host data files on
the `<http://data.astropy.org>`_ server. To do this, use the following
the `<http://data.astropy.org>`_ server by opening a PR at the
`<https://github.com/astropy/astropy-data>`_ repository, or to use Zenodo to host the data files
if the file concerned is larger than 10 MB.
To do the former, use the following
procedure:

* When writing your tutorial, include the files in your tutorial's directory
Expand Down Expand Up @@ -241,10 +244,28 @@ procedure:

If you do this, the only change necessary when merging your notebook will be to set ``tutorialpath`` to ``'http://data.astropy.org/tutorials/My-tutorial-name/'``.

For larger data files that are bigger than 10 MB in size, we recommend hosting with Zenodo.
To use this approach, follow these steps:

* You will need to sign up for an account with Zenodo before you can upload a file there.

* After a Zenodo account has been properly set up, be sure to log in and do a new upload. Follow
the Zenodo instructions and complete all the required fields as the bare minimum in order to have
the data file(s) uploaded to their records. Once this is done you will have a link to share the data.

* With the link to the data file record, which has the format ``https://zenodo.org/api/records/:id``, an example HTTP GET request needed to retrieve the data using the Python package ``requests`` is shown below::

import requests
r = requests.get("https://zenodo.org/api/records/1234)

To use the output as a locally stored file, you would first need to write the file contents to a file, for example::

with open('./some-data-file.fits', 'wb') as f:
f.write(r.content)

If you need information or help with:

* previewing how the rendered Jupyter notebooks will look on the tutorial
webpage
* previewing how the rendered Jupyter notebooks will look on the tutorial webpage
* marking a cell with an intentional / expected error

please see the :ref:`dev-page`.
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You can also get started quickly using `Binder <http://mybinder.org>`_ to run th
your web browser within a remote server:

.. image:: http://mybinder.org/badge.svg
:target: https://mybinder.org/v2/gh/astropy/astropy-tutorials/master?filepath=tutorials/notebooks
:target: https://mybinder.org/v2/gh/astropy/astropy-tutorials/main?filepath=tutorials/notebooks


Contributing tutorial material
Expand Down
9 changes: 5 additions & 4 deletions pip-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
IPython>=6.1
astropy>=3
astroquery>=0.3.7
astropy>=4
git+https://github.com/astropy/astroquery.git
matplotlib==3.0.2
numpy>=1.15
numpy>=1.17
jupyter>=1.0
scipy>=1.0
notebook>=5.7.2
aplpy
spectral-cube
git+https://github.com/radio-astro-tools/spectral-cube.git#egg=spectral-cube
git+https://github.com/radio-astro-tools/radio-beam.git#egg=radio-beam
reproject==0.5.1
dust_extinction>=0.7
astro-gala
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
tests_path = path.split(path.abspath(__file__))[0]

def test_convert_succeed():
# With the current master version of nbconvert, we can allow errors
# With the current main version of nbconvert, we can allow errors
# per-cell. This notebook, even though it raises an exception, should still
# execute fine:
nbc = NBConverter(path.join(tests_path, 'test-succeed.ipynb'))
Expand Down
4 changes: 2 additions & 2 deletions tutorials/astropy.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
.. raw:: html

<a href="../_static/{{ nb_name }}/{{ nb_name }}.ipynb"><button id="download">Download tutorial notebook</button></a>
<a href="https://beta.mybinder.org/v2/gh/astropy/astropy-tutorials/master?filepath=/tutorials/notebooks/{{ nb_name }}/{{ nb_name }}.ipynb"><button id="binder">Interactive tutorial notebook</button></a>
<a href="https://beta.mybinder.org/v2/gh/astropy/astropy-tutorials/main?filepath=/tutorials/notebooks/{{ nb_name }}/{{ nb_name }}.ipynb"><button id="binder">Interactive tutorial notebook</button></a>

<div id="spacer"></div>

Expand All @@ -31,7 +31,7 @@
<div id="spacer"></div>

<a href="../_static/{{ nb_name }}/{{ nb_name }}.ipynb"><button id="download">Download tutorial notebook</button></a>
<a href="https://beta.mybinder.org/v2/gh/astropy/astropy-tutorials/master?filepath=/tutorials/notebooks/{{ nb_name }}/{{ nb_name }}.ipynb"><button id="binder">Interactive tutorial notebook</button></a>
<a href="https://beta.mybinder.org/v2/gh/astropy/astropy-tutorials/main?filepath=/tutorials/notebooks/{{ nb_name }}/{{ nb_name }}.ipynb"><button id="binder">Interactive tutorial notebook</button></a>

{% endblock %}

Expand Down
12 changes: 4 additions & 8 deletions tutorials/dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Documentation on tutorials infrastructure
Overview
--------

Tutorials are written as Jupyter notebooks on the ``master`` branch of the
Tutorials are written as Jupyter notebooks on the ``main`` branch of the
``astropy/astropy-tutorials`` repository in ``tutorials/notebooks/``. These
notebook files do not contain output in order to simplify version-controlling
the files.
Expand All @@ -18,15 +18,11 @@ to look like the main documentation. Sphinx requires restructured text (RST)
files for its build process, so use an intermediate step to run the notebooks to
produce output, and then convert the notebook files into RST files.

We use our own run-and-convert machinery using ``nbconvert``. We use the same
script that converts the notebooks to RST to test the notebooks on travis by
simply executing the notebooks and ignoring the output.

We use `CircleCI <https://circleci.com>`_ to do the Sphinx build, which is then
pushed to the ``gh-pages`` branch of the repository and served by GitHub. The
notebooks are first converted to RST files during the Sphinx build by doing the
conversion at the end of the `Sphinx configuration file
<https://github.com/astropy/astropy-tutorials/blob/master/tutorials/conf.py>`_.
<https://github.com/astropy/astropy-tutorials/blob/main/tutorials/conf.py>`_.

Why not use nbsphinx?
---------------------
Expand Down Expand Up @@ -77,7 +73,7 @@ Building the tutorials page locally
-----------------------------------

For this, you can use the `Makefile
<https://github.com/astropy/astropy-tutorials/blob/master/Makefile>`_ at the
<https://github.com/astropy/astropy-tutorials/blob/main/Makefile>`_ at the
top-level of the tutorials repository. From the root level of the cloned or
downloaded repository::

Expand Down Expand Up @@ -135,7 +131,7 @@ Marking a cell with an intentional error

Edit the cell metadata of the cell in which you would like to raise an exception
and add the following to the top-level JSON: ``"tags": ["raises-exception"]``
This tag is recognized by the latest (master) version of nbconvert.
This tag is recognized by the latest (main) version of nbconvert.

Automatically Strip Output and Notebook Metadata
------------------------------------------------
Expand Down
Loading