Skip to content

Commit 979c654

Browse files
committed
add style guidelines to contributing guide
1 parent 3982f8c commit 979c654

1 file changed

Lines changed: 82 additions & 2 deletions

File tree

CONTRIBUTING.md

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ your change proposal as promptly as we can, and help you become a member of our
1414
community. Everyone involved in [The Carpentries][cp-site] agrees to abide by
1515
our [code of conduct](CODE_OF_CONDUCT.md).
1616

17+
### Who Should Contribute?
18+
19+
Contributions to this curriculum are welcome from anyone with an interest in the project.
20+
1721
### How to Contribute
1822

1923
The easiest way to get started is to file an issue to tell us about a spelling
@@ -43,7 +47,7 @@ documentation][template-doc].
4347
to [The Workbench documentation][template-doc].
4448

4549

46-
### What to Contribute
50+
### What to Contribute (General)
4751

4852
There are many ways to contribute, from writing new exercises and improving
4953
existing ones to updating or filling in the documentation and submitting [bug
@@ -58,7 +62,58 @@ are particularly valuable**: it's easy for people who have been using these
5862
lessons for a while to forget how impenetrable some of this material can be, so
5963
fresh eyes are always welcome.
6064

61-
### What *Not* to Contribute
65+
### What to Contribute (This Lesson)
66+
67+
Any contributions are welcome, particularly ideas for how the existing content could be
68+
improved or updated, and/or errors that need to be corrected. Comments on existing issues
69+
and reviews of pull requests are similarly welcome.
70+
71+
If you plan to submit a pull request, please open an issue
72+
(or comment on an existing thread) first to ensure that effort is not duplicated
73+
or spent making a change that will not be accepted by the Maintainers.
74+
75+
#### Style / content guidelines
76+
- If you add an image / figure that was generated from python code, please include this code in your PR under `episodes/fig/source`.
77+
78+
- Use the terms in the table below, when referring to python libraries within the lesson. The table gives two terms
79+
for each library: `Term for descriptive text` which should be used when discussing the library in plain English /
80+
full sentences and `Term for code` which should be used when referring to code (and within code).
81+
82+
| Python library | Term for descriptive text | Term for code |
83+
| :------------- | :------------- | :------------- |
84+
| [scikit-image](https://scikit-image.org/) | scikit-image | `skimage` |
85+
| [NumPy](https://numpy.org/) | NumPy | `numpy` |
86+
| [Matplotlib](https://matplotlib.org/) | Matplotlib | `matplotlib` |
87+
| [imageio](https://imageio.readthedocs.io/en/stable/index.html) | imageio | `imageio` |
88+
89+
90+
- When importing scikit-image use:
91+
```python
92+
import skimage as ski
93+
```
94+
If you need a specific sub-module, reference this explicitly based on `ski`. For example:
95+
96+
```python
97+
import skimage as ski
98+
rr, cc = ski.draw.rectangle(start=(357, 44), end=(740, 720))
99+
```
100+
101+
- For reading and writing images use the [imageio](https://imageio.readthedocs.io/en/stable/index.html) library, and avoid use of `skimage.io`. For example:
102+
```python
103+
import imageio.v3 as iio
104+
chair = iio.imread(uri="data/chair.jpg") # read an image
105+
iio.imwrite(uri="data/chair.tif", image=chair) # write an image
106+
```
107+
108+
- Comments providing an overall description of a code snippet, should use triple quotes `"""` e.g.
109+
```python
110+
"""Python script to load a colour image in grayscale"""
111+
112+
chair = iio.imread(uri="data/chair.jpg")
113+
gray_chair = skimage.color.rgb2gray(chair)
114+
```
115+
116+
### What *Not* to Contribute (General)
62117

63118
Our lessons already contain more material than we can cover in a typical
64119
workshop, so we are usually *not* looking for more concepts or tools to add to
@@ -72,6 +127,22 @@ platform. Our workshops typically contain a mixture of Windows, macOS, and
72127
Linux users; in order to be usable, our lessons must run equally well on all
73128
three.
74129

130+
### What *Not* to Contribute (This Lesson)
131+
132+
Although most contributions will be welcome at this stage of the curriculum's development,
133+
the time available to deliver the content in a training event is strictly limited
134+
and needs to be accounted for when considering the addition of any new content.
135+
If you want to suggest the addition of new content, especially whole new sections or episodes,
136+
please open an issue to discuss this with the Maintainers first and provide the following information alongside a summary of the content to be added:
137+
138+
1. A suggested location for the new content.
139+
2. An estimate of how much time you estimate the new content would require in training
140+
(teaching + exercises).
141+
3. The [learning objective(s)][cldt-lo] of this new content.
142+
4. (optional, but strongly preferred)
143+
A suggestion of which of the currently-used learning objectives could be
144+
removed from the curriculum to make space for the new content.
145+
75146
### Using GitHub
76147

77148
If you choose to contribute via GitHub, you may want to look at [How to
@@ -92,6 +163,14 @@ Each lesson has a team of maintainers who review issues and pull requests or
92163
encourage others to do so. The maintainers are community volunteers, and have
93164
final say over what gets merged into the lesson.
94165

166+
#### Merging Policy
167+
168+
Pull requests made to the default branch of this repository
169+
(from which the lesson site is built)
170+
can only be merged after at least one approving review from a Maintainer.
171+
Any Maintainer can merge a pull request that has received at least one approval,
172+
but they may prefer to wait for further input from others before merging.
173+
95174
### Other Resources
96175

97176
The Carpentries is a global organisation with volunteers and learners all over
@@ -102,6 +181,7 @@ media, slack, newsletters, and email lists. You can also [reach us by
102181
email][contact].
103182

104183
[repo]: https://github.com/datacarpentry/image-processing
184+
[cldt-lo]: https://carpentries.github.io/lesson-development-training/05-objectives.html#learning-objectives
105185
[contact]: mailto:team@carpentries.org
106186
[cp-site]: https://carpentries.org/
107187
[dc-issues]: https://github.com/issues?q=user%3Adatacarpentry

0 commit comments

Comments
 (0)