Skip to content
Prev Previous commit
Make SRMinus subclass of Minus
Hypothetically, this might be useful if someone insists on using
`isinstance` to identify movers of "minus" type. However, I would *strongly*
discourage that usage; there are many better ways to do it. (Use MoveScheme,
or find the movers associated with moves involving the minus ensemble....
perhaps other things)
  • Loading branch information
dwhswenson committed Nov 2, 2015
commit aa12f9d5741cd405da89ebe9f41579cea6610f17
8 changes: 3 additions & 5 deletions openpathsampling/pathmover.py
Original file line number Diff line number Diff line change
Expand Up @@ -1924,17 +1924,14 @@ def __init__(self, minus_ensemble, innermost_ensembles):

super(MinusMover, self).__init__(mover)

class SingleReplicaMinusMover(SubPathMover):
class SingleReplicaMinusMover(MinusMover):
"""
Minus mover for single replica TIS.

In SRTIS, the minus mover doesn't actually keep an active sample in the
minus interface. Instead, it just puts the newly generated segment into
the innermost ensemble.
"""
_is_canonical = True


def __init__(self, minus_ensemble, innermost_ensembles, bias=None):
try:
innermost_ensembles = list(innermost_ensembles)
Expand Down Expand Up @@ -1980,7 +1977,8 @@ def __init__(self, minus_ensemble, innermost_ensembles, bias=None):
forward_minus]),
ensembles=innermost_ensembles)

super(SingleReplicaMinusMover, self).__init__(mover)
# we skip MinusMover's init and go to the grandparent
super(MinusMover, self).__init__(mover)



Expand Down
3 changes: 0 additions & 3 deletions openpathsampling/tests/testpathmover.py
Original file line number Diff line number Diff line change
Expand Up @@ -1138,9 +1138,6 @@ def setup(self):
def test_is_ensemble_change_mover(self):
assert_equal(self.mover.is_ensemble_change_mover, True)

def test_is_canonical(self):
assert_equal(self.mover.is_canonical, True)

def test_successful_move(self):
init_innermost = make_1d_traj(self.list_innermost, [1.0]*5)
init_sample = Sample(
Expand Down