Skip to content

Commit

Permalink
Merge branch 'MDAnalysis:develop' into frankenatom_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MattTDavies committed Sep 5, 2024
2 parents 3b9aab0 + 489905f commit 67de2d4
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 17 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
mv dist/MDAnalysisTests-* testsuite/dist
- name: upload_source_and_wheels
uses: pypa/gh-action-pypi-publish@v1.9.0
uses: pypa/gh-action-pypi-publish@v1.10.0
with:
skip_existing: true
repository_url: https://test.pypi.org/legacy/
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
mv dist/MDAnalysisTests-* testsuite/dist
- name: upload_tests
uses: pypa/gh-action-pypi-publish@v1.9.0
uses: pypa/gh-action-pypi-publish@v1.10.0
with:
packages_dir: testsuite/dist
skip_existing: true
Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:
mv dist/MDAnalysisTests-* testsuite/dist
- name: upload_source_and_wheels
uses: pypa/gh-action-pypi-publish@v1.9.0
uses: pypa/gh-action-pypi-publish@v1.10.0

upload_pypi_mdanalysistests:
if: |
Expand All @@ -227,7 +227,7 @@ jobs:
mv dist/MDAnalysisTests-* testsuite/dist
- name: upload_tests
uses: pypa/gh-action-pypi-publish@v1.9.0
uses: pypa/gh-action-pypi-publish@v1.10.0
with:
packages_dir: testsuite/dist

Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
displayName: 'pin to older NumPy (wheel test)'
condition: and(succeeded(), ne(variables['NUMPY_MIN'], ''))
- script: >-
python -m pip install
python -m pip install -vvv
biopython
"chemfiles>=0.10,<0.10.4"
duecredit
Expand All @@ -112,8 +112,8 @@ jobs:
networkx
parmed
pytng>=0.2.3
tidynamics>=1.0.0
rdkit>=2020.03.1
tidynamics>=1.0.0
displayName: 'Install additional dependencies for 64-bit tests'
condition: and(succeeded(), eq(variables['PYTHON_ARCH'], 'x64'))
- script: >-
Expand Down
3 changes: 2 additions & 1 deletion package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The rules for this file:
??/??/?? IAlibay, HeetVekariya, marinegor, lilyminium, RMeli,
ljwoods2, aditya292002, pstaerk, PicoCentauri, BFedder,
tyler.je.reddy, SampurnaM, leonwehrhan, kainszs, orionarcher,
yuxuanzhuang, PythonFZ, laksh-krishna-sharma
yuxuanzhuang, PythonFZ, laksh-krishna-sharma, orbeckst

* 2.8.0

Expand Down Expand Up @@ -55,6 +55,7 @@ Fixes
Enhancements
* Introduce parallelization API to `AnalysisBase` and to `analysis.rms.RMSD` class
(Issue #4158, PR #4304)
* explicitly mark `analysis.pca.PCA` as not parallelizable (Issue #4680)
* Improve error message for `AtomGroup.unwrap()` when bonds are not present.(Issue #4436, PR #4642)
* Add `analysis.DSSP` module for protein secondary structure assignment, based on [pydssp](https://github.com/ShintaroMinami/PyDSSP)
* Added a tqdm progress bar for `MDAnalysis.analysis.pca.PCA.transform()`
Expand Down
3 changes: 2 additions & 1 deletion package/MDAnalysis/analysis/pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class PCA(AnalysisBase):
generates the principal components of the backbone of the atomgroup and
then transforms those atomgroup coordinates by the direction of those
variances. Please refer to the :ref:`PCA-tutorial` for more detailed
instructions. When using mean selections, the first frame of the selected
instructions. When using mean selections, the first frame of the selected
trajectory slice is used as a reference.
Parameters
Expand Down Expand Up @@ -239,6 +239,7 @@ class PCA(AnalysisBase):
incorrectly handle cases where the ``frame`` argument
was passed.
"""
_analysis_algorithm_is_parallelizable = False

def __init__(self, universe, select='all', align=False, mean=None,
n_components=None, **kwargs):
Expand Down
10 changes: 2 additions & 8 deletions package/MDAnalysis/converters/RDKit.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
from io import StringIO

import numpy as np
from numpy.lib import NumpyVersion

from . import base
from ..coordinates import memory
Expand All @@ -96,13 +95,8 @@
from ..exceptions import NoDataError

try:
# TODO: remove this guard when RDKit has a release
# that supports NumPy 2
if NumpyVersion(np.__version__) < "2.0.0":
from rdkit import Chem
from rdkit.Chem import AllChem
else:
raise ImportError
from rdkit import Chem
from rdkit.Chem import AllChem
except ImportError:
pass
else:
Expand Down
21 changes: 21 additions & 0 deletions testsuite/MDAnalysisTests/analysis/test_pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import numpy as np
import MDAnalysis as mda
from MDAnalysis.analysis import align
import MDAnalysis.analysis.pca
from MDAnalysis.analysis.pca import (PCA, cosine_content,
rmsip, cumulative_overlap)

Expand Down Expand Up @@ -384,3 +385,23 @@ def test_pca_attr_warning(u, attr):
wmsg = f"The `{attr}` attribute was deprecated in MDAnalysis 2.0.0"
with pytest.warns(DeprecationWarning, match=wmsg):
getattr(pca, attr) is pca.results[attr]

@pytest.mark.parametrize(
"classname,is_parallelizable",
[
(MDAnalysis.analysis.pca.PCA, False),
]
)
def test_class_is_parallelizable(classname, is_parallelizable):
assert classname._analysis_algorithm_is_parallelizable == is_parallelizable


@pytest.mark.parametrize(
"classname,backends",
[
(MDAnalysis.analysis.pca.PCA, ('serial',)),
]
)
def test_supported_backends(classname, backends):
assert classname.get_supported_backends() == backends

2 changes: 1 addition & 1 deletion testsuite/MDAnalysisTests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def import_not_available(module_name):
# TODO: remove once these packages have a release
# with NumPy 2 support
if NumpyVersion(np.__version__) >= "2.0.0":
if module_name in {"rdkit", "parmed"}:
if module_name == "parmed":
return True
try:
test = importlib.import_module(module_name)
Expand Down

0 comments on commit 67de2d4

Please sign in to comment.