Skip to content

Commit 8a27879

Browse files
committed
Merge branch 'master' of github.com:astropy/astropy-tutorials
2 parents fefba68 + 9c72e3d commit 8a27879

File tree

15 files changed

+126
-87
lines changed

15 files changed

+126
-87
lines changed

.circleci/config.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ pip-run: &pip-install
1313
command: |
1414
python3 -m venv venv
1515
. venv/bin/activate
16-
pip install -r pip-requirements.txt
17-
pip install sphinx pytest
18-
pip install sphinx-astropy sphinx-bootstrap-theme
19-
pip install git+https://github.com/jupyter/nbconvert
16+
pip install -r pip-requirements.txt --progress-bar off
17+
pip install --progress-bar off sphinx pytest
18+
pip install --progress-bar off sphinx-astropy sphinx-bootstrap-theme nbconvert==5.6.1
2019
2120
jobs:
2221

@@ -68,4 +67,4 @@ jobs:
6867
6968
notify:
7069
webhooks:
71-
- url: https://giles.cadair.com/circleci
70+
- url: https://giles.cadair.dev/circleci

environment.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,7 @@ channels:
44
- astropy
55

66
dependencies:
7-
- python=3.6
8-
- IPython=6.1.0
9-
- astropy=3
10-
- astroquery>=0.3.7
11-
- matplotlib==3.0.2
12-
- numpy=1.14
13-
- scipy=1.0 # needed for coordinates cross-matching
14-
- jupyter=1.0
15-
- notebook>=5.7.2
16-
- aplpy # used in FITS-cube tutorial
17-
- spectral-cube # used in FITS-cube tutorial
18-
- reproject # used in FITS-cube tutorial
19-
- dust_extinction>=0.7
7+
- python=3.7
8+
- pip
9+
- pip:
10+
- -r pip-requirements.txt

pip-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ scipy>=1.0
88
notebook>=5.7.2
99
aplpy
1010
spectral-cube
11-
reproject
11+
reproject==0.5.1
1212
dust_extinction>=0.7
1313
astro-gala
1414
dust_extinction>=0.7
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tutorials/dev.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,37 @@ Marking a cell with an intentional error
136136
Edit the cell metadata of the cell in which you would like to raise an exception
137137
and add the following to the top-level JSON: ``"tags": ["raises-exception"]``
138138
This tag is recognized by the latest (master) version of nbconvert.
139+
140+
Automatically Strip Output and Notebook Metadata
141+
------------------------------------------------
142+
143+
Jupyter notebooks contain some metadata that is typically hidden from users,
144+
which contains, for example, information about the Python kernel used to run it, the
145+
version of IPython, etc. When tutorial authors or maintainers edit notebooks,
146+
this metadata is automatically modified by Jupyter, leading to superfluous and
147+
sometimes confusing changes to the notebooks when viewed in a "diff" locally or
148+
on GitHub.
149+
150+
In order to prevent such metadata updates from appearing in pull requests, we
151+
therefore recommend that any contributor or maintainer install and use
152+
`nbstripout <https://github.com/kynan/nbstripout>`_ set up with an automatic Git
153+
hook to clean metadata changes whenever a notebook change is committed to your
154+
local repo. To install ``nbstripout``, first pip install it with:
155+
156+
pip install nbstripout
157+
158+
This repo is already configured. Next, configure Git within your
159+
local clone of astropy-tutorials to tell ``nbstripout`` to intervene whenever
160+
you commit changes in the repo. To do this, you first have to "install" it with:
161+
162+
nbstripout --install
163+
164+
Then, to tell ``nbstripout`` to ignore metadata changes, you must also run:
165+
166+
git config filter.nbstripout.extrakeys '
167+
metadata.celltoolbar metadata.kernel_spec.display_name
168+
metadata.kernel_spec.name metadata.language_info.codemirror_mode.version
169+
metadata.language_info.pygments_lexer metadata.language_info.version
170+
metadata.toc metadata.notify_time metadata.varInspector
171+
cell.metadata.heading_collapsed cell.metadata.hidden
172+
cell.metadata.code_folding cell.metadata.tags cell.metadata.init_cell'

tutorials/notebooks/FITS-cubes/FITS-cubes.ipynb

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"\n",
2222
"## Summary\n",
2323
"\n",
24-
"In this tutorial we will visualize 2D and 3D data sets in Galactic and equartorial coordinates. \n",
24+
"In this tutorial we will visualize 2D and 3D data sets in Galactic and equatorial coordinates. \n",
2525
"\n",
2626
"The tutorial will walk you though a visual analysis of the Small Magellanic Cloud (SMC) using HI 21cm emission and a Herschel 250 micron map. We will learn how to read in data from a file, query and download matching data from Herschel using astroquery, and plot the resulting images in a multitude of ways. \n",
2727
"\n",
@@ -832,12 +832,28 @@
832832
},
833833
"language_info": {
834834
"codemirror_mode": {
835-
"name": "ipython"
835+
"name": "ipython",
836+
"version": 3
836837
},
837838
"file_extension": ".py",
838839
"mimetype": "text/x-python",
839840
"name": "python",
840-
"nbconvert_exporter": "python"
841+
"nbconvert_exporter": "python",
842+
"pygments_lexer": "ipython3",
843+
"version": "3.7.5"
844+
},
845+
"toc": {
846+
"base_numbering": 1,
847+
"nav_menu": {},
848+
"number_sections": true,
849+
"sideBar": true,
850+
"skip_h1_title": false,
851+
"title_cell": "Table of Contents",
852+
"title_sidebar": "Contents",
853+
"toc_cell": false,
854+
"toc_position": {},
855+
"toc_section_display": true,
856+
"toc_window_display": false
841857
}
842858
},
843859
"nbformat": 4,

0 commit comments

Comments
 (0)