def setup(self): self.cv = paths.FunctionCV(name="x", f=lambda s: s.xyz[0][0]) self.lambdas = [0.0, 0.1, 0.2, 0.3] self.volumes = paths.VolumeFactory.CVRangeVolumeSet( self.cv, float("-inf"), self.lambdas) self.interface_set = paths.InterfaceSet(self.volumes, self.cv, self.lambdas) self.decreasing = paths.InterfaceSet(list(reversed(self.volumes)), self.cv, list(reversed(self.lambdas))) self.no_lambda_set = paths.InterfaceSet(self.volumes, self.cv)
def setup(self): paths.InterfaceSet._reset() self.cv = paths.FunctionCV(name="x", f=lambda s: s.xyz[0][0]) self.lambdas = [0.0, 0.1, 0.2, 0.3] min_vals = [float("-inf")] * len(self.lambdas) self.volumes = [ paths.CVDefinedVolume(self.cv, min_v, max_v) for min_v, max_v in zip(min_vals, self.lambdas) ] self.interface_set = paths.InterfaceSet(self.volumes, self.cv, self.lambdas) self.decreasing = paths.InterfaceSet(list(reversed(self.volumes)), self.cv, list(reversed(self.lambdas))) self.no_lambda_set = paths.InterfaceSet(self.volumes, self.cv)
def test_no_direction_possible(self): volumes = paths.VolumeFactory.CVRangeVolumeSet( op=self.cv, minvals=[-0.1, -0.2, -0.3], maxvals=[0.1, 0.2, 0.3]) ifaces = paths.InterfaceSet(volumes) assert_equal(ifaces.cv, None) assert_equal(ifaces.cv_max, None) assert_equal(ifaces.direction, 0)
def test_fail_without_lambdas(self): fake_ifaceA = paths.InterfaceSet(cv=self.ifacesA.cv, volumes=self.ifacesA.volumes, direction=self.ifacesA.direction) network = paths.MISTISNetwork([(self.stateA, fake_ifaceA, self.stateB) ]) network.sampling_transitions[0].tcp = self.tcp_A bias = paths.SRTISBiasFromNetwork(network)
def test_no_direction_possible(self): min_vals = [-0.1, -0.2, -0.3] max_vals = [0.1, 0.2, 0.3] volumes = [ paths.CVDefinedVolume(self.cv, min_v, max_v) for min_v, max_v in zip(min_vals, max_vals) ] ifaces = paths.InterfaceSet(volumes) assert_equal(ifaces.cv, None) assert_equal(ifaces.cv_max, None) assert_equal(ifaces.direction, 0)