Skip to content

Commit

Permalink
Merge branch 'MDAnalysis:develop' into devel-relprop
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiahsinChu authored Jan 7, 2025
2 parents 2b4ab7a + 1eca9f2 commit f960ea7
Show file tree
Hide file tree
Showing 159 changed files with 12,472 additions and 7,438 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/gh-ci-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,11 @@ jobs:
fail-fast: false
matrix:
# Stick to macos-13 because some of our
# optional depss don't support arm64 (i.e. macos-14)
# optional deps don't support arm64 (i.e. macos-14)
#
# add "3.13" once conda-forge packages are available (see #4805)
os: [ubuntu-latest, macos-13]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -285,11 +287,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, macos-14, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
wheels: ['true', 'false']
exclude:
- os: "macos-14"
python-version: "3.9"
steps:
# Checkout to have access to local actions (i.e. setup-os)
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .pep8speaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ scanner:

pycodestyle: # Valid if scanner.linter is pycodestyle
max-line-length: 79
ignore: ["E203", "E701"]
ignore: ["E203", "E701", "W503"]
exclude: []
count: False
first: False
Expand All @@ -17,7 +17,7 @@ pycodestyle: # Valid if scanner.linter is pycodestyle

flake8: # Valid if scanner.linter is flake8
max-line-length: 79
ignore: ["E203", "E501", "E701"]
ignore: ["E203", "E501", "E701", "W503"]
exclude: []
count: False
show-source: False
Expand Down
1 change: 1 addition & 0 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Fixes
the function to prevent shared state. (Issue #4655)

Enhancements
* Addition of 'water' token for water selection (Issue #4839)
* Enables parallelization for analysis.density.DensityAnalysis (Issue #4677, PR #4729)
* Enables parallelization for analysis.contacts.Contacts (Issue #4660)
* Enable parallelization for analysis.nucleicacids.NucPairDist (Issue #4670)
Expand Down
54 changes: 27 additions & 27 deletions package/MDAnalysis/analysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@
#

__all__ = [
'align',
'backends',
'base',
'contacts',
'density',
'distances',
'diffusionmap',
'dihedrals',
'distances',
'dielectric',
'gnm',
'hbonds',
'helix_analysis',
'hole2',
'hydrogenbonds',
'leaflet',
'lineardensity',
'msd',
'nuclinfo',
'nucleicacids',
'polymer',
'pca',
'psa',
'rdf',
'results',
'rms',
'waterdynamics',
"align",
"backends",
"base",
"contacts",
"density",
"distances",
"diffusionmap",
"dihedrals",
"distances",
"dielectric",
"gnm",
"hbonds",
"helix_analysis",
"hole2",
"hydrogenbonds",
"leaflet",
"lineardensity",
"msd",
"nuclinfo",
"nucleicacids",
"polymer",
"pca",
"psa",
"rdf",
"results",
"rms",
"waterdynamics",
]
27 changes: 16 additions & 11 deletions package/MDAnalysis/analysis/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
-------
"""

import warnings
from typing import Callable
from MDAnalysis.lib.util import is_installed
Expand Down Expand Up @@ -102,8 +103,9 @@ def _get_checks(self):
checked during ``_validate()`` run
"""
return {
isinstance(self.n_workers, int) and self.n_workers > 0:
f"n_workers should be positive integer, got {self.n_workers=}",
isinstance(self.n_workers, int)
and self.n_workers
> 0: f"n_workers should be positive integer, got {self.n_workers=}",
}

def _get_warnings(self):
Expand Down Expand Up @@ -183,8 +185,8 @@ def _get_warnings(self):
checked during ``_validate()`` run
"""
return {
self.n_workers == 1:
"n_workers is ignored when executing with backend='serial'"
self.n_workers
== 1: "n_workers is ignored when executing with backend='serial'"
}

def apply(self, func: Callable, computations: list) -> list:
Expand Down Expand Up @@ -307,10 +309,12 @@ def apply(self, func: Callable, computations: list) -> list:
import dask

computations = [delayed(func)(task) for task in computations]
results = dask.compute(computations,
scheduler="processes",
chunksize=1,
num_workers=self.n_workers)[0]
results = dask.compute(
computations,
scheduler="processes",
chunksize=1,
num_workers=self.n_workers,
)[0]
return results

def _get_checks(self):
Expand All @@ -326,8 +330,9 @@ def _get_checks(self):
"""
base_checks = super()._get_checks()
checks = {
is_installed("dask"):
("module 'dask' is missing. Please install 'dask': "
"https://docs.dask.org/en/stable/install.html")
is_installed("dask"): (
"module 'dask' is missing. Please install 'dask': "
"https://docs.dask.org/en/stable/install.html"
)
}
return base_checks | checks
Loading

0 comments on commit f960ea7

Please sign in to comment.