Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/actions/build-src/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,6 @@ runs:
micromamba info
micromamba list

- name: mda_deps
shell: bash -l {0}
run: |
# Install mdakit deps that depend on MDA
python -m pip install --no-deps \
waterdynamics \
pathsimanalysis \
mdahole2

- name: build_mda_main
shell: bash -l {0}
run: |
Expand Down
6 changes: 6 additions & 0 deletions .github/actions/setup-deps/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,16 @@ inputs:
# pip-install optional dependencies
duecredit:
default: 'duecredit'
mdahole2:
default: 'mdahole2'
parmed:
default: 'parmed'
pathsimanalysis:
default: 'pathsimanalysis'
pyedr:
default: 'pyedr>=0.7.0'
waterdynamics:
default: 'waterdynamics'

runs:
using: "composite"
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/gh-ci-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ jobs:
pytest \
pytest-xdist \
pytest-timeout
# deps that depend on MDA
python -m pip install --no-deps \
waterdynamics \
pathsimanalysis \
mdahole2

- name: pre_install_list_deps
run: python -m pip list
Expand Down
5 changes: 5 additions & 0 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ Enhancements


Changes
* MDANalysis.analysis.psa, MDAnalysis.analysis.waterdynamics and
Comment thread
IAlibay marked this conversation as resolved.
Outdated
MDAnalysis.analysis.hole2 are now no longer available by default in
MDAnalysis. You will need to install their respective MDAKits to
keep using them. Please note that they will be fully removed in
MDAnalysis v3.0 (Issue #4899, PR #4953).
* Changed `fasteners` dependency to `filelock` (Issue #4797, PR #4800)
* Codebase is now formatted with black (version `24`) (PR #4886)

Expand Down
29 changes: 19 additions & 10 deletions package/MDAnalysis/analysis/hole2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,23 @@

"""
import warnings
from mdahole2.analysis.hole import hole, HoleAnalysis
from mdahole2.analysis import utils, templates
from mdahole2.analysis.utils import create_vmd_surface

wmsg = (
"Deprecated in version 2.8.0\n"
"MDAnalysis.analysis.hole2 is deprecated in favour of the "
"MDAKit madahole2 (https://www.mdanalysis.org/mdahole2/) "
"and will be removed in MDAnalysis version 3.0.0"
)
warnings.warn(wmsg, category=DeprecationWarning)
try:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why these are reporting as not covered - the tests for both warnings seem to be passing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I manually tested everything locally (with and without the optional imports) so I'd say it's probably worth ignoring codecov here.

from mdahole2.analysis.hole import hole, HoleAnalysis
from mdahole2.analysis import utils, templates
from mdahole2.analysis.utils import create_vmd_surface

Check warning on line 43 in package/MDAnalysis/analysis/hole2/__init__.py

View check run for this annotation

Codecov / codecov/patch

package/MDAnalysis/analysis/hole2/__init__.py#L42-L43

Added lines #L42 - L43 were not covered by tests
except ImportError:
wmsg = (
"Please install the mdahole2 mdakit to use it in MDAnalysis.\n"
"More details can be found here: "
"https://www.mdanalysis.org/mdahole2/getting_started.html"
)
warnings.warn(wmsg, category=UserWarning)
else:
wmsg = (

Check warning on line 52 in package/MDAnalysis/analysis/hole2/__init__.py

View check run for this annotation

Codecov / codecov/patch

package/MDAnalysis/analysis/hole2/__init__.py#L52

Added line #L52 was not covered by tests
"Deprecated in version 2.8.0\n"
"MDAnalysis.analysis.hole2 is deprecated in favour of the "
"MDAKit madahole2 (https://www.mdanalysis.org/mdahole2/) "
"and will be removed in MDAnalysis version 3.0.0"
)
warnings.warn(wmsg, category=DeprecationWarning)

Check warning on line 58 in package/MDAnalysis/analysis/hole2/__init__.py

View check run for this annotation

Codecov / codecov/patch

package/MDAnalysis/analysis/hole2/__init__.py#L58

Added line #L58 was not covered by tests
57 changes: 32 additions & 25 deletions package/MDAnalysis/analysis/psa.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,35 @@

import warnings

from pathsimanalysis import (
get_path_metric_func,
sqnorm,
get_msd_matrix,
reshaper,
get_coord_axes,
hausdorff,
hausdorff_wavg,
hausdorff_avg,
hausdorff_neighbors,
discrete_frechet,
dist_mat_to_vec,
Path,
PSAPair,
PSAnalysis,
)


wmsg = (
"Deprecation in version 2.8.0:\n"
"MDAnalysis.analysis.psa is deprecated in favour of the MDAKit "
"PathSimAnalysis (https://github.com/MDAnalysis/PathSimAnalysis) "
"and will be removed in MDAnalysis version 3.0.0"
)
warnings.warn(wmsg, category=DeprecationWarning)
try:
from pathsimanalysis import (
get_path_metric_func,
sqnorm,
get_msd_matrix,
reshaper,
get_coord_axes,
hausdorff,
hausdorff_wavg,
hausdorff_avg,
hausdorff_neighbors,
discrete_frechet,
dist_mat_to_vec,
Path,
PSAPair,
PSAnalysis,
)
except ImportError:
wmsg = (
"Please install the PathSimAnalysis mdakit to use it in MDAnalysis.\n"
"More details can be found here: "
"https://www.mdanalysis.org/PathSimAnalysis/getting_started.html"
)
warnings.warn(wmsg, category=UserWarning)
else:
wmsg = (

Check warning on line 74 in package/MDAnalysis/analysis/psa.py

View check run for this annotation

Codecov / codecov/patch

package/MDAnalysis/analysis/psa.py#L74

Added line #L74 was not covered by tests
"Deprecation in version 2.8.0:\n"
"MDAnalysis.analysis.psa is deprecated in favour of the MDAKit "
"PathSimAnalysis (https://github.com/MDAnalysis/PathSimAnalysis) "
"and will be removed in MDAnalysis version 3.0.0"
)
warnings.warn(wmsg, category=DeprecationWarning)

Check warning on line 80 in package/MDAnalysis/analysis/psa.py

View check run for this annotation

Codecov / codecov/patch

package/MDAnalysis/analysis/psa.py#L80

Added line #L80 was not covered by tests
37 changes: 22 additions & 15 deletions package/MDAnalysis/analysis/waterdynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,25 @@
"""
import warnings

from waterdynamics.waterdynamics import (
WaterOrientationalRelaxation,
AngularDistribution,
MeanSquareDisplacement,
SurvivalProbability,
)


wmsg = (
"Deprecation in version 2.8.0\n"
"MDAnalysis.analysis.waterdynamics is deprecated in favour of the "
"MDAKit waterdynamics (https://www.mdanalysis.org/waterdynamics/) "
"and will be removed in MDAnalysis version 3.0.0"
)
warnings.warn(wmsg, category=DeprecationWarning)
try:
from waterdynamics.waterdynamics import (
WaterOrientationalRelaxation,
AngularDistribution,
MeanSquareDisplacement,
SurvivalProbability,
)
except ImportError:
wmsg = (
"Please install the waterdynamics mdakit to use it in MDAnalysis.\n"
"More details can be found here: "
"https://www.mdanalysis.org/waterdynamics/getting_started.html"
)
warnings.warn(wmsg, category=UserWarning)
else:
wmsg = (

Check warning on line 59 in package/MDAnalysis/analysis/waterdynamics.py

View check run for this annotation

Codecov / codecov/patch

package/MDAnalysis/analysis/waterdynamics.py#L59

Added line #L59 was not covered by tests
"Deprecation in version 2.8.0\n"
"MDAnalysis.analysis.waterdynamics is deprecated in favour of the "
"MDAKit waterdynamics (https://www.mdanalysis.org/waterdynamics/) "
"and will be removed in MDAnalysis version 3.0.0"
)
warnings.warn(wmsg, category=DeprecationWarning)

Check warning on line 65 in package/MDAnalysis/analysis/waterdynamics.py

View check run for this annotation

Codecov / codecov/patch

package/MDAnalysis/analysis/waterdynamics.py#L65

Added line #L65 was not covered by tests
6 changes: 3 additions & 3 deletions package/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ dependencies = [
'packaging',
'filelock',
'mda-xdrlib',
'waterdynamics',
'pathsimanalysis',
'mdahole2',
]
keywords = [
"python", "science", "chemistry", "biophysics", "molecular-dynamics",
Expand Down Expand Up @@ -86,6 +83,9 @@ analysis = [
"scikit-learn",
"tidynamics>=1.0.0",
'networkx>=2.0',
'waterdynamics',
'pathsimanalysis',
'mdahole2',
]
doc = [
"sphinx",
Expand Down
15 changes: 15 additions & 0 deletions testsuite/MDAnalysisTests/analysis/test_hole2.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,24 @@
import pytest

from MDAnalysis.analysis import hole2
from MDAnalysisTests.util import import_not_available


@pytest.mark.skipif(
import_not_available("mdahole2"),
reason="Test skipped because mdahole2 is not found",
)
def test_moved_to_mdakit_warning():
wmsg = "MDAnalysis.analysis.hole2 is deprecated"
with pytest.warns(DeprecationWarning, match=wmsg):
reload(hole2)


@pytest.mark.skipif(
not import_not_available("mdahole2"),
reason="Test skipped because mdahole2 is found",
)
def test_install_mdakit_warning():
wmsg = "Please install"
with pytest.warns(UserWarning, match=wmsg):
reload(hole2)
15 changes: 15 additions & 0 deletions testsuite/MDAnalysisTests/analysis/test_psa.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,24 @@
import pytest

from MDAnalysis.analysis import psa
from MDAnalysisTests.util import import_not_available


@pytest.mark.skipif(
import_not_available("pathsimanalysis"),
reason="Test skipped because PathSimAnalysis is not found",
)
def test_moved_to_mdakit_warning():
wmsg = "MDAnalysis.analysis.psa is deprecated in favour of the MDAKit"
with pytest.warns(DeprecationWarning, match=wmsg):
reload(psa)


@pytest.mark.skipif(
not import_not_available("pathsimanalysis"),
reason="Test skipped because PathSimAnalysis is found",
)
def test_install_mdakit_warning():
wmsg = "Please install"
with pytest.warns(UserWarning, match=wmsg):
reload(psa)
15 changes: 15 additions & 0 deletions testsuite/MDAnalysisTests/analysis/test_waterdynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,24 @@
import pytest

from MDAnalysis.analysis import waterdynamics
from MDAnalysisTests.util import import_not_available


@pytest.mark.skipif(
import_not_available("waterdynamics"),
reason="Test skipped because waterdynamics is not found",
)
def test_moved_to_mdakit_warning():
wmsg = "MDAnalysis.analysis.waterdynamics is deprecated"
with pytest.warns(DeprecationWarning, match=wmsg):
reload(waterdynamics)


@pytest.mark.skipif(
not import_not_available("waterdynamics"),
reason="Test skipped because waterdynamics is found",
)
def test_install_mdakit_warning():
wmsg = "Please install"
with pytest.warns(UserWarning, match=wmsg):
reload(waterdynamics)
16 changes: 11 additions & 5 deletions testsuite/MDAnalysisTests/utils/test_duecredit.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import MDAnalysis as mda
from MDAnalysis.coordinates.H5MD import HAS_H5PY
from MDAnalysisTests.datafiles import MMTF, TPR_xvf, H5MD_xvf
from MDAnalysisTests.util import import_not_available

# duecredit itself is not needed in the name space but this is a
# convenient way to skip all tests if duecredit is not installed
Expand Down Expand Up @@ -64,11 +65,6 @@ def test_duecredit_collector_primary(self, module, path, citekey):
@pytest.mark.parametrize(
"module,path,citekey",
[
(
"MDAnalysis.analysis.psa",
"pathsimanalysis.psa",
"10.1371/journal.pcbi.1004568",
),
(
"MDAnalysis.analysis.hydrogenbonds.hbond_autocorrel",
"MDAnalysis.analysis.hydrogenbonds.hbond_autocorrel",
Expand Down Expand Up @@ -101,6 +97,16 @@ def test_duecredit_collector_analysis_modules(self, module, path, citekey):
importlib.import_module(module)
assert mda.due.citations[(path, citekey)].cites_module == True

@pytest.mark.skipif(
import_not_available("pathsimanalysis"),
reason="Test skipped because PathSimAnalysis is not found",
)
def test_duecredit_psa(self):
importlib.import_module("MDAnalysis.analysis.psa")
path = "pathsimanalysis.psa"
citekey = "10.1371/journal.pcbi.1004568"
assert mda.due.citations[(path, citekey)].cites_module == True

def test_duecredit_mmtf(self):
# doesn't trigger on import but on use of either parser or reader
u = mda.Universe(MMTF)
Expand Down
Loading