You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+65-57Lines changed: 65 additions & 57 deletions
Original file line number
Diff line number
Diff line change
@@ -17,44 +17,77 @@ with the tutorial.
17
17
18
18
Content Guidelines
19
19
--------
20
-
Narrative:
21
-
- Please read through the other tutorials to get a sense of the desired tone and length.
22
-
- Use the first-person inclusive plural ("we"). For example, "We are going to make a plot which..", "Above, we did it the hard way, but here is the easier way..."
23
-
- Avoid words such as "obviously","just", "simply", "easily". For example, "we just have to do this one thing."
24
-
- Include brief explanations and descriptions
25
-
26
-
Content:
27
-
- Demo ~2-3 astro-relevant functions and 2-3 generic but commonly used functions (e.g., numpy, matplotlib)
20
+
Content Overview:
21
+
- Each tutorial should have 3-5 explicit [Learning Goals](http://tll.mit.edu/help/intended-learning-outcomes) and demonstrate ~2-3 astro-relevant functions and 2-3 generic but commonly used functions (e.g., numpy, matplotlib)
28
22
- Roughly follow this progression:
29
23
- Intput/Output: read in some data
24
+
- use [astroquery](https://astroquery.readthedocs.io/en/latest/) where possible
- use [astropy.visualization](http://docs.astropy.org/en/stable/visualization/) where possible
28
+
37
29
Code:
38
30
- Demonstrate good commenting practice
31
+
- add comments to bits of code which use concepts not included in Learning Goals
39
32
- Demonstrate best practices of variable names.
40
33
- Variables should be all lower case with words separated by underscores.
41
34
- Variable names should be descriptive. E.g., galaxy_mass, u_mag.
35
+
- Use the print function explicitly to display information about variables
42
36
- As much as possible, comply with [PEP8](https://www.python.org/dev/peps/pep-0008/)
37
+
- Imports
38
+
- Do not import `*`. Import package and functions explicitly.
39
+
- Recommended import block and abbreviations
40
+
```python
41
+
import numpy as np
42
+
import matplotlib as mpl
43
+
import matplotlib.pyplot as plt
44
+
import astropy.units as u
45
+
import astropy.coordinates as coord
46
+
from astropy.io import fits
47
+
48
+
%matplotlib inline # make plots display in notebooks
49
+
```
50
+
51
+
52
+
Narrative:
53
+
- Please read through the other tutorials to get a sense of the desired tone and length.
54
+
- Use [Markdown formatting](http://jupyter-notebook.readthedocs.io/en/latest/examples/Notebook/Working%20With%20Markdown%20Cells.html) in text cells for formatting, links, latex, and code snippets.
55
+
- Title should be short yet descriptive and emphasize the learning goals of the tutorial. Try to make the title appeal to a broad audience and avoid referencing a specefic instrument, catalog, or anything wavelength dependent.
56
+
- List all author's full names (comma separated) and link to github profile and/or [ORCID iD](https://orcid.org/).
57
+
- Include [Learning Goals](http://tll.mit.edu/help/intended-learning-outcomes) at the top as a bulleted list.
58
+
- Include Keywords as a comma separated list of topics, packages, and functions demonstrated.
59
+
- The first paragraph should give a brief overview of the entire tutorial including relevant astronomy concepts.
60
+
- Use the first-person inclusive plural ("we"). For example, "We are going to make a plot which..", "Above, we did it the hard way, but here is the easier way..."
61
+
- Section Headings should be in the imperative mood. For example, "Download the data."
62
+
- Avoid words such as"obviously","just", "simply", "easily". For example, "we just have to do this one thing."
63
+
- Use `<div class="alert alert-info">Note</div>`for Notes and`<div class="alert alert-warning">Warning</div>`for Warnings.
43
64
44
-
Description:
45
-
- Compile a list of the functions and packages the tutorial demonstartes and include a short a description with the pull request.
65
+
Template:
66
+
# Doing a thing with things
46
67
47
-
Procedure
48
-
---------
68
+
## Authors
69
+
Jane Smith, Jose Jones
49
70
50
-
If you are unfamiliar with git, you should first get familiar with git and
51
-
github. There are a number of resources available for learning git, but a good
52
-
place to start is with the [github interactive tutorial](http://try.github.io/).
53
-
You should also get familiar with using pull requests and forks on github:
To create and contribute a new tutorial, you will first need to fork the
57
-
astropy-tutorials repository on github and clone this fork locally to your
76
+
## Keywords
77
+
Example, example, example
78
+
79
+
## Companion Content
80
+
Carroll & Ostlie 10.3, Binney & Tremaine 1.5
81
+
82
+
In this tutorial, we download a data file, do something to it, and then visualize it.
83
+
84
+
Procedure for Contributing
85
+
--------------------------
86
+
87
+
The process for contributing a tutorial includes the github [fork](https://help.github.com/articles/working-with-forks/), [branch, push, pull request](https://help.github.com/articles/proposing-changes-to-your-work-with-pull-requests/) workflow.
88
+
89
+
To contribute a new tutorial, first fork the
90
+
astropy-tutorials repository and clone it locally to your
58
91
machine (replace <GITHUBUSERNAME>with your github username)::
All files used by the tutorial -- e.g., example data files, the IPython
74
-
notebook file itself -- should go in this directory. Now you can start writing
75
-
the tutorial! Change directories into this new path and start up an
76
-
IPython notebook server:
77
-
78
-
cd tutorials/Spectral-Line-Fitting
79
-
ipython notebook --matplotlib inline
107
+
notebook file itself -- should go in this directory.
80
108
81
-
Create a new notebook file, and write away! (Following the Content Guidelines above.)
82
-
Remember to place any extra files
83
-
used by the tutorial in the directory with the notebook file, and place them
84
-
under git version control.
85
-
86
-
You will also need to edit the notebook file metadata.
87
-
(IPython notebook --> edit menu --> edit notebook metadata)
88
-
The metadata contains any extra information about the tutorial you may want to add.
89
-
The metadata must contain, at minimum, the following fields:
90
-
91
-
- link_name (the name of the link which will appear in the list of tutorials)
92
-
- author
93
-
- date (month year, e.g. 'July 2013')
94
-
95
-
Here is an example of one of these files: [FITS-header.ipynb](https://github.com/astropy/astropy-tutorials/blob/master/tutorials/FITS-header/FITS-header.ipynb) (be sure to hit the "raw" button to see the metadata).
96
-
97
-
You will also need to specify any python packages that the tutorial depends on.
98
-
Almost always this will include a specific version of `astropy`, and perhaps other affiliated packages.
99
-
You do this by placing a file called `requirements.json` in the directory that contains the tutorial notebook file.
109
+
Specify the python packages the tutorial depends on via the `requirements.json`file.
110
+
Place a file called `requirements.json`in the directory that contains the tutorial notebook file.
100
111
To see in example of that, have a look at [requirements.json](https://github.com/astropy/astropy-tutorials/blob/master/tutorials/FITS-header/requirements.json).
101
112
102
-
When you feel like your tutorial is complete, push your local branch up to your
103
-
fork of the repository on github (by default, named 'origin'):
113
+
Push the notebook and other files on the local branch up to your fork of the repository on github (by default, named 'origin'):
104
114
105
115
git push origin Spectral-Line-Fitting
106
116
107
-
Then you will file a pull request against the main `astropy-tutorials`
108
-
repository for review.
109
-
117
+
When the tutorial is ready for broader community feedback, [open a pull request](https://help.github.com/articles/creating-a-pull-request/) against the main `astropy-tutorials`
118
+
repository in order for the community to review the new tutorial.
110
119
111
120
Data Files
112
121
----------
@@ -117,10 +126,9 @@ If your tutorial includes large data files (where large means >~ 1 MB), we
117
126
don't want them in the astropy/astropy-tutorials git repository, as that will
118
127
drastically slow down cloning the repository. Instead, we encourage use of the
119
128
`astropy.utils.download_files` function, and will host data files on the
120
-
http://data.astropy.org server. To make this easy, use the following procedure
121
-
when you have large data files.
129
+
http://data.astropy.org server. To do this, use the following procedure:
122
130
123
-
* When writing your tutorial, just include the files in your tutorial's
131
+
* When writing your tutorial, include the files in your tutorial's
124
132
directory (e.g., ``tutorials/My-tutorial-name/mydatafile.fits``). Those who
125
133
are reviewing your tutorial will have to download them, but they would need
126
134
them anyway, so it's ok. _IMPORTANT_: when you add or modify data files, make
0 commit comments