当前位置: 首页>>代码示例>>Python>>正文


Python Scale.setup_particle方法代码示例

本文整理汇总了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
开发者ID:salilab,项目名称:imp,代码行数:9,代码来源:test_StudentTRestraint.py

示例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)
开发者ID:apolitis,项目名称:imp,代码行数:10,代码来源:test_NuisanceScoreState.py

示例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)
开发者ID:apolitis,项目名称:imp,代码行数:11,代码来源:test_NuisanceScoreState.py

示例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)
开发者ID:andreyto,项目名称:imp-fork-proddl,代码行数:12,代码来源:test_NuisanceRangeModifier.py

示例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
开发者ID:drussel,项目名称:imp,代码行数:9,代码来源:test_Scale.py

示例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()
开发者ID:AljGaber,项目名称:imp,代码行数:9,代码来源:test_vonMisesKappaConjugateRestraint.py

示例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)
开发者ID:andreyto,项目名称:imp-fork-proddl,代码行数:9,代码来源:test_Scale.py

示例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)
开发者ID:drussel,项目名称:imp,代码行数:10,代码来源:test_JeffreysRestraint.py

示例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)
开发者ID:newtonjoo,项目名称:imp,代码行数:19,代码来源:test_NOERestraint.py

示例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)
开发者ID:drussel,项目名称:imp,代码行数:20,代码来源:test_AmbiguousNOERestraint.py

示例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)
开发者ID:andreyto,项目名称:imp-fork-proddl,代码行数:11,代码来源:test_vonMisesKappaJeffreysRestraint.py

示例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)
开发者ID:AljGaber,项目名称:imp,代码行数:22,代码来源:test_LognormalAmbiguousRestraint.py

示例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()
开发者ID:drussel,项目名称:imp,代码行数:13,代码来源:test_LognormalRestraint.py

示例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)
开发者ID:newtonjoo,项目名称:imp,代码行数:23,代码来源:test_FretRestraint.py

示例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)
开发者ID:andreyto,项目名称:imp-fork-proddl,代码行数:14,代码来源:test_SlidingPriorRestraint.py


注:本文中的IMP.isd.Scale.setup_particle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。