Skip to content

Commit b710e57

Browse files
authored
[fmt] Format analysis module and tests (#4848)
1 parent 5656fe4 commit b710e57

Some content is hidden

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

80 files changed

+8817
-5258
lines changed

package/MDAnalysis/analysis/__init__.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,31 @@
2222
#
2323

2424
__all__ = [
25-
'align',
26-
'backends',
27-
'base',
28-
'contacts',
29-
'density',
30-
'distances',
31-
'diffusionmap',
32-
'dihedrals',
33-
'distances',
34-
'dielectric',
35-
'gnm',
36-
'hbonds',
37-
'helix_analysis',
38-
'hole2',
39-
'hydrogenbonds',
40-
'leaflet',
41-
'lineardensity',
42-
'msd',
43-
'nuclinfo',
44-
'nucleicacids',
45-
'polymer',
46-
'pca',
47-
'psa',
48-
'rdf',
49-
'results',
50-
'rms',
51-
'waterdynamics',
25+
"align",
26+
"backends",
27+
"base",
28+
"contacts",
29+
"density",
30+
"distances",
31+
"diffusionmap",
32+
"dihedrals",
33+
"distances",
34+
"dielectric",
35+
"gnm",
36+
"hbonds",
37+
"helix_analysis",
38+
"hole2",
39+
"hydrogenbonds",
40+
"leaflet",
41+
"lineardensity",
42+
"msd",
43+
"nuclinfo",
44+
"nucleicacids",
45+
"polymer",
46+
"pca",
47+
"psa",
48+
"rdf",
49+
"results",
50+
"rms",
51+
"waterdynamics",
5252
]

package/MDAnalysis/analysis/backends.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
-------
3636
3737
"""
38+
3839
import warnings
3940
from typing import Callable
4041
from MDAnalysis.lib.util import is_installed
@@ -102,8 +103,9 @@ def _get_checks(self):
102103
checked during ``_validate()`` run
103104
"""
104105
return {
105-
isinstance(self.n_workers, int) and self.n_workers > 0:
106-
f"n_workers should be positive integer, got {self.n_workers=}",
106+
isinstance(self.n_workers, int)
107+
and self.n_workers
108+
> 0: f"n_workers should be positive integer, got {self.n_workers=}",
107109
}
108110

109111
def _get_warnings(self):
@@ -183,8 +185,8 @@ def _get_warnings(self):
183185
checked during ``_validate()`` run
184186
"""
185187
return {
186-
self.n_workers == 1:
187-
"n_workers is ignored when executing with backend='serial'"
188+
self.n_workers
189+
== 1: "n_workers is ignored when executing with backend='serial'"
188190
}
189191

190192
def apply(self, func: Callable, computations: list) -> list:
@@ -307,10 +309,12 @@ def apply(self, func: Callable, computations: list) -> list:
307309
import dask
308310

309311
computations = [delayed(func)(task) for task in computations]
310-
results = dask.compute(computations,
311-
scheduler="processes",
312-
chunksize=1,
313-
num_workers=self.n_workers)[0]
312+
results = dask.compute(
313+
computations,
314+
scheduler="processes",
315+
chunksize=1,
316+
num_workers=self.n_workers,
317+
)[0]
314318
return results
315319

316320
def _get_checks(self):
@@ -326,8 +330,9 @@ def _get_checks(self):
326330
"""
327331
base_checks = super()._get_checks()
328332
checks = {
329-
is_installed("dask"):
330-
("module 'dask' is missing. Please install 'dask': "
331-
"https://docs.dask.org/en/stable/install.html")
333+
is_installed("dask"): (
334+
"module 'dask' is missing. Please install 'dask': "
335+
"https://docs.dask.org/en/stable/install.html"
336+
)
332337
}
333338
return base_checks | checks

0 commit comments

Comments
 (0)