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: doc/source/contributing_code.rst
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -271,7 +271,8 @@ is not available for your operating system/architecture from your list.
271
271
'rdkit>=2020.03.1' \
272
272
'scikit-learn' \
273
273
'seaborn>=0.7.0' \
274
-
'tidynamics>1.0.0'
274
+
'tidynamics>1.0.0' \
275
+
'black=24'
275
276
276
277
# documentation dependencies
277
278
mamba install -c conda-forge \
@@ -334,7 +335,8 @@ dependencies, do the following:
334
335
'scipy>=1.5.0' \
335
336
'threadpoolctl' \
336
337
'tqdm>=4.43.0' \
337
-
'waterdynamics'
338
+
'waterdynamics' \
339
+
'black=24'
338
340
339
341
You can also install the following optional dependencies (note that
340
342
you will not be able to install all the optional dependencies as
@@ -450,30 +452,30 @@ Writing new code
450
452
Code formatting in Python
451
453
-------------------------
452
454
453
-
MDAnalysis is a project with a long history and many contributors; it hasn't used a consistent coding style. Since version 0.11.0, we are trying to update all the code to conform with `PEP8`_. Our strategy is to update the style every time we touch an old function and thus switch to `PEP8`_ continuously.
455
+
Since version 0.11.0, we are trying to update all the code to conform with `PEP8`_.
454
456
455
-
**Important requirements (from PEP8)**:
456
-
- keep line length to **79 characters or less**; break long lines sensibly although for readability we may allow longer lines
457
-
- indent with **spaces** and use **4 spaces per level**
457
+
**Important requirements (from PEP8):**
458
458
- naming:
459
459
460
460
- classes: `CapitalClasses` (i.e. capitalized nouns without spaces)
461
461
- methods and functions: `underscore_methods` (lower case, with underscores for spaces)
462
462
463
463
We recommend that you use a Python Integrated Development Environment (IDE) (`PyCharm`_ and others) or external tools like `flake8`_ for code linting. For integration of external tools with emacs and vim, check out `elpy`_ (emacs) and `python-mode`_ (vim).
464
464
465
-
To apply the code formatting in an automated way, you can also use code formatters. External tools include `autopep8`_ and `yapf`_. Most IDEs either have their own code formatter or will work with one of the above through plugins.
466
-
See :ref:`format-darker` for notes on maintaining code style compliance with existing tools.
465
+
MDAnalysis uses `black`_` for automated code formatting, which is bound by the `black stability policy`_. The configuration for `black`_ is provided in the `pyproject.toml` files. To format your code with `black`_, you can run the following commands:
0 commit comments