Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
bbe0f85
starting on the wizard rewrite
dwhswenson Jul 24, 2021
3cafb36
Merge branch 'main' into wizard-rewrite
dwhswenson Sep 27, 2021
f1df73f
Wizard rewrite for engines
dwhswenson Sep 30, 2021
ac15c65
clean up engines; rewrite cvs
dwhswenson Oct 2, 2021
3c45137
clean up CVs
dwhswenson Oct 2, 2021
4453c3a
Wizard works again!
dwhswenson Oct 6, 2021
c357976
passing tests for most of CVs and half volumes
dwhswenson Oct 6, 2021
1be9867
only 3 failing tests now
dwhswenson Oct 7, 2021
abdbead
fix most tests
dwhswenson Oct 7, 2021
59b5770
tests pass locally
dwhswenson Oct 7, 2021
1bf6a89
Add missing files; make more args kwarg-only
dwhswenson Oct 7, 2021
37323f3
Merge branch 'main' of github.com:openpathsampling/openpathsampling-c…
dwhswenson Oct 8, 2021
366dc73
Merge branch 'main' of github.com:openpathsampling/openpathsampling-c…
dwhswenson Oct 8, 2021
425f925
tests for wizard/helper.py
dwhswenson Oct 9, 2021
3660805
some tests & docstrings
dwhswenson Oct 21, 2021
bba408f
Rename plugins => plugin_registration
dwhswenson Oct 21, 2021
6cfc536
Start plugin_classes with LoadFromOPS
dwhswenson Oct 21, 2021
47c744a
move wizard object plugins into plugin_classes
dwhswenson Oct 21, 2021
36c887d
move WrapCategory to plugin_classes
dwhswenson Oct 22, 2021
f02a367
tests for wizard.parameters,standard_categories
dwhswenson Oct 22, 2021
7e6b55e
add test_parameters.py
dwhswenson Oct 22, 2021
0bc8270
unittest.mock
dwhswenson Oct 22, 2021
8290154
tests for plugin_registration
dwhswenson Oct 22, 2021
bf38703
refactor get_text_from_context
dwhswenson Oct 23, 2021
0d706e6
start to tests for plugin_classes
dwhswenson Oct 23, 2021
0f0e0e0
Tests for object plugin classes
dwhswenson Oct 25, 2021
0a7b981
tests for WrapCategory
dwhswenson Oct 25, 2021
64572a7
finish plugin classes tests
dwhswenson Oct 25, 2021
93e5f9e
missing wizard tests
dwhswenson Oct 25, 2021
934040a
looks like all tests pass with full coverage
dwhswenson Oct 25, 2021
a88a677
some docstrings
dwhswenson Oct 26, 2021
b898478
docstrings
dwhswenson Oct 26, 2021
f8d0db4
add EvalHelperFunc, help for CVs, lambda_min/max
dwhswenson Oct 26, 2021
d7ec33d
fix use of LoadFromOPSFile
dwhswenson Oct 26, 2021
448088e
tests for EvalHelperFunc
dwhswenson Oct 26, 2021
7649c93
Apply suggestions from code review
dwhswenson Oct 27, 2021
9129def
import mock_wizard from mock_wizard
dwhswenson Oct 27, 2021
1474c8d
add debug logging to plugin registration
dwhswenson Oct 27, 2021
da5acdc
Error on duplicate WizardObjectPlugins
dwhswenson Oct 27, 2021
3696d69
Fix lack of context in negated volume
dwhswenson Oct 27, 2021
20aba5a
Apply suggestions from code review
dwhswenson Oct 28, 2021
750bb55
Update the negated volume intro text
dwhswenson Oct 28, 2021
1399860
Merge branch 'wizard-rewrite' of github.com:dwhswenson/openpathsampli…
dwhswenson Oct 28, 2021
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
Prev Previous commit
Next Next commit
tests pass locally
  • Loading branch information
dwhswenson committed Oct 7, 2021
commit 59b5770b62eae0b75fe79385b1c51d7104994532
2 changes: 2 additions & 0 deletions paths_cli/compiling/volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def cv_volume_build_func(**dct):
builder = paths.CVDefinedVolume
if cv.period_min is not None or cv.period_max is not None:
builder = paths.PeriodicCVDefinedVolume
dct['period_min'] = cv.period_min
dct['period_max'] = cv.period_max

dct['collectivevariable'] = dct.pop('cv')
# TODO: wrap this with some logging
Expand Down
23 changes: 18 additions & 5 deletions paths_cli/tests/compiling/test_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
from paths_cli.tests.compiling.utils import mock_compiler

import yaml
import numpy as np
import openpathsampling as paths
from openpathsampling.experimental.storage.collective_variables import \
Comment thread
dwhswenson marked this conversation as resolved.
Outdated
CoordinateFunctionCV
from openpathsampling.tests.test_helpers import make_1d_traj

from paths_cli.compiling.volumes import *
Expand All @@ -13,7 +16,6 @@ def setup(self):
self.yml = "\n".join(["type: cv-volume", "cv: {func}",
"lambda_min: 0", "lambda_max: 1"])

self.mock_cv = mock.Mock(return_value=0.5)
self.named_objs_dict = {
'foo': {'name': 'foo',
'type': 'bar',
Expand All @@ -40,18 +42,29 @@ def test_build_cv_volume(self, inline, periodic):
self.set_periodic(periodic)
yml = self.yml.format(func=self.func[inline])
dct = yaml.load(yml, Loader=yaml.FullLoader)
period_min, period_max = {'periodic': (-np.pi, np.pi),
'nonperiodic': (None, None)}[periodic]
mock_cv = CoordinateFunctionCV(lambda s: s.xyz[0][0],
period_min=period_min,
period_max=period_max).named('foo')
if inline =='external':
patch_loc = 'paths_cli.compiling.root_compiler._COMPILERS'
compilers = {
'cv': mock_compiler('cv', named_objs={'foo': self.mock_cv})
'cv': mock_compiler('cv', named_objs={'foo': mock_cv})
}
with mock.patch.dict(patch_loc, compilers):
vol = build_cv_volume(dct)
elif inline == 'internal':
vol = build_cv_volume(dct)
assert vol.collectivevariable(1) == 0.5
snap = make_1d_traj([0.5])[0]
assert vol(snap)

in_state = make_1d_traj([0.5])[0]
assert vol.collectivevariable(in_state) == 0.5
assert vol(in_state)
out_state = make_1d_traj([2.0])[0]
assert vol.collectivevariable(out_state) == 2.0
assert not vol(out_state)
if_periodic = make_1d_traj([7.0])[0]
assert (vol(if_periodic) == (periodic == 'periodic'))
expected_class = {
'nonperiodic': paths.CVDefinedVolume,
'periodic': paths.PeriodicCVDefinedVolume
Expand Down
1 change: 0 additions & 1 deletion paths_cli/tests/wizard/test_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ def test_negated_volume(volume_setup):
@pytest.mark.parametrize('periodic', [True, False])
def test_cv_defined_volume(periodic):
if periodic:
breakpoint()
min_ = 0.0
max_ = 1.0
cv = CoordinateFunctionCV(
Expand Down