forked from nilearn/nilearn.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevelopment.html
565 lines (530 loc) · 31.3 KB
/
development.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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Nilearn: Statistical Analysis for NeuroImaging in Python — Machine learning for NeuroImaging</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/gallery.css" />
<link rel="stylesheet" type="text/css" href="_static/gallery-binder.css" />
<link rel="stylesheet" type="text/css" href="_static/gallery-dataframe.css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/copybutton.js"></script>
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="0.7.0" href="whats_new.html" />
<meta content="True" name="HandheldFriendly">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="keywords" content="nilearn, neuroimaging, python, neuroscience, machinelearning">
<script type="text/javascript">
function updateTopMenuPosition(height, width) {
if($(window).scrollTop() > height && $(window).outerWidth() > 1024) {
//begin to scroll
$('.related-wrapper').css("z-index", 1000);
$('.related-wrapper').css("position", "sticky");
$('.related-wrapper').css("top", 0);
$('.related-wrapper').css("width", width)
} else {
//lock it back into place
$('.related-wrapper').css("position", "relative");
$('.related-wrapper').css("top", 0)
}
}
$(function() {
var banner_height = $('#logo-banner').outerHeight();
var banner_width = $('#logo-banner').outerWidth();
var width = $('.related-wrapper').css("height", $('.related').outerHeight());
updateTopMenuPosition(banner_height, width);
$(window).scroll(function(event) {
updateTopMenuPosition(banner_height, width)
});
$(window).resize(function(event) {
var banner_width = $('#logo-banner').outerWidth();
var menu_height = $('.related').outerHeight();
$('.related').css("width", banner_width);
$('.related-wrapper').css("height", menu_height);
updateTopMenuPosition(banner_height, width)
})
});
</script>
<script type="text/javascript">
function updateSideBarPosition(top, offset, sections) {
var pos = $(window).scrollTop();
// Lock the table of content to a fixed position once we scroll enough
var topShift = 2 * offset;
if(pos > top + topShift + 1) {
// begin to scroll with sticky menu bar
var topShift = -topShift + 1;
if ($(window).outerWidth() < 1024) {
// compensate top menu that disappears
topShift -= offset + 1
}
$('.sphinxsidebarwrapper').css("position", "fixed");
$('.sphinxsidebarwrapper').css("top", topShift)
}
else {
//lock it back into place
$('.sphinxsidebarwrapper').css("position", "relative");
$('.sphinxsidebarwrapper').css("top",0)
}
// Highlight the current section
i = 0;
current_section = 0;
$('a.internal').removeClass('active');
for(i in sections) {
if(sections[i] > pos) {
break
}
if($('a.internal[href$="' + i + '"]').is(':visible')){
current_section = i
}
}
$('a.internal[href$="' + current_section + '"]').addClass('active');
$('a.internal[href$="' + current_section + '"]').parent().addClass('active')
}
$(function () {
// Lock the table of content to a fixed position once we scroll enough
var tocOffset = $('.related-wrapper').outerHeight();
var marginTop = parseFloat($('.sphinxsidebarwrapper').css('margin-top').replace(/auto/, 0));
var top = $('.sphinxsidebarwrapper').offset().top - marginTop;
sections = {};
url = document.URL.replace(/#.*$/, "");
// Grab positions of our sections
$('.headerlink').each(function(){
sections[this.href.replace(url, '')] = $(this).offset().top - 50
});
updateSideBarPosition(top, tocOffset, sections);
$(window).scroll(function(event) {
updateSideBarPosition(top, tocOffset, sections)
});
$(window).resize(function(event) {
tocOffset = $('.related-wrapper').outerHeight();
updateSideBarPosition(top, tocOffset, sections)
});
});
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-41920728-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head><body>
<div id="logo-banner">
<div class="logo">
<a href="index.html">
<img src="_static/nilearn-logo.png" alt="Nilearn logo" border="0" />
</a>
</div>
<!-- A tag cloud to make it easy for people to find what they are
looking for -->
<div class="tags">
<ul>
<li>
<big><a href="auto_examples/decoding/plot_haxby_anova_svm.html">SVM</a></big>
</li>
<li>
<small><a href="connectivity/parcellating.html">Ward
clustering</a></small>
</li>
<li>
<a href="decoding/searchlight.html">Searchlight</a>
</li>
<li>
<big><a href="connectivity/resting_state_networks.html">ICA</a></big>
</li>
<li>
<a href="manipulating_images/data_preparation.html">Nifti IO</a>
</li>
<li>
<a href="modules/reference.html#module-nilearn.datasets">Datasets</a>
</li>
</ul>
</div>
<div class="banner">
<h1>Nilearn:</h1>
<h2>Statistics for NeuroImaging in Python</h2>
</div>
<div class="search_form">
<div class="gcse-search" id="cse" style="width: 100%;"></div>
<script>
(function() {
var cx = '017289614950330089114:elrt9qoutrq';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
</div>
</div>
<div class=related-wrapper>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="py-modindex.html" title="Python Module Index"
>modules</a></li>
<li class="right" >
<a href="whats_new.html" title="0.7.0"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Nilearn Home</a> | </li>
<li><a href="user_guide.html">User Guide</a> | </li>
<li><a href="auto_examples/index.html">Examples</a> | </li>
<li><a href="modules/reference.html">Reference</a> | </li>
<li id="navbar-about"><a href="authors.html">About</a>| </li>
<li id="navbar-ecosystem"><a href="http://www.nipy.org/">Nipy ecosystem</a></li>
</ul>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="nilearn-development-process">
<h1>Nilearn development process<a class="headerlink" href="#nilearn-development-process" title="Permalink to this headline">¶</a></h1>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#how-to-help" id="id1">How to help?</a></li>
<li><a class="reference internal" href="#how-do-we-decide-what-codes-goes-in" id="id2">How do we decide what codes goes in?</a><ul>
<li><a class="reference internal" href="#scope-of-the-project" id="id3">Scope of the project</a></li>
<li><a class="reference internal" href="#how-to-contribute-a-feature" id="id4">How to contribute a feature</a></li>
<li><a class="reference internal" href="#who-makes-decisions" id="id5">Who makes decisions</a></li>
</ul>
</li>
<li><a class="reference internal" href="#how-to-contribute-to-nilearn" id="id6">How to contribute to nilearn</a><ul>
<li><a class="reference internal" href="#opening-an-issue" id="id7">Opening an issue</a></li>
<li><a class="reference internal" href="#pull-requests" id="id8">Pull Requests</a></li>
<li><a class="reference internal" href="#retrieving-the-latest-code" id="id9">Retrieving the latest code</a></li>
<li><a class="reference internal" href="#installing-the-latest-code" id="id10">Installing the latest code</a></li>
<li><a class="reference internal" href="#coding-guidelines" id="id11">Coding guidelines</a></li>
<li><a class="reference internal" href="#contributing-to-the-documentation" id="id12">Contributing to the documentation</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="how-to-help">
<h2><a class="toc-backref" href="#id1">How to help?</a><a class="headerlink" href="#how-to-help" title="Permalink to this headline">¶</a></h2>
<ul>
<li><p class="first">You are new to python and you don’t know how to do xy</p>
<blockquote>
<div><ul class="simple">
<li>Create a question on <a class="reference external" href="https://neurostars.org/">neurostars</a></li>
</ul>
</div></blockquote>
</li>
<li><p class="first">If you discovered a bug, but don’t know how to fix it</p>
<blockquote>
<div><ul class="simple">
<li>Create <a class="reference external" href="https://github.com/nilearn/nilearn/issues">an issue</a></li>
</ul>
</div></blockquote>
</li>
<li><p class="first">If you discovered a bug and know how to fix it, but don’t know how to
get your code onto github (ie, you have some Python experience but have
never have used git/github, or have never written tests)</p>
<blockquote>
<div><ul class="simple">
<li>Learn git and github: <a class="reference external" href="http://try.github.io/">http://try.github.io/</a></li>
<li>Learn what tests are how to run them locally
(<a class="reference external" href="https://docs.pytest.org">https://docs.pytest.org</a>)</li>
<li>Learn how to write doc/examples and build them locally
<a class="reference external" href="https://sphinx-gallery.github.io/">https://sphinx-gallery.github.io/</a></li>
</ul>
</div></blockquote>
</li>
<li><p class="first">You want to contribute code</p>
<blockquote>
<div><ul class="simple">
<li>See below</li>
</ul>
</div></blockquote>
</li>
</ul>
</div>
<div class="section" id="how-do-we-decide-what-codes-goes-in">
<h2><a class="toc-backref" href="#id2">How do we decide what codes goes in?</a><a class="headerlink" href="#how-do-we-decide-what-codes-goes-in" title="Permalink to this headline">¶</a></h2>
<div class="section" id="scope-of-the-project">
<h3><a class="toc-backref" href="#id3">Scope of the project</a><a class="headerlink" href="#scope-of-the-project" title="Permalink to this headline">¶</a></h3>
<p>Nilearn strives to develop open and powerful statistical analysis of
brain volumes (as produced by multiple modalities: MRI, PET, and others).
Its focus is to reach end users of the methods (as opposed to methods
developers).</p>
<p>Nilearn targets ease of use, but as Python code. In other words, we will
not add graphical user interfaces, but we want our code to be as easy to
understand as possible, with easy prototyping and debugging, even for
beginners in Python.</p>
<p>We are parsimonious in the way we add features to the project, as it
puts on weight. Criteria include:</p>
<ul class="simple">
<li>It must be in the scope of the project</li>
<li>It must correspond to an established practice (typically as used in
scientific publications)</li>
<li>It must have a concrete use case that can be demo-ed simply with nilearn:
an example, on real data, understandable by end-users.</li>
</ul>
<p>Part of the decision will also be about weighing the benefits (i.e., new
features or ease of use for the users) with the cost (i.e., complexity of
the code, runtime of the examples).</p>
<p>In practice:</p>
<ul class="simple">
<li>The new feature must be demoed in an example in a way that shows its
benefit to new users.</li>
<li>Because our infrastructure is limited, running all the examples must
lead to downloading a limited amount of data (gigabytes) and execute
in a reasonable amount of time (a few hours)</li>
<li>The new feature must be thoroughly tested (it should not decrease
code coverage)</li>
<li>The new feature may not introduce a new dependency</li>
</ul>
<p>Special cases:</p>
<ul class="simple">
<li>A downloader for a new atlas: we are currently being very lenient for this:
if the atlas is published and can be used in an example, we will accept
the pull request (but see below for specifics).</li>
<li>A downloader for a new dataset: the larger the dataset is, the less
likely we are to consider including it. Datasets are meant to demo and
teach features, rather than be the basis of research.</li>
</ul>
</div>
<div class="section" id="how-to-contribute-a-feature">
<h3><a class="toc-backref" href="#id4">How to contribute a feature</a><a class="headerlink" href="#how-to-contribute-a-feature" title="Permalink to this headline">¶</a></h3>
<p>To contribute a feature, first create an issue, in order to discuss
whether the feature can be included or not, and the specifications of
this feature. Once agreed on the feature, send us a pull request.</p>
<p>There are specific guidelines about how to write code for the project.
They can be found in the contributors guide, below.</p>
<div class="section" id="special-case-how-to-contribute-a-dataset-fetcher">
<h4>Special case: How to contribute a dataset fetcher<a class="headerlink" href="#special-case-how-to-contribute-a-dataset-fetcher" title="Permalink to this headline">¶</a></h4>
<p>The <code class="docutils literal notranslate"><span class="pre">nilearn.datasets</span></code> package provides functions to download some
neuroimaging datasets, such as <code class="docutils literal notranslate"><span class="pre">fetch_haxby</span></code> or
<code class="docutils literal notranslate"><span class="pre">fetch_atlas_harvard_oxford</span></code>. The goal is not to provide a comprehensive
collection of downloaders for the most widely used datasets, and this would be
outside the scope of this project. Rather, this package downloads data that is
required to showcase nilearn features in the example gallery.</p>
<p>Downloading data takes time and large datasets slow down the build of the
example gallery. Moreover, downloads can fail for reasons we do not control,
such as a web service that is temporarily unavailable. This is frustrating for
users and a major issue for continuous integration (new code cannot be merged
unless the examples run successfully on the CI infrastructure). Finally,
datasets or the APIs that provide them sometimes change, in which case the
downloader needs to be adapted.</p>
<p>As for any contributed feature, before starting working on a new downloader,
we recommend opening an issue to discuss whether it is necessary or if existing
downloaders could be used instead.</p>
<p>To add a new fetcher, <code class="docutils literal notranslate"><span class="pre">nilearn.datasets.utils</span></code> provides some helper functions,
such as <code class="docutils literal notranslate"><span class="pre">get_dataset_dir</span></code> to find a directory where the dataset is or will be
stored according to the user’s configuration, or <code class="docutils literal notranslate"><span class="pre">_fetch_files</span></code> to load files
from the disk or download them if they are missing.</p>
<p>The new fetcher, as any other function, also needs to be tested (in the relevant
submodule of <code class="docutils literal notranslate"><span class="pre">nilearn.datasets.tests</span></code>). When the tests run, the fetcher does
not have access to the network and will not actually download files. This is to
avoid spurious failures due to unavailable network or servers, and to avoid
slowing down the tests with long downloads.
The functions from the standard library and the <code class="docutils literal notranslate"><span class="pre">requests</span></code> library that
nilearn uses to download files are mocked: they are replaced with dummy
functions that return fake data.</p>
<p>Exactly what fake data is returned can be configured through the object
returned by the <code class="docutils literal notranslate"><span class="pre">request_mocker</span></code> pytest fixture, defined in
<code class="docutils literal notranslate"><span class="pre">nilearn.datasets._testing</span></code>. The docstrings of this module and the <code class="docutils literal notranslate"><span class="pre">Sender</span></code>
class it contains provide information on how to write a test using this fixture.
Existing tests can also serve as examples.</p>
</div>
<div class="section" id="special-case-how-to-contribute-an-atlas">
<h4>Special case: How to contribute an atlas<a class="headerlink" href="#special-case-how-to-contribute-an-atlas" title="Permalink to this headline">¶</a></h4>
<p>We want atlases in nilearn to be internally consistent. Specifically,
your atlas object should have three attributes (as with the existing
atlases):</p>
<ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">description</span></code> (bytes): A text description of the atlas. This should be
brief but thorough, describing the source (paper), relevant information
related to its construction (modality, dataset, method), and if there are
more than one maps, a description of each map.</li>
<li><code class="docutils literal notranslate"><span class="pre">labels</span></code> (list): a list of string labels corresponding to each atlas
label, in the same (numerical) order as the atlas labels</li>
<li><code class="docutils literal notranslate"><span class="pre">maps</span></code> (list or string): the path to the nifti image, or a list of paths</li>
</ul>
<p>In addition, the atlas will need to be called by a fetcher. For example, see <a class="reference external" href="https://github.com/nilearn/nilearn/blob/master/nilearn/datasets/atlas.py">here</a>.</p>
<p>Finally, as with other features, please provide a test for your atlas.
Examples can be found <a class="reference external" href="https://github.com/nilearn/nilearn/blob/master/nilearn/datasets/tests/test_atlas.py">here</a></p>
</div>
</div>
<div class="section" id="who-makes-decisions">
<h3><a class="toc-backref" href="#id5">Who makes decisions</a><a class="headerlink" href="#who-makes-decisions" title="Permalink to this headline">¶</a></h3>
<p>We strongly aim to be a community oriented project where decisions are
made based on consensus according to the criteria described above.
Decisions are made public, through discussion on issues and pull requests
in Github.</p>
<p>The decisions are made by the core-contributors, ie people with write
access to the repository, as listed <a class="reference internal" href="authors.html#core-devs"><span class="std std-ref">here</span></a></p>
<p>If there are open questions, final decisions are made by the Temporary
Benevolent Dictator, currently Gaël Varoquaux.</p>
</div>
</div>
<div class="section" id="how-to-contribute-to-nilearn">
<span id="contributing"></span><h2><a class="toc-backref" href="#id6">How to contribute to nilearn</a><a class="headerlink" href="#how-to-contribute-to-nilearn" title="Permalink to this headline">¶</a></h2>
<p>This project is a community effort, and everyone is welcome to
contribute.</p>
<p>The project is hosted on <a class="reference external" href="https://github.com/nilearn/nilearn">https://github.com/nilearn/nilearn</a></p>
<p>The best way to contribute and to help the project is to start working on known
issues.
See <a class="reference external" href="https://github.com/nilearn/nilearn/labels/Good%20first%20issue">Good first issues</a> to get
started.</p>
<p>If an issue does not already exist for a potential contribution, we ask that
you first open an <a class="reference external" href="https://github.com/nilearn/nilearn/issues">issue</a> before
sending a <a class="reference internal" href="#pull-request"><span class="std std-ref">Pull Requests</span></a>.</p>
<div class="section" id="opening-an-issue">
<h3><a class="toc-backref" href="#id7">Opening an issue</a><a class="headerlink" href="#opening-an-issue" title="Permalink to this headline">¶</a></h3>
<p>Nilearn uses issues for tracking bugs, requesting potential features, and
holding project discussions.</p>
<p>Core developers can assign labels on issues, such as:</p>
<ul class="simple">
<li><img alt="Discussion" src="https://img.shields.io/badge/-Discussion-bfe5bf.svg" /> These issues discuss ongoing discussions on the project where community feedback is requested.</li>
<li><img alt="Enhancement" src="https://img.shields.io/badge/-Enhancement-fbca04.svg" /> These issues discuss potential enhancements or additions to the project.</li>
<li><img alt="Bug" src="https://img.shields.io/badge/-Bug-fc2929.svg" /> These issues detail known bugs in the Nilearn code base.</li>
</ul>
</div>
<div class="section" id="pull-requests">
<span id="pull-request"></span><h3><a class="toc-backref" href="#id8">Pull Requests</a><a class="headerlink" href="#pull-requests" title="Permalink to this headline">¶</a></h3>
<p>We welcome pull requests from all community members.
We follow the same conventions as scikit-learn. You can find the recommended process to submit code in the
<a class="reference external" href="https://scikit-learn.org/stable/developers/contributing.html#contributing-code">scikit-learn guide to contributing code</a>.</p>
</div>
<div class="section" id="retrieving-the-latest-code">
<span id="git-repo"></span><h3><a class="toc-backref" href="#id9">Retrieving the latest code</a><a class="headerlink" href="#retrieving-the-latest-code" title="Permalink to this headline">¶</a></h3>
<p>We use <a class="reference external" href="http://git-scm.com/">Git</a> for version control and
<a class="reference external" href="https://github.com/">GitHub</a> for hosting our main repository. If you are
new on GitHub and don’t know how to work with it, please first
have a look at <a class="reference external" href="https://try.github.io/">this</a> to get the basics.</p>
<p>You can check out the latest sources with the command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="n">git</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">nilearn</span><span class="o">/</span><span class="n">nilearn</span><span class="o">.</span><span class="n">git</span>
</pre></div>
</div>
<p>or if you have write privileges:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="n">git</span><span class="nd">@github</span><span class="o">.</span><span class="n">com</span><span class="p">:</span><span class="n">nilearn</span><span class="o">/</span><span class="n">nilearn</span><span class="o">.</span><span class="n">git</span>
</pre></div>
</div>
</div>
<div class="section" id="installing-the-latest-code">
<h3><a class="toc-backref" href="#id10">Installing the latest code</a><a class="headerlink" href="#installing-the-latest-code" title="Permalink to this headline">¶</a></h3>
<p>In order to ensure that any code changes are reflected in your installation, navigate to your cloned Nilearn base directory and install using the following command:</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">e</span> <span class="o">.</span>
</pre></div>
</div>
</div>
<div class="section" id="coding-guidelines">
<h3><a class="toc-backref" href="#id11">Coding guidelines</a><a class="headerlink" href="#coding-guidelines" title="Permalink to this headline">¶</a></h3>
<p>Nilearn follows the coding conventions used by scikit-learn. <a class="reference external" href="http://scikit-learn.org/stable/developers/contributing.html#coding-guidelines">Please read them</a>
before you start implementing your changes.</p>
</div>
<div class="section" id="contributing-to-the-documentation">
<h3><a class="toc-backref" href="#id12">Contributing to the documentation</a><a class="headerlink" href="#contributing-to-the-documentation" title="Permalink to this headline">¶</a></h3>
<p>To build our documentation, we are using <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/quickstart.html">sphinx</a> for the main documentation and <a class="reference external" href="https://sphinx-gallery.github.io/stable/index.html">sphinx-gallery</a> for the example tutorials.
If you want to make changes to the example tutorials, please do the following :</p>
<ol class="arabic">
<li><p class="first">First, ensure that you have installed sphinx and sphinx-gallery. You can install the requirements using <code class="docutils literal notranslate"><span class="pre">nilearn/requirements-build-docs.txt</span></code>.</p>
</li>
<li><p class="first">Fork the Nilearn repository and clone your fork.</p>
</li>
<li><p class="first">Then go to <code class="docutils literal notranslate"><span class="pre">nilearn/examples</span></code></p>
</li>
<li><p class="first">Make your changes using <a class="reference external" href="https://www.sphinx-doc.org/en/2.0/usage/restructuredtext/basics.html">reStructuredText files</a></p>
</li>
<li><p class="first">You can now go to <cite>nilearn/doc</cite> and build the examples locally:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">html</span><span class="o">-</span><span class="n">strict</span>
</pre></div>
</div>
<p>or, if you do not have make install (for instance under Windows):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python3</span> <span class="o">-</span><span class="n">m</span> <span class="n">sphinx</span> <span class="o">-</span><span class="n">b</span> <span class="n">html</span> <span class="o">-</span><span class="n">d</span> <span class="n">_build</span><span class="o">/</span><span class="n">doctrees</span> <span class="o">.</span> <span class="n">_build</span><span class="o">/</span><span class="n">html</span>
</pre></div>
</div>
</li>
<li><p class="first">Visually review the output in <code class="docutils literal notranslate"><span class="pre">nilearn/doc/_build/html/auto_examples/</span></code>. If all looks well and there were no errors, commit and push the changes.</p>
</li>
<li><p class="first">You can now open a Pull Request from Nilearn’s Pull Request page.</p>
</li>
</ol>
<p>For more details about the Fork Clone Push worksflow, read here <<a class="reference external" href="https://guides.github.com/activities/forking/">https://guides.github.com/activities/forking/</a>>_</p>
<p>TIPS : To reduce building time, we suggest you to use the <code class="docutils literal notranslate"><span class="pre">filename_pattern</span></code> to build just one specific file:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python3</span> <span class="o">-</span><span class="n">m</span> <span class="n">sphinx</span> <span class="o">-</span><span class="n">D</span> <span class="n">sphinx_gallery_conf</span><span class="o">.</span><span class="n">filename_pattern</span><span class="o">=</span><span class="n">plot_decoding_tutorial</span><span class="o">.</span><span class="n">py</span> <span class="o">-</span><span class="n">b</span> <span class="n">html</span> <span class="o">-</span><span class="n">d</span> <span class="n">_build</span><span class="o">/</span><span class="n">doctrees</span> <span class="o">.</span> <span class="n">_build</span><span class="o">/</span><span class="n">html</span>
</pre></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4> Giving credit </h4>
<ul class="simple">
<li><p>Please consider <a href="authors.html#citing">citing the
papers</a>.</p></li>
</ul>
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Nilearn development process</a><ul>
<li><a class="reference internal" href="#how-to-help">How to help?</a></li>
<li><a class="reference internal" href="#how-do-we-decide-what-codes-goes-in">How do we decide what codes goes in?</a><ul>
<li><a class="reference internal" href="#scope-of-the-project">Scope of the project</a></li>
<li><a class="reference internal" href="#how-to-contribute-a-feature">How to contribute a feature</a><ul>
<li><a class="reference internal" href="#special-case-how-to-contribute-a-dataset-fetcher">Special case: How to contribute a dataset fetcher</a></li>
<li><a class="reference internal" href="#special-case-how-to-contribute-an-atlas">Special case: How to contribute an atlas</a></li>
</ul>
</li>
<li><a class="reference internal" href="#who-makes-decisions">Who makes decisions</a></li>
</ul>
</li>
<li><a class="reference internal" href="#how-to-contribute-to-nilearn">How to contribute to nilearn</a><ul>
<li><a class="reference internal" href="#opening-an-issue">Opening an issue</a></li>
<li><a class="reference internal" href="#pull-requests">Pull Requests</a></li>
<li><a class="reference internal" href="#retrieving-the-latest-code">Retrieving the latest code</a></li>
<li><a class="reference internal" href="#installing-the-latest-code">Installing the latest code</a></li>
<li><a class="reference internal" href="#coding-guidelines">Coding guidelines</a></li>
<li><a class="reference internal" href="#contributing-to-the-documentation">Contributing to the documentation</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="whats_new.html"
title="previous chapter">0.7.0</a></p>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
© The nilearn developers 2010-2020.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.8.5.
<span style="padding-left: 5ex;">
<a href="_sources/development.rst.txt"
rel="nofollow">Show this page source</a>
</span>
</div>
</body>
</html>