本文整理汇总了Python中IMP.isd.Scale.setup_particle方法的典型用法代码示例。如果您正苦于以下问题:Python Scale.setup_particle方法的具体用法?Python Scale.setup_particle怎么用?Python Scale.setup_particle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMP.isd.Scale
的用法示例。
在下文中一共展示了Scale.setup_particle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_particles
# 需要导入模块: from IMP.isd import Scale [as 别名]
# 或者: from IMP.isd.Scale import setup_particle [as 别名]
def create_particles(self):
x = Nuisance.setup_particle(IMP.Particle(self.m), 2.0)
mu = Nuisance.setup_particle(IMP.Particle(self.m), 1.0)
sigma = Scale.setup_particle(IMP.Particle(self.m), 2.0)
nu = Scale.setup_particle(IMP.Particle(self.m), 3.0)
all_nuis = [x, mu, sigma, nu]
return all_nuis
示例2: test_scale_down
# 需要导入模块: from IMP.isd import Scale [as 别名]
# 或者: from IMP.isd.Scale import setup_particle [as 别名]
def test_scale_down(self):
n=IMP.kernel.Particle(self.m)
Scale.setup_particle(n,1.0)
n.set_value(Scale.get_scale_key(), -0.1)
self.m.evaluate(False)
self.assertAlmostEqual(n.get_value(Scale.get_scale_key()),
0.0, delta=1e-7)
self.assertAlmostEqual(self.rs.values[0],0.0)
示例3: test_scale_up
# 需要导入模块: from IMP.isd import Scale [as 别名]
# 或者: from IMP.isd.Scale import setup_particle [as 别名]
def test_scale_up(self):
n=IMP.kernel.Particle(self.m)
Scale.setup_particle(n,1.0)
Scale(n).set_upper(1.5)
n.set_value(Scale.get_scale_key(), 10.0)
self.m.evaluate(False)
self.assertAlmostEqual(n.get_value(Scale.get_scale_key()),
1.5, delta=1e-7)
self.assertAlmostEqual(self.rs.values[0],1.5)
示例4: test_scale_down
# 需要导入模块: from IMP.isd import Scale [as 别名]
# 或者: from IMP.isd.Scale import setup_particle [as 别名]
def test_scale_down(self):
n=IMP.Particle(self.m)
Scale.setup_particle(n,1.0)
self.m.add_score_state(IMP.core.SingletonConstraint(
IMP.isd.NuisanceRangeModifier(), None, n))
n.set_value(Scale.get_scale_key(), -0.1)
self.m.evaluate(False)
self.assertAlmostEqual(n.get_value(Scale.get_scale_key()),
0.0, delta=1e-7)
self.assertAlmostEqual(self.rs.values[0],0.0)
示例5: test_Setup1
# 需要导入模块: from IMP.isd import Scale [as 别名]
# 或者: from IMP.isd.Scale import setup_particle [as 别名]
def test_Setup1(self):
"Test scale setup without lower/upper"
si = Scale.setup_particle(IMP.Particle(self.m))
self.assertAlmostEqual(float(si.get_scale()),1.0, delta=1e-6)
self.assertAlmostEqual(float(si.get_lower()),0.0, delta=1e-6)
self.assertFalse(si.has_upper())
self.assertEqual(si.get_upper(), 1e3000) # 1e3000 ~= inf
示例6: setUp
# 需要导入模块: from IMP.isd import Scale [as 别名]
# 或者: from IMP.isd.Scale import setup_particle [as 别名]
def setUp(self):
IMP.test.TestCase.setUp(self)
# IMP.set_log_level(IMP.MEMORY)
IMP.set_log_level(0)
self.m = IMP.Model()
self.kappa = Scale.setup_particle(IMP.Particle(self.m), 1.0)
self.DA = IMP.DerivativeAccumulator()
示例7: test_Setup2
# 需要导入模块: from IMP.isd import Scale [as 别名]
# 或者: from IMP.isd.Scale import setup_particle [as 别名]
def test_Setup2(self):
si = Scale.setup_particle(IMP.Particle(self.m), 2.0)
si.set_lower(0.1)
si.set_upper(10)
self.assertAlmostEqual(float(si.get_scale()),2.0, delta=1e-6)
self.assertAlmostEqual(float(si.get_lower()),0.1, delta=1e-6)
self.assertAlmostEqual(float(si.get_upper()),10.0, delta=1e-6)
示例8: setUp
# 需要导入模块: from IMP.isd import Scale [as 别名]
# 或者: from IMP.isd.Scale import setup_particle [as 别名]
def setUp(self):
IMP.test.TestCase.setUp(self)
#IMP.base.set_log_level(IMP.MEMORY)
IMP.base.set_log_level(0)
self.m = IMP.Model()
self.sigma = Scale.setup_particle(IMP.Particle(self.m), 1.0)
self.DA = IMP.DerivativeAccumulator()
self.J = IMP.isd.JeffreysRestraint(self.sigma)
示例9: setUp
# 需要导入模块: from IMP.isd import Scale [as 别名]
# 或者: from IMP.isd.Scale import setup_particle [as 别名]
def setUp(self):
IMP.test.TestCase.setUp(self)
# IMP.base.set_log_level(IMP.MEMORY)
IMP.base.set_log_level(0)
self.m = IMP.kernel.Model()
self.sigma = Scale.setup_particle(IMP.kernel.Particle(self.m), 2.0)
self.gamma = Scale.setup_particle(IMP.kernel.Particle(self.m), 1.0)
self.p0 = IMP.core.XYZ.setup_particle(IMP.kernel.Particle(self.m),
IMP.algebra.Vector3D(0, 0, 0))
self.p1 = IMP.core.XYZ.setup_particle(IMP.kernel.Particle(self.m),
IMP.algebra.Vector3D(1, 1, 1))
self.DA = IMP.DerivativeAccumulator()
self.Jsi = IMP.isd.JeffreysRestraint(self.m, self.sigma)
self.Jga = IMP.isd.JeffreysRestraint(self.m, self.gamma)
self.V_obs = 3.0
self.noe = IMP.isd.NOERestraint(self.m, self.p0, self.p1,
self.sigma, self.gamma, self.V_obs)
示例10: setUp
# 需要导入模块: from IMP.isd import Scale [as 别名]
# 或者: from IMP.isd.Scale import setup_particle [as 别名]
def setUp(self):
IMP.test.TestCase.setUp(self)
#IMP.base.set_log_level(IMP.MEMORY)
IMP.base.set_log_level(0)
self.m = IMP.Model()
self.sigma = Scale.setup_particle(IMP.Particle(self.m), 2.0)
self.gamma = Scale.setup_particle(IMP.Particle(self.m), 1.0)
self.p0=IMP.core.XYZ.setup_particle(IMP.Particle(self.m),
IMP.algebra.Vector3D(0,0,0))
self.p1=IMP.core.XYZ.setup_particle(IMP.Particle(self.m),
IMP.algebra.Vector3D(1,1,1))
self.p2=IMP.core.XYZ.setup_particle(IMP.Particle(self.m),
IMP.algebra.Vector3D(1,0,0))
self.DA = IMP.DerivativeAccumulator()
self.V_obs=3.0
self.ls = \
IMP.container.ListPairContainer([(self.p0,self.p1),(self.p0,self.p2)])
self.noe = IMP.isd.AmbiguousNOERestraint(self.ls, self.sigma, self.gamma, self.V_obs)
示例11: setUp
# 需要导入模块: from IMP.isd import Scale [as 别名]
# 或者: from IMP.isd.Scale import setup_particle [as 别名]
def setUp(self):
IMP.test.TestCase.setUp(self)
#IMP.set_log_level(IMP.MEMORY)
IMP.set_log_level(0)
self.m = IMP.Model()
self.kappa = Scale.setup_particle(IMP.Particle(self.m), 1.0)
self.DA = IMP.DerivativeAccumulator()
self.J = IMP.isd.vonMisesKappaJeffreysRestraint(self.kappa)
self.m.add_restraint(self.J)
示例12: test_simple
# 需要导入模块: from IMP.isd import Scale [as 别名]
# 或者: from IMP.isd.Scale import setup_particle [as 别名]
def test_simple(self):
"""Simple test of LognormalAmbiguousRestraint"""
m = IMP.Model()
p1 = IMP.core.XYZ.setup_particle(IMP.Particle(m),
IMP.algebra.Vector3D(0,0,0))
p2 = IMP.core.XYZ.setup_particle(IMP.Particle(m),
IMP.algebra.Vector3D(3,3,3))
ki = Scale.setup_particle(IMP.Particle(m), 0.0)
ki.set_lower(0.)
ki.set_upper(0.)
sigma = Scale.setup_particle(IMP.Particle(m), 2.0)
omega = Scale.setup_particle(IMP.Particle(m), 1.0)
omega.set_lower(1.)
omega.set_upper(10000.)
lnar = IMP.isd.LognormalAmbiguousRestraint(p1, p2, ki, sigma)
lnar.add_contribution(50., omega)
self.assertAlmostEqual(lnar.evaluate(True), 6.165, delta=0.001)
self.assertAlmostEqual(-math.log(lnar.get_probability()),
lnar.evaluate(False), delta=1e-4)
self.assertEqual(lnar.get_number_of_contributions(), 1)
示例13: setUp
# 需要导入模块: from IMP.isd import Scale [as 别名]
# 或者: from IMP.isd.Scale import setup_particle [as 别名]
def setUp(self):
IMP.test.TestCase.setUp(self)
#IMP.base.set_log_level(IMP.MEMORY)
IMP.base.set_log_level(0)
self.m = IMP.Model()
self.sigma = Scale.setup_particle(IMP.Particle(self.m), 2.0)
self.mu = 1.0
self.x = 2.0
self.locations=[self.x, self.mu]
self.all = self.locations+[self.sigma]
self.DA = IMP.DerivativeAccumulator()
示例14: setUp
# 需要导入模块: from IMP.isd import Scale [as 别名]
# 或者: from IMP.isd.Scale import setup_particle [as 别名]
def setUp(self):
IMP.test.TestCase.setUp(self)
# IMP.base.set_log_level(IMP.MEMORY)
IMP.base.set_log_level(0)
self.m = IMP.kernel.Model()
self.kda = Scale.setup_particle(IMP.kernel.Particle(self.m), 4.0)
self.Ida = Scale.setup_particle(IMP.kernel.Particle(self.m), 3.0)
self.R0 = Scale.setup_particle(IMP.kernel.Particle(self.m), 50.0)
self.sigma = Scale.setup_particle(IMP.kernel.Particle(self.m), 0.005)
self.Pbl = Scale.setup_particle(IMP.kernel.Particle(self.m), 0.7)
self.p0 = IMP.core.XYZ.setup_particle(IMP.kernel.Particle(self.m),
IMP.algebra.Vector3D(50, 0, 0))
self.p1 = IMP.core.XYZ.setup_particle(IMP.kernel.Particle(self.m),
IMP.algebra.Vector3D(0, 50, 0))
self.p2 = IMP.core.XYZ.setup_particle(IMP.kernel.Particle(self.m),
IMP.algebra.Vector3D(0, 0, 0))
self.fexp = 1.5
self.fret0 = IMP.isd.FretRestraint([self.p0], [self.p1, self.p2],
self.kda, self.Ida, self.R0, self.sigma, self.Pbl, self.fexp)
self.fret1 = IMP.isd.FretRestraint([self.p0, self.p1], [self.p2],
self.kda, self.Ida, self.R0, self.sigma, self.Pbl, self.fexp)
示例15: setUp
# 需要导入模块: from IMP.isd import Scale [as 别名]
# 或者: from IMP.isd.Scale import setup_particle [as 别名]
def setUp(self):
IMP.test.TestCase.setUp(self)
#IMP.set_log_level(IMP.MEMORY)
IMP.set_log_level(0)
self.m = IMP.Model()
self.q0 = Scale.setup_particle(IMP.Particle(self.m), 0.1)
self.DA = IMP.DerivativeAccumulator()
self.qmin = 0.01
self.qmax = 0.8
self.sq = 0.34
self.J = IMP.isd.SlidingPriorRestraint(self.q0, self.qmin, self.qmax,
self.sq)