-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCONTRIBUTING.html
318 lines (295 loc) · 17.4 KB
/
CONTRIBUTING.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Contributing — Scientific Python Lectures</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="_static/nature.css?v=c29d3f28" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="https://unpkg.com/[email protected]/build/base-min.css" />
<link rel="stylesheet" type="text/css" href="_static/sg_gallery.css?v=d2d258e8" />
<link rel="stylesheet" type="text/css" href="_static/sg_gallery-binder.css?v=f4aeca0c" />
<link rel="stylesheet" type="text/css" href="_static/sg_gallery-dataframe.css?v=2082cf3c" />
<link rel="stylesheet" type="text/css" href="_static/sg_gallery-rendered-html.css?v=1277b6f3" />
<script src="_static/documentation_options.js?v=5c1ee5ea"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/clipboard.min.js?v=a7894cd8"></script>
<script src="_static/copybutton.js?v=0729d509"></script>
<script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
<script src="_static/scroll_highlight_toc.js?v=cbac5d29"></script>
<link rel="icon" href="_static/favicon.ico"/>
<link rel="author" title="About these documents" href="about.html" />
<link rel="search" title="Search" href="search.html" />
<script defer data-domain="lectures.scientific-python.org" src="https://views.scientific-python.org/js/script.js"></script>
</head><body>
<!-- Use the header to add javascript -->
<script type="text/javascript">
// Function to toggle tip div
function toggle_tip_div(obj) {
$(obj).find("p.summary").remove();
var content = $(obj).text();
var html = $(obj).html();
if ($(obj).hasClass("collapsed")) {
// Expand
$(obj).html('<p class="summary"><img src="_static/minus.png"></p>' + html);
} else {
// Collapse
if(content.length > 50) {
content = content.substr(0, 47);
}
$(obj).html('<p class="summary"><img src="_static/plus.png">' + content + '...</p>' + html);
}
$(obj).toggleClass("collapsed");
}
$(document).ready(function () {
$(".tip").each(function() {
$(this).find("p.admonition-title").remove();
});
// Collapse all tips and add plus sign
$(".tip").each(function() { toggle_tip_div($(this)); });
$(".tip")
.click(function(event){
// Change state of the global button
$('div.related li.transparent').removeClass('transparent');
toggle_tip_div($(this));
if (event.target.tagName.toLowerCase() != "a") {
return true; //Makes links clickable
}
});
});
</script>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li class="nav-item nav-item-0"><a href="index.html">Scientific Python Lectures</a> »</li>
<li class="nav-item nav-item-this"><a href="">Contributing</a></li>
<!-- Insert a tip toggle in the navigation bar -->
<li class="left">
<!-- On click, expand all tips -->
<!--
<a>
<img src="_static/plus.png"
alt="Expand tips" style="padding: 1ex;"/>
<span class="hiddenlink">Collapse document to compact view</span>
</a>
-->
</li>
<li class="right edit_on_github"><a href="https://github.com/scipy-lectures/scientific-python-lectures/edit/main/CONTRIBUTING.rst">Edit
<span class="tooltip">
Improve this page:<br/>Edit it on Github.
</span>
</a>
</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="contributing">
<h1>Contributing<a class="headerlink" href="#contributing" title="Link to this heading">¶</a></h1>
<p>The Scientific Python Lectures are a community-based effort and require
constant maintenance and improvements. New contributions such as wording
improvements or inclusion of new topics are welcome.</p>
<p>To propose bugfixes or straightforward improvements to the lectures, see the
contribution guide below.</p>
<p>For new topics, read the objectives first and <a class="reference external" href="https://github.com/scipy-lectures/scientific-python-lectures/issues">open an issue on the GitHub
project</a> to
discuss it with the editors.</p>
<section id="objectives-and-design-choices-for-the-lectures">
<h2>Objectives and design choices for the lectures<a class="headerlink" href="#objectives-and-design-choices-for-the-lectures" title="Link to this heading">¶</a></h2>
<p>Contributors should keep the following objectives and design choices of
the Scientific Python Lectures in mind.</p>
<p>Objectives:</p>
<ul class="simple">
<li><p>Provide a self-contained introduction to Python and its primary computational
packages, the ”Scientific Python stack“.</p></li>
<li><p>Provide tutorials for a selection of widely-used and stable computational
libraries.
Currently, we cover pandas, statmodels, seaborn, scikit-image,
scikit-learn, and sympy.</p></li>
<li><p>Automated testing is applied to the code examples as much as possible.</p></li>
</ul>
<p>Design choices:</p>
<ul class="simple">
<li><p>Each chapter should provide a useful basis for a 1‒2 h tutorial.</p></li>
<li><p>The code should be readable.</p></li>
<li><p>An idiomatic style should be followed, e.g. <code class="docutils literal notranslate"><span class="pre">import</span> <span class="pre">numpy</span> <span class="pre">as</span> <span class="pre">np</span></code>,
preference for array operations, PEP8 coding conventions.</p></li>
</ul>
</section>
<section id="contributing-guide">
<h2>Contributing guide<a class="headerlink" href="#contributing-guide" title="Link to this heading">¶</a></h2>
<p>The directory <code class="docutils literal notranslate"><span class="pre">guide</span></code> contains instructions on how to contribute:</p>
<aside class="topic">
<p class="topic-title"><strong>Example chapter</strong></p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="guide/index.html">How to contribute</a><ul>
<li class="toctree-l2"><a class="reference internal" href="guide/index.html#id1">How to contribute ?</a></li>
<li class="toctree-l2"><a class="reference internal" href="guide/index.html#using-github">Using GitHub</a></li>
<li class="toctree-l2"><a class="reference internal" href="guide/index.html#keeping-it-concise-collapsing-paragraphs">Keeping it concise: collapsing paragraphs</a></li>
<li class="toctree-l2"><a class="reference internal" href="guide/index.html#figures-and-code-examples">Figures and code examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="guide/index.html#using-markup">Using Markup</a></li>
<li class="toctree-l2"><a class="reference internal" href="guide/index.html#linking-to-package-documentations">Linking to package documentations</a></li>
<li class="toctree-l2"><a class="reference internal" href="guide/index.html#chapter-section-subsection-paragraph">Chapter, section, subsection, paragraph</a></li>
<li class="toctree-l2"><a class="reference internal" href="guide/index.html#admonitions">Admonitions</a></li>
<li class="toctree-l2"><a class="reference internal" href="guide/index.html#clearing-floats">Clearing floats</a></li>
<li class="toctree-l2"><a class="reference internal" href="guide/index.html#references">References</a></li>
</ul>
</li>
</ul>
</div>
</aside>
</section>
<section id="building-instructions">
<h2>Building instructions<a class="headerlink" href="#building-instructions" title="Link to this heading">¶</a></h2>
<p>To generate the html output for on-screen display, Type:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">html</span>
<div class="newline"></div></pre></div>
</div>
<p>the generated html files can be found in <code class="docutils literal notranslate"><span class="pre">build/html</span></code></p>
<p>The first build takes a long time, but information is cached and
subsequent builds will be faster.</p>
<p>To generate the pdf file for printing:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">pdf</span>
<div class="newline"></div></pre></div>
</div>
<p>The pdf builder is a bit difficult and you might have some TeX errors.
Tweaking the layout in the <code class="docutils literal notranslate"><span class="pre">*.rst</span></code> files is usually enough to work
around these problems.</p>
<section id="requirements">
<h3>Requirements<a class="headerlink" href="#requirements" title="Link to this heading">¶</a></h3>
<p>Build requirements are listed in the
<a class="reference download internal" download="" href="_downloads/b4ef698db8ca845e5845c4618278f29a/requirements.txt"><code class="xref download docutils literal notranslate"><span class="pre">requirements</span> <span class="pre">file</span></code></a>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">numpy</span><span class="o">==</span><span class="mf">2.2.1</span>
<div class="newline"></div><span class="n">scipy</span><span class="o">==</span><span class="mf">1.15.1</span>
<div class="newline"></div><span class="n">matplotlib</span><span class="o">==</span><span class="mf">3.10.0</span>
<div class="newline"></div><span class="n">pandas</span><span class="o">==</span><span class="mf">2.2.3</span>
<div class="newline"></div><span class="n">patsy</span><span class="o">==</span><span class="mf">1.0.1</span>
<div class="newline"></div><span class="n">pyarrow</span><span class="o">==</span><span class="mf">18.1.0</span>
<div class="newline"></div><span class="n">scikit</span><span class="o">-</span><span class="n">learn</span><span class="o">==</span><span class="mf">1.6.1</span>
<div class="newline"></div><span class="n">scikit</span><span class="o">-</span><span class="n">image</span><span class="o">==</span><span class="mf">0.25.0</span>
<div class="newline"></div><span class="n">sympy</span><span class="o">==</span><span class="mf">1.13.3</span>
<div class="newline"></div><span class="n">statsmodels</span><span class="o">==</span><span class="mf">0.14.4</span>
<div class="newline"></div><span class="n">seaborn</span><span class="o">==</span><span class="mf">0.13.2</span>
<div class="newline"></div><span class="n">pytest</span><span class="o">>=</span><span class="mf">8.3</span>
<div class="newline"></div><span class="n">sphinx</span><span class="o">>=</span><span class="mf">8.0</span>
<div class="newline"></div><span class="n">sphinx</span><span class="o">-</span><span class="n">gallery</span><span class="o">>=</span><span class="mf">0.17</span>
<div class="newline"></div><span class="n">sphinx</span><span class="o">-</span><span class="n">copybutton</span>
<div class="newline"></div><span class="n">coverage</span><span class="o">>=</span><span class="mf">7.6</span>
<div class="newline"></div><span class="n">Pillow</span>
<div class="newline"></div><span class="n">pooch</span>
<div class="newline"></div><span class="n">ipython</span>
<div class="newline"></div><span class="n">pickleshare</span>
<div class="newline"></div><span class="n">pre</span><span class="o">-</span><span class="n">commit</span><span class="o">==</span><span class="mf">4.0.1</span>
<div class="newline"></div><span class="n">requests</span>
<div class="newline"></div><span class="n">sphinxcontrib</span><span class="o">-</span><span class="n">jquery</span>
<div class="newline"></div></pre></div>
</div>
<p>Ensure that you have a <a class="reference external" href="https://docs.python.org/3/library/venv.html">virtual environment</a> or conda environment
set up, then install requirements with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="o">-</span><span class="n">r</span> <span class="n">requirements</span><span class="o">.</span><span class="n">txt</span>
<div class="newline"></div></pre></div>
</div>
<p>Note that you will also need the following system packages:</p>
<blockquote>
<div><ul class="simple">
<li><p>Python C development headers (the <cite>python3-dev</cite> package on Debian, e.g.),</p></li>
<li><p>a C compiler like gcc,</p></li>
<li><p><a class="reference external" href="https://www.gnu.org/software/make/">GNU Make</a>,</p></li>
<li><p>a full LaTeX distribution such as <a class="reference external" href="https://www.tug.org/texlive/">TeX Live</a> (<code class="docutils literal notranslate"><span class="pre">texlive-latex-base</span></code>,
<code class="docutils literal notranslate"><span class="pre">texlive-latex-extra</span></code>, <code class="docutils literal notranslate"><span class="pre">texlive-fonts-extra</span></code>, and <code class="docutils literal notranslate"><span class="pre">latexmk</span></code>
on Debian/Ubuntu),</p></li>
<li><p><a class="reference external" href="http://savannah.nongnu.org/projects/dvipng/">dvipng</a>,</p></li>
<li><p><a class="reference external" href="https://personal.psu.edu/~jcc8/software/latexmk/">latexmk</a>,</p></li>
<li><p><a class="reference external" href="https://git-scm.com/">git</a>.</p></li>
</ul>
</div></blockquote>
</section>
<section id="updating-the-cover">
<h3>Updating the cover<a class="headerlink" href="#updating-the-cover" title="Link to this heading">¶</a></h3>
<p>Use inkscape to modify the cover in <code class="docutils literal notranslate"><span class="pre">images/</span></code>, then export to PDF:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">inkscape</span> <span class="o">--</span><span class="n">export</span><span class="o">-</span><span class="n">filename</span><span class="o">=</span><span class="n">cover</span><span class="o">-</span><span class="mf">2024.</span><span class="n">pdf</span> <span class="n">cover</span><span class="o">-</span><span class="mf">2024.</span><span class="n">svg</span>
<div class="newline"></div></pre></div>
</div>
<p>Ensure that the <code class="docutils literal notranslate"><span class="pre">images/cover.pdf</span></code> symlink points to the correct
file.</p>
<p><div style="clear: both"></div></p>
</section>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<div>
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Contributing</a><ul>
<li><a class="reference internal" href="#objectives-and-design-choices-for-the-lectures">Objectives and design choices for the lectures</a></li>
<li><a class="reference internal" href="#contributing-guide">Contributing guide</a></li>
<li><a class="reference internal" href="#building-instructions">Building instructions</a><ul>
<li><a class="reference internal" href="#requirements">Requirements</a></li>
<li><a class="reference internal" href="#updating-the-cover">Updating the cover</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/CONTRIBUTING.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li class="nav-item nav-item-0"><a href="index.html">Scientific Python Lectures</a> »</li>
<li class="nav-item nav-item-this"><a href="">Contributing</a></li>
<!-- Insert a tip toggle in the navigation bar -->
<li class="left">
<!-- On click, expand all tips -->
<!--
<a>
<img src="_static/plus.png"
alt="Expand tips" style="padding: 1ex;"/>
<span class="hiddenlink">Collapse document to compact view</span>
</a>
-->
</li>
<li class="right edit_on_github"><a href="https://github.com/scipy-lectures/scientific-python-lectures/edit/main/CONTRIBUTING.rst">Edit
<span class="tooltip">
Improve this page:<br/>Edit it on Github.
</span>
</a>
</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2025.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.
</div>
</body>
</html>