• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python testing.get函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test

    def test(self):
        from msmbuilder.scripts.SaveStructures import save

        project = get('ProjectInfo.yaml')
        assignments = get('Assignments.h5')['arr_0']
        which_states = [0, 1, 2]
        list_of_trajs = project.get_random_confs_from_states(assignments, 
            which_states, num_confs=2, replacement=True,
            random=np.random.RandomState(42))

        assert isinstance(list_of_trajs, list)
        assert isinstance(list_of_trajs[0], Trajectory)
        eq(len(list_of_trajs), len(which_states))
        for t in list_of_trajs:
            eq(len(t), 2)

        print list_of_trajs[0].keys()
        # sep, tps, one
        save(list_of_trajs, which_states, style='sep', format='lh5', outdir=self.td)
        save(list_of_trajs, which_states, style='tps', format='lh5', outdir=self.td)
        save(list_of_trajs, which_states, style='one', format='lh5', outdir=self.td)

        names = ['State0-0.lh5', 'State0-1.lh5', 'State0.lh5', 'State1-0.lh5',
                'State1-1.lh5', 'State1.lh5', 'State2-0.lh5', 'State2-1.lh5',
                'State2.lh5']

        for name in names:
            t = Trajectory.load_trajectory_file(pjoin(self.td, name))
            eq(t, get('save_structures/' + name))
开发者ID:dvanatta,项目名称:msmbuilder,代码行数:29,代码来源:test_wrappers.py


示例2: test

 def test(self):
     args, metric = Cluster.parser.parse_args([
         '-p', get('points_on_cube/ProjectInfo.yaml', just_filename=True),
         '-o', self.td,
         'rmsd', '-a', get('points_on_cube/AtomIndices.dat', just_filename=True),
         'hybrid', '-k', '4'], print_banner=False)
     Cluster.main(args, metric)
开发者ID:AgnesHH,项目名称:msmbuilder,代码行数:7,代码来源:test_wrappers.py


示例3: test_CalculateTPT

def test_CalculateTPT():
    T = get("transition_path_theory_reference/tProb.mtx")
    sources = [0]  # chosen arb. for ref. by TJL
    sinks = [70]  # chosen arb. for ref. by TJL
    script_out = CalculateTPT.run(T, sources, sinks)
    committors_ref = get(pjoin("transition_path_theory_reference",
                          "committors.h5"))['Data']
    net_flux_ref = get(pjoin("transition_path_theory_reference",
                        "net_flux.h5"))['Data']
    eq(script_out[0], committors_ref)
    eq(script_out[1].toarray(), net_flux_ref)
开发者ID:dvanatta,项目名称:msmbuilder,代码行数:11,代码来源:test_wrappers.py


示例4: test_FindPaths

def test_FindPaths():
    tprob = get("transition_path_theory_reference/tProb.mtx")
    sources = [0]
    sinks = [70]
    paths, bottlenecks, fluxes = FindPaths.run(tprob, sources, sinks, 10)
    # paths are hard to test due to type issues, adding later --TJL
    bottlenecks_ref = get(pjoin("transition_path_theory_reference",
                           "dijkstra_bottlenecks.h5"))['Data']
    fluxes_ref = get(pjoin("transition_path_theory_reference",
                      "dijkstra_fluxes.h5"))['Data']
    eq(bottlenecks, bottlenecks_ref)
    eq(fluxes, fluxes_ref)
开发者ID:dvanatta,项目名称:msmbuilder,代码行数:12,代码来源:test_wrappers.py


示例5: setUp

 def setUp(self):
     
     self.generators = get('cfep_reference/Gens.lh5')
     N = len(self.generators)
     
     self.counts = get('cfep_reference/tCounts.mtx')
     self.lag_time = 1.0
     self.pfolds = np.random.rand(N)
     self.rescale = False
     
     self.reactant = 0
     self.product  = N
开发者ID:chrismichel,项目名称:msmbuilder,代码行数:12,代码来源:test_cfep.py


示例6: setUp

    def setUp(self):
        if PY3:
            raise nose.SkipTest("TestCfep requires scipy.weave which doesnt exist on python3")

        self.generators = get("cfep_reference/Gens.lh5")
        N = len(self.generators)

        self.counts = get("cfep_reference/tCounts.mtx")
        self.lag_time = 1.0
        self.pfolds = np.random.rand(N)
        self.rescale = False

        self.reactant = 0
        self.product = N
开发者ID:msmbuilder,项目名称:msmbuilder-legacy,代码行数:14,代码来源:test_cfep.py


示例7: test

    def test(self):
        args, metric = Cluster.parser.parse_args([
            '-p', get('ProjectInfo.yaml', just_filename=True),
            '-a', pjoin(self.td, 'Assignments.h5'),
            '-d', pjoin(self.td, 'Assignments.h5.distances'),
            '-g', pjoin(self.td, 'Gens.lh5'),
            'rmsd', '-a', get('AtomIndices.dat', just_filename=True),
            'kcenters', '-k', '100'], print_banner=False)
        Cluster.main(args, metric)

        eq(load(pjoin(self.td, 'Assignments.h5')),
           get('Assignments.h5'))
        eq(load(pjoin(self.td, 'Assignments.h5.distances')),
           get('Assignments.h5.distances'))
        eq(load(pjoin(self.td, 'Gens.lh5')),
           get('Gens.lh5'))
开发者ID:chrismichel,项目名称:msmbuilder,代码行数:16,代码来源:test_wrappers.py


