Skip to content

Commit d8e57d8

Browse files
committed
Merge branch 'master'
Conflicts: doc/htmldoc/developer_space/guidelines/coding_guidelines_check.rst
2 parents 6b0c69e + a2e2287 commit d8e57d8

File tree

66 files changed

+6378
-326
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+6378
-326
lines changed

.pre-commit-config.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,14 @@ repos:
99
hooks:
1010
- id: black
1111
language_version: python3
12+
13+
- repo: https://github.com/pre-commit/mirrors-clang-format
14+
rev: v13.0.0
15+
hooks:
16+
- id: clang-format
17+
18+
- repo: https://github.com/pre-commit/pre-commit-hooks
19+
rev: v4.4.0
20+
hooks:
21+
- id: end-of-file-fixer
22+
- id: trailing-whitespace

doc/htmldoc/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
"globaltoc_collapse": True,
171171
# If True, show hidden TOC entries
172172
"globaltoc_includehidden": True,
173+
"version_dropdown": False,
173174
}
174175

175176
html_static_path = ["static"]

doc/htmldoc/developer_space/guidelines/coding_guidelines_cpp.rst

+22-53
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@ and is only left for compatibility.
180180
All files in NEST start with a preamble, which contains the filename and the
181181
NEST copyright text (see example below).
182182

183-
Lines should not exceed 120 characters (clang-format). Files should not be too
184-
long (max. 2000 lines) (vera++:L006). No trailing whitespace (clang-format).
183+
* Lines should not exceed 120 character
184+
* Files should not be too long (max. 2000 lines)
185+
* No trailing whitespace
185186

186187
Folders
187188
*******
@@ -192,7 +193,7 @@ Variables and class members
192193
***************************
193194

194195
In general, use meaningful, non-abbreviated names or follow naming conventions
195-
from the neuroscience field, e.g. the membrane potential is :hxt_ref:`V_m`. Use the
196+
from the neuroscience field, for example, the membrane potential is :hxt_ref:`V_m`. Use the
196197
``lower_case_under_lined`` notation. Private member variables should end with an
197198
underscore (``name_``). If applicable, the general rule is use is to use the
198199
same notation for biophysical quantities as is used in `Dayan&Abbot, 2001
@@ -227,8 +228,8 @@ from the neuroscience field, e.g. the membrane potential is :hxt_ref:`V_m`. Use
227228
``lower_case_under_lined`` notation.
228229

229230
There should be a line-break after the method's return type (implementation
230-
only) (clang-format). Parameters of methods should either fit into one line or
231-
each parameter is on a separate line (clang-format).
231+
only). Parameters of methods should either fit into one line or
232+
each parameter is on a separate line.
232233

233234
.. code::
234235
@@ -244,9 +245,9 @@ Namespaces
244245
**********
245246

246247
Use ``lower_case_under_lined`` notation for namespaces. Do not use ``using namespace``
247-
statements in header files (vera++:T018). The closing brace of a namespace should be
248+
statements in header files. The closing brace of a namespace should be
248249
followed by a comment containing the namespace statement.
249-
Do not indent the body of namespaces (clang-format).
250+
Do not indent the body of namespaces.
250251

251252
.. code::
252253
@@ -266,7 +267,7 @@ Use a ``struct`` only for passive objects that carry data; everything else is a
266267
underscore (``State_``).
267268

268269
The access modifier (``public``, ``protected``, ``private``) in class definitions are
269-
not indented (clang-format).
270+
not indented.
270271

271272
Do not implement methods inside the class definition, but implement small
272273
``inline`` methods after the class definition and other methods in the
@@ -276,7 +277,7 @@ Template class declarations follow the same style as normal class declarations.
276277
This applies in particular to inline declarations. The keyword template
277278
followed by the list of template parameters appear on a separate line. The <
278279
and > in template expressions have one space after and before the sign,
279-
respectively, e.g. ``std::vector< int >`` (clang-format).
280+
respectively, e.g., ``std::vector< int >``.
280281

281282
.. code::
282283
@@ -295,16 +296,15 @@ Further indentation and formatting
295296
Avoid committing indentation and formatting changes together with changes in
296297
logic. Always commit these changes separately._
297298

298-
As a general rule of thumb, always indent with two spaces (clang-format). Do
299-
not use TAB character in any source file (vera++:L002). Always use braces
300-
around blocks of code (vera++:T019). The braces of code blocks have their own
301-
line (clang-format).
299+
As a general rule of thumb, always indent with two spaces. Do
300+
not use TAB character in any source file. Always use braces
301+
around blocks of code. The braces of code blocks have their own
302+
line.
302303

303304
Control structures (``if``, ``while``, ``for``, ...) have a single space after the
304-
keyword (clang-format / vera++:T003, T008). The parenthesis around the tests
305-
have a space after the opening and before the closing parenthesis
306-
(clang-format). The case labels in ``switch`` statements are not indented
307-
(clang-format).
305+
keyword. The parenthesis around the tests
306+
have a space after the opening and before the closing parenthesis.
307+
The case labels in ``switch`` statements are not indented.
308308

309309
.. code::
310310
@@ -326,50 +326,19 @@ have a space after the opening and before the closing parenthesis
326326
}
327327
328328
Binary operators (`+`, `-`, `*`, `||`, `&`, ...) are surrounded by one space, e.g.
329-
``a + b`` (clang-format).
329+
``a + b``.
330330

331-
Unary operators have no space between operator and operand, e.g. ``-a``
332-
(clang-format). Do not use the negation operator `!` since it can easily be
333-
overseen. Instead use ``not``, e.g. ``not vec.empty()`` (vera++:T012).
331+
Unary operators have no space between operator and operand, e.g. ``-a``.
332+
Do not use the negation operator `!` since it can easily be
333+
overseen. Instead use ``not``, e.g. ``not vec.empty()``.
334334

335-
There is no space between a statement and its corresponding semicolon
336-
(clang-format):
335+
There is no space between a statement and its corresponding semicolon:
337336

338337
.. code::
339338
340339
return a + 3 ; // bad
341340
return a + 3; // good
342341
343-
Further checks performed by vera++
344-
**********************************
345-
346-
* **F001** Source files should not use the '\r' (CR) character
347-
* **F002** File names should be well-formed
348-
* **L001** No trailing whitespace (clang-format)
349-
* **L003** no leading / ending empty lines
350-
* **L005** not to many (> 2) consecutive empty lines
351-
* **T001** One-line comments should not have forced continuation ( ``// ... \``)
352-
* **T002** Reserved names should not be used for preprocessor macros
353-
* **T004** Some keywords should be immediately followed by a colon (clang-format)
354-
* **T005** Keywords break and continue should be immediately followed by a semicolon (clang-format)
355-
* **T006** Keywords return and throw should be immediately followed by a semicolon or a single space (clang-format)
356-
* **T007** Semicolons should not be isolated by spaces or comments from the rest of the code (~ clang-format)
357-
* **T010** Identifiers should not be composed of 'l' and 'O' characters only
358-
* **T017** Unnamed namespaces are not allowed in header files
359-
360-
Further transformations performed by clang-format
361-
*************************************************
362-
363-
* Align trailing comments
364-
* Always break before multi-line strings
365-
* Always break template declarations
366-
* Break constructor initializers before comma
367-
* Pointer alignment: Left
368-
* Space before assignment operators
369-
* Spaces before trailing comments: 1
370-
* Spaces in parentheses
371-
* Spaces in square brackets
372-
373342
Stopwatch example
374343
~~~~~~~~~~~~~~~~~
375344

