Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of pytest case coverage of backend and AnalysisBase.run() using different n_workers values #4768

Merged
merged 8 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 2 additions & 0 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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 case where backend instance and AnalysisBase.run() have both different
talagayev marked this conversation as resolved.
Show resolved Hide resolved
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()`
Expand Down
12 changes: 12 additions & 0 deletions testsuite/MDAnalysisTests/analysis/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,18 @@ 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)
talagayev marked this conversation as resolved.
Show resolved Hide resolved
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),
Expand Down
Loading