示例8: test

    def test(self):
        try:
            import fastcluster
        except ImportError:
            raise nose.SkipTest("Cannot find fastcluster, so skipping hierarchical clustering test.")

        args, metric = Cluster.parser.parse_args([
            '-p', get('ProjectInfo.yaml', just_filename=True),
            '-s', '10',
            '-o', self.td,
            'rmsd', '-a', get('AtomIndices.dat', just_filename=True),
            'hierarchical'],
            print_banner=False)
        Cluster.main(args, metric)

        eq(load(pjoin(self.td, 'ZMatrix.h5')), get('ZMatrix.h5'))
开发者ID:lilipeng,项目名称:msmbuilder,代码行数:16,代码来源:test_wrappers.py


示例9: test

    def test(self):
        BuildMSM.run(LagTime=1, assignments=get('Assignments.h5')['arr_0'], Symmetrize='MLE',
            OutDir=self.td)

        eq(load(pjoin(self.td, 'tProb.mtx')), get('tProb.mtx'))
        eq(load(pjoin(self.td, 'tCounts.mtx')), get('tCounts.mtx'))
        eq(load(pjoin(self.td, 'Mapping.dat')), get('Mapping.dat'))
        eq(load(pjoin(self.td, 'Assignments.Fixed.h5')), get('Assignments.Fixed.h5'))
        eq(load(pjoin(self.td, 'Populations.dat')), get('Populations.dat'))
开发者ID:baxa,项目名称:msmbuilder,代码行数:9,代码来源:test_wrappers.py


示例10: setUp

    def setUp(self):
        
        # load in the reference data
        self.tprob = get("transition_path_theory_reference/tProb.mtx")
        self.sources   = [0]   # chosen arbitarily by TJL
        self.sinks     = [70]  # chosen arbitarily by TJL
        self.waypoints = [60]  # chosen arbitarily by TJL
        self.lag_time  = 1.0   # chosen arbitarily by TJL

        self.multi_sources = get("transition_path_theory_reference/many_state/sources.dat").astype(int)
        self.multi_sinks = get("transition_path_theory_reference/many_state/sinks.dat").astype(int)

        self.num_paths = 10

        # set up the reference data for hub scores
        K = np.loadtxt( hub_get('ratemat_1.dat') )
        #self.hub_T = scipy.linalg.expm( K ) # delta-t should not affect hub scores
        self.hub_T = np.transpose( np.genfromtxt( hub_get('mat_1.dat') )[:,:-3] )
        
        for i in range(self.hub_T.shape[0]):
            self.hub_T[i,:] /= np.sum(self.hub_T[i,:])
        
        self.hc = np.loadtxt( hub_get('fraction_visited.dat') )
        self.Hc = np.loadtxt( hub_get('hub_scores.dat') )[:,2]
开发者ID:lilipeng,项目名称:msmbuilder,代码行数:24,代码来源:test_tpt.py


示例11: test_CreateAtomIndices

def test_CreateAtomIndices():
    indices = CreateAtomIndices.run(get('native.pdb', just_filename=True),
                                   'minimal')
    eq(indices, get('AtomIndices.dat'))
开发者ID:dvanatta,项目名称:msmbuilder,代码行数:4,代码来源:test_wrappers.py


示例12: tpt_get

def tpt_get(filename):
    """ a little hack to save headache -- returns the path to a file in 
        the hub_ref subdir inside reference/ """
    return get( os.path.join('transition_path_theory_reference', filename), just_filename=True )
开发者ID:lilipeng,项目名称:msmbuilder,代码行数:4,代码来源:test_tpt.py


示例13: hub_get

def hub_get(filename):
    """ a little hack to save headache -- returns the path to a file in 
        the hub_ref subdir inside reference/ """
    return get( os.path.join('hub_ref', filename), just_filename=True )
开发者ID:lilipeng,项目名称:msmbuilder,代码行数:4,代码来源:test_tpt.py


示例14: test_AssignHierarchical

def test_AssignHierarchical():
    asgn = AssignHierarchical.main(k=100, d=None,
        zmatrix_fn=get('ZMatrix.h5', just_filename=True))

    eq(asgn, get('WardAssignments.h5')['Data'])
开发者ID:dvanatta,项目名称:msmbuilder,代码行数:5,代码来源:test_wrappers.py


示例15: test_CalculateClusterRadii

def test_CalculateClusterRadii():
    cr = CalculateClusterRadii.main(get("Assignments.h5")['arr_0'],
                                    get("Assignments.h5.distances")['arr_0'])
    cr_r = get("ClusterRadii.dat")
    eq(cr, cr_r)
开发者ID:dvanatta,项目名称:msmbuilder,代码行数:5,代码来源:test_wrappers.py


示例16: test_CalculateImpliedTimescales

def test_CalculateImpliedTimescales():
    impTimes = CalculateImpliedTimescales.run(MinLagtime=3, MaxLagtime=5,
        Interval=1, NumEigen=10, AssignmentsFn=get('Assignments.h5', just_filename=True),
        trimming=True, symmetrize='Transpose', nProc=1)

    eq(impTimes, get('ImpliedTimescales.dat'))
开发者ID:dvanatta,项目名称:msmbuilder,代码行数:6,代码来源:test_wrappers.py


示例17: test_CalculateMFPTs

def test_CalculateMFPTs(mfpt_state=70):
    mfpt = CalculateMFPTs.run(get('transition_path_theory_reference/tProb.mtx'), mfpt_state)
    mfpt0 = get(pjoin("transition_path_theory_reference", "mfpt.h5"))['Data']
    eq(mfpt, mfpt0)
开发者ID:dvanatta,项目名称:msmbuilder,代码行数:4,代码来源:test_wrappers.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.verboseload函数代码示例发布时间:2022-05-27
下一篇:
Python testing.eq函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap