Skip to content

Conversation

@dwhswenson
Copy link
Member

This moves the calculation of the number of degrees of freedom to the engine. This is expected to be a constant for an engine -- at least, the engines we have so far don't allow number of particles to change -- so it makes sense to cache it (for OpenMM), instead of calculating it over and over with the snapshot.n_degrees_of_freedom feature.

This also adds an engine.has_constraints() method. This gives a cleaner way to abort if an engine with constraints tries to use one of the DirectionModifier snapshot modifiers.

@dwhswenson dwhswenson marked this pull request as draft February 20, 2021 10:11
@dwhswenson dwhswenson changed the title [WIP] Move n_dofs to engine; add engine.has_constraints() Move n_dofs to engine; add engine.has_constraints() Feb 20, 2021
@codecov
Copy link

codecov bot commented Feb 21, 2021

Codecov Report

Merging #979 (020bf86) into master (3f2c0c4) will increase coverage by 0.36%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #979      +/-   ##
==========================================
+ Coverage   80.25%   80.61%   +0.36%     
==========================================
  Files         136      138       +2     
  Lines       14452    14695     +243     
==========================================
+ Hits        11599    11847     +248     
+ Misses       2853     2848       -5     
Impacted Files Coverage Δ
openpathsampling/engines/openmm/engine.py 68.42% <100.00%> (+1.75%) ⬆️
...gines/openmm/features/instantaneous_temperature.py 100.00% <100.00%> (ø)
openpathsampling/engines/openmm/tools.py 89.04% <100.00%> (+1.16%) ⬆️
openpathsampling/engines/toy/engine.py 96.42% <100.00%> (+0.35%) ⬆️
.../engines/toy/features/instantaneous_temperature.py 100.00% <100.00%> (ø)
openpathsampling/snapshot_modifier.py 100.00% <100.00%> (ø)
openpathsampling/pathmovers/__init__.py 100.00% <0.00%> (ø)
openpathsampling/pathmovers/move_schemes.py 100.00% <0.00%> (ø)
openpathsampling/pathmovers/spring_shooting.py 100.00% <0.00%> (ø)
openpathsampling/high_level/network.py 85.50% <0.00%> (+0.07%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f2c0c4...020bf86. Read the comment docs.

@dwhswenson dwhswenson marked this pull request as ready for review March 24, 2021 06:31
@dwhswenson
Copy link
Member Author

This is ready for review and comment. I will leave it open for at least 24 hours, merging no earlier than Thu 25 Mar 08:00 GMT (09:00 local).

Copy link
Member

@sroet sroet left a comment

Choose a reason for hiding this comment

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

One small comment about checking if the expected error is raised. Please don't hang on that, LGTM otherwise

Co-authored-by: Sander Roet <sanderroet@hotmail.com>
@dwhswenson dwhswenson merged commit 5f86032 into openpathsampling:master Mar 25, 2021
@dwhswenson dwhswenson deleted the reorg-dofs branch March 25, 2021 11:45
@dwhswenson dwhswenson mentioned this pull request Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants