From 74b88d78019f6b00c1faebf1b7d5fcf865117f69 Mon Sep 17 00:00:00 2001 From: Valerij Talagayev <82884038+talagayev@users.noreply.github.com> Date: Sun, 27 Oct 2024 20:30:11 +0100 Subject: [PATCH 1/7] Update test_base.py Added case of backend and AnalysisBase.run() having different worker numbers --- testsuite/MDAnalysisTests/analysis/test_base.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/testsuite/MDAnalysisTests/analysis/test_base.py b/testsuite/MDAnalysisTests/analysis/test_base.py index 68b86fc9439..d0df21eff9f 100644 --- a/testsuite/MDAnalysisTests/analysis/test_base.py +++ b/testsuite/MDAnalysisTests/analysis/test_base.py @@ -121,6 +121,13 @@ def test_incompatible_n_workers(u): with pytest.raises(ValueError): FrameAnalysis(u).run(backend=backend, n_workers=3) +def test_n_workers_conflict_raises_value_error(u): + analysis = FrameAnalysis(u.trajectory) + backend_instance = ManyWorkersBackend(n_workers=4) + + with pytest.raises(ValueError, match="n_workers specified twice"): + FrameAnalysis(u.trajectory).run(backend=backend_instance, n_workers=1, unsupported_backend=True) + @pytest.mark.parametrize('run_class,backend,n_workers', [ (Parallelizable, 'not-existing-backend', 2), (Parallelizable, 'not-existing-backend', None), From 104708b02db838d592d569d3dd0fbbd103594c31 Mon Sep 17 00:00:00 2001 From: Valerij Talagayev <82884038+talagayev@users.noreply.github.com> Date: Sun, 27 Oct 2024 20:35:19 +0100 Subject: [PATCH 2/7] Update CHANGELOG Added Changelog for the pytest cover case of Backend and AnalysisBase having different n_worker values --- package/CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/CHANGELOG b/package/CHANGELOG index 892e47d3854..2483335a901 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -82,6 +82,8 @@ Enhancements (Issue #4673) * enables parallelization for analysis.dssp.dssp.DSSP (Issue #4674) * Enables parallelization for analysis.hydrogenbonds.hbond_analysis.HydrogenBondAnalysis (Issue #4664) + * Added pytest for cases where backend instance and AnalysisBase.run() have both different + n_worker values assigned (Issue #4649) * 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()` From 0ce4cf62f350f85cc02ad3770ed4ae5a8e63df29 Mon Sep 17 00:00:00 2001 From: Valerij Talagayev <82884038+talagayev@users.noreply.github.com> Date: Sun, 27 Oct 2024 20:36:05 +0100 Subject: [PATCH 3/7] Update CHANGELOG typo adjust --- package/CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/CHANGELOG b/package/CHANGELOG index 2483335a901..9e85fbde742 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -82,7 +82,7 @@ Enhancements (Issue #4673) * enables parallelization for analysis.dssp.dssp.DSSP (Issue #4674) * Enables parallelization for analysis.hydrogenbonds.hbond_analysis.HydrogenBondAnalysis (Issue #4664) - * Added pytest for cases where backend instance and AnalysisBase.run() have both different + * Added pytest for case where backend instance and AnalysisBase.run() have both different n_worker values assigned (Issue #4649) * 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) From 084346f0464514d0b00ac643f256d88feb7f8fc8 Mon Sep 17 00:00:00 2001 From: Valerij Talagayev <82884038+talagayev@users.noreply.github.com> Date: Sun, 27 Oct 2024 20:58:45 +0100 Subject: [PATCH 4/7] Update test_base.py PEP fixes --- testsuite/MDAnalysisTests/analysis/test_base.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/testsuite/MDAnalysisTests/analysis/test_base.py b/testsuite/MDAnalysisTests/analysis/test_base.py index d0df21eff9f..649bf66d095 100644 --- a/testsuite/MDAnalysisTests/analysis/test_base.py +++ b/testsuite/MDAnalysisTests/analysis/test_base.py @@ -121,12 +121,17 @@ def test_incompatible_n_workers(u): with pytest.raises(ValueError): FrameAnalysis(u).run(backend=backend, n_workers=3) + def test_n_workers_conflict_raises_value_error(u): analysis = FrameAnalysis(u.trajectory) backend_instance = ManyWorkersBackend(n_workers=4) with pytest.raises(ValueError, match="n_workers specified twice"): - FrameAnalysis(u.trajectory).run(backend=backend_instance, n_workers=1, unsupported_backend=True) + FrameAnalysis(u.trajectory).run( + backend=backend_instance, + n_workers=1, + unsupported_backend=True + ) @pytest.mark.parametrize('run_class,backend,n_workers', [ (Parallelizable, 'not-existing-backend', 2), From e09ebf6c8345070bd59dd51895d84eb5947f98e8 Mon Sep 17 00:00:00 2001 From: Valerij Talagayev <82884038+talagayev@users.noreply.github.com> Date: Sun, 27 Oct 2024 20:59:26 +0100 Subject: [PATCH 5/7] Update test_base.py PEP fix --- testsuite/MDAnalysisTests/analysis/test_base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testsuite/MDAnalysisTests/analysis/test_base.py b/testsuite/MDAnalysisTests/analysis/test_base.py index 649bf66d095..47f3bde71e9 100644 --- a/testsuite/MDAnalysisTests/analysis/test_base.py +++ b/testsuite/MDAnalysisTests/analysis/test_base.py @@ -128,8 +128,8 @@ def test_n_workers_conflict_raises_value_error(u): with pytest.raises(ValueError, match="n_workers specified twice"): FrameAnalysis(u.trajectory).run( - backend=backend_instance, - n_workers=1, + backend=backend_instance, + n_workers=1, unsupported_backend=True ) From a06606c6c88dd569e2621e26c1dde25e8d977808 Mon Sep 17 00:00:00 2001 From: Valerij Talagayev <82884038+talagayev@users.noreply.github.com> Date: Mon, 28 Oct 2024 01:50:43 +0100 Subject: [PATCH 6/7] Update test_base.py removed line due to duplication --- testsuite/MDAnalysisTests/analysis/test_base.py | 1 - 1 file changed, 1 deletion(-) diff --git a/testsuite/MDAnalysisTests/analysis/test_base.py b/testsuite/MDAnalysisTests/analysis/test_base.py index 47f3bde71e9..2969bb882f5 100644 --- a/testsuite/MDAnalysisTests/analysis/test_base.py +++ b/testsuite/MDAnalysisTests/analysis/test_base.py @@ -123,7 +123,6 @@ def test_incompatible_n_workers(u): def test_n_workers_conflict_raises_value_error(u): - analysis = FrameAnalysis(u.trajectory) backend_instance = ManyWorkersBackend(n_workers=4) with pytest.raises(ValueError, match="n_workers specified twice"): From cfcc5286bb73d7681b3f44f3fd45a56c90ca38a0 Mon Sep 17 00:00:00 2001 From: Valerij Talagayev <82884038+talagayev@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:07:57 +0100 Subject: [PATCH 7/7] Update CHANGELOG removed changelog change --- package/CHANGELOG | 2 -- 1 file changed, 2 deletions(-) diff --git a/package/CHANGELOG b/package/CHANGELOG index 9e85fbde742..892e47d3854 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -82,8 +82,6 @@ Enhancements (Issue #4673) * enables parallelization for analysis.dssp.dssp.DSSP (Issue #4674) * Enables parallelization for analysis.hydrogenbonds.hbond_analysis.HydrogenBondAnalysis (Issue #4664) - * Added pytest for case where backend instance and AnalysisBase.run() have both different - n_worker values assigned (Issue #4649) * 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()`