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


Python isd.Scale类代码示例

本文整理汇总了Python中IMP.isd.Scale的典型用法代码示例。如果您正苦于以下问题:Python Scale类的具体用法?Python Scale怎么用?Python Scale使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Scale类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_particles

 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,代码行数:7,代码来源:test_StudentTRestraint.py

示例2: test_scale_down

 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,代码行数:8,代码来源:test_NuisanceScoreState.py

示例3: test_scale_up

 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,代码行数:9,代码来源:test_NuisanceScoreState.py

示例4: test_scale_down

 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,代码行数:10,代码来源:test_NuisanceRangeModifier.py

示例5: setUp

 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,代码行数:7,代码来源:test_vonMisesKappaConjugateRestraint.py

示例6: test_Setup1

 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,代码行数:7,代码来源:test_Scale.py

示例7: test_Setup2

 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,代码行数:7,代码来源:test_Scale.py

示例8: setUp

 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,代码行数:8,代码来源:test_JeffreysRestraint.py

示例9: setUp

 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,代码行数:17,代码来源:test_NOERestraint.py

示例10: setUp

 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,代码行数:9,代码来源:test_vonMisesKappaJeffreysRestraint.py

示例11: setUp

 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,代码行数:18,代码来源:test_AmbiguousNOERestraint.py

示例12: setUp

 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,代码行数:11,代码来源:test_LognormalRestraint.py

示例13: test_simple

 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,代码行数:20,代码来源:test_LognormalAmbiguousRestraint.py

示例14: setUp

 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,代码行数:12,代码来源:test_SlidingPriorRestraint.py

示例15: setUp

 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,代码行数:21,代码来源:test_FretRestraint.py


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