Fix _StoredProperty descriptor for the inherited class.
Validator has to be a function of the _StoredProperty class instead of the class its part of
@@ -2757,6 +2757,8 @@ class ReplicaExchange(MultiStateSampler):
super(ReplicaExchange, self).__init__(**kwargs)
self.replica_mixing_scheme = replica_mixing_scheme
+ class _StoredProperty(MultiStateSampler._StoredProperty):
+
@staticmethod
def _repex_mixing_scheme_validator(instance, replica_mixing_scheme):
supported_schemes = ['swap-all', 'swap-neighbors', None]
@@ -2765,8 +2767,8 @@ class ReplicaExchange(MultiStateSampler):
"are {}.".format(replica_mixing_scheme, supported_schemes))
return replica_mixing_scheme
- replica_mixing_scheme = MultiStateSampler._StoredProperty('replica_mixing_scheme',
- validate_function=_repex_mixing_scheme_validator)
+ replica_mixing_scheme = _StoredProperty('replica_mixing_scheme',
+ validate_function=_StoredProperty._repex_mixing_scheme_validator)
title_template = ('Replica-exchange sampler simulation created using ReplicaExchange class '
'of yank.repex.py on {}')