doc/htmldoc/examples/index.rst

+11
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ PyNEST examples
5454
* :doc:`../auto_examples/pong/run_simulations`
5555
* :doc:`../auto_examples/pong/generate_gif`
5656

57+
.. grid-item-card:: Astrocytes
58+
:img-top: ../static/img/astrocyte_tripartite.png
59+
60+
* :doc:`../auto_examples/astrocyte_single`
61+
* :doc:`../auto_examples/astrocyte_tripartite`
62+
63+
5764
.. grid:: 1 1 2 3
5865

5966
.. grid-item-card:: Random balanced networks (Brunel)
@@ -76,6 +83,7 @@ PyNEST examples
7683

7784
* :doc:`../auto_examples/glif_cond_neuron`
7885
* :doc:`../auto_examples/glif_psc_neuron`
86+
* :doc:`../auto_examples/glif_psc_double_alpha_neuron`
7987

8088

8189

@@ -260,6 +268,7 @@ PyNEST examples
260268
../auto_examples/mc_neuron
261269
../auto_examples/glif_cond_neuron
262270
../auto_examples/glif_psc_neuron
271+
../auto_examples/glif_psc_double_alpha_neuron
263272
../auto_examples/precise_spiking
264273
../auto_examples/CampbellSiegert
265274
../auto_examples/vinit_example
@@ -316,6 +325,8 @@ PyNEST examples
316325
../auto_examples/csa_example
317326
../auto_examples/csa_spatial_example
318327
../auto_examples/hpc_benchmark
328+
../auto_examples/astrocyte_single
329+
../auto_examples/astrocyte_tripartite
319330

320331
.. toctree::
321332
:hidden:

doc/htmldoc/hpc/parallel_computing.rst

+16-6
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,22 @@ command for this is
188188
Usually, a good choice for `T` is the number of processor cores available
189189
on your machine.
190190

191-
.. note::
192-
193-
In some situations, `oversubscribing` (i.e., to specify a ``local_num_threads`` that is higher than available cores on your machine)
194-
can yield 20-30% improvement in simulation speed. Finding the optimal thread number for a
195-
specific situation might require a bit of experimenting.
196-
191+
In some situations, `oversubscribing` (i.e., to specify a
192+
``local_num_threads`` that is higher than available cores on your
193+
machine) can yield 20–30% improvement in simulation speed. Finding the
194+
optimal thread number for a specific situation might require a bit of
195+
experimenting.
196+
197+
.. admonition:: NEST ignores OMP_NUM_THREADS
198+
199+
NEST ignores ``OMP_NUM_THREADS`` environment
200+
variable, which may be set by mpi4py, Slurm or similar runtime
201+
environments. NEST will always start running on a single thread
202+
until the number of threads is changed by setting either the
203+
``local_num_threads`` or the ``total_num_virtual_procs``
204+
:ref:`kernel attribute<sec_kernel_attributes>`.
205+
206+
197207
Multiprocessing
198208
---------------
199209

0 commit comments

Comments
 (0)