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


Python Trajectory.v_storage_service方法代码示例

本文整理汇总了Python中pypet.trajectory.Trajectory.v_storage_service方法的典型用法代码示例。如果您正苦于以下问题:Python Trajectory.v_storage_service方法的具体用法?Python Trajectory.v_storage_service怎么用?Python Trajectory.v_storage_service使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pypet.trajectory.Trajectory的用法示例。


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

示例1: load_trajectory

# 需要导入模块: from pypet.trajectory import Trajectory [as 别名]
# 或者: from pypet.trajectory.Trajectory import v_storage_service [as 别名]
 def load_trajectory(self,trajectory_index=None,trajectory_name=None,as_new=False):
     ### Load The Trajectory and check if the values are still the same
     newtraj = Trajectory()
     newtraj.v_storage_service=HDF5StorageService(filename=self.filename)
     newtraj.f_load(name=trajectory_name, load_derived_parameters=2,load_results=2,
                    index=trajectory_index, as_new=as_new)
     return newtraj
开发者ID:ilonajulczuk,项目名称:pypet,代码行数:9,代码来源:hdf5_storage_test.py

示例2: setUp

# 需要导入模块: from pypet.trajectory import Trajectory [as 别名]
# 或者: from pypet.trajectory.Trajectory import v_storage_service [as 别名]
    def setUp(self):

        logging.basicConfig(level = logging.INFO)
        traj = Trajectory('Test')

        traj.v_storage_service = LazyStorageService()

        large_amount = 111

        for irun in range(large_amount):
            name = 'There.Are.Many.Parameters.Like.Me' + str(irun)

            traj.f_add_parameter(name, irun)


        traj.f_add_parameter('TestExplorer', 1)

        traj.v_fast_access=False
        traj.f_explore({traj.TestExplorer.v_full_name:[1,2,3,4,5]})
        traj.v_fast_access=True

        self.traj = traj
        self.n = 1
        self.single_run = self.traj._make_single_run(self.n)
        self.assertTrue(len(self.single_run)==1)
开发者ID:lsolanka,项目名称:pypet,代码行数:27,代码来源:trajectory_test.py

示例3: prepare

# 需要导入模块: from pypet.trajectory import Trajectory [as 别名]
# 或者: from pypet.trajectory.Trajectory import v_storage_service [as 别名]
def prepare():
    logging.basicConfig(level = logging.INFO)
    traj = Trajectory('Test')



    traj.v_storage_service=LazyStorageService()


    large_amount = 11111

    for irun in range(large_amount):
        name = 'Hurz.L' + str(irun)

        traj.f_add_parameter(name,irun)


    traj.f_add_parameter('Hurz.Test', data=1)

    return traj
开发者ID:ilonajulczuk,项目名称:pypet,代码行数:22,代码来源:speed_test.py

示例4: test_f_iter_runs_auto_load

# 需要导入模块: from pypet.trajectory import Trajectory [as 别名]
# 或者: from pypet.trajectory.Trajectory import v_storage_service [as 别名]
    def test_f_iter_runs_auto_load(self):

         ###Explore
        self.explore(self.traj)

        results = self.env.f_run(multiply)
        self.are_results_in_order(results)
        traj = self.traj
        self.assertTrue(len(traj) == len(compat.listvalues(self.explore_dict)[0]))

        self.traj.f_load_skeleton()
        self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)
        self.check_if_z_is_correct(traj)

        newtraj = Trajectory()
        newtraj.v_storage_service=HDF5StorageService(filename=self.filename)
        newtraj.f_load(name=self.traj.v_name, index=None, as_new=False, load_data=0)
        newtraj.v_auto_load = True

        newtraj.par.f_load_child('y', load_data=1)

        for idx, run_name in enumerate(self.traj.f_iter_runs()):
            newtraj.v_crun=run_name
            self.traj.v_idx = idx
            newtraj.v_idx = idx
            nameset = set((x.v_name for x in traj.f_iter_nodes(predicate=(idx,))))
            self.assertTrue('run_%08d' % (idx+1) not in nameset)
            self.assertTrue('run_%08d' % idx in nameset)
            self.assertTrue(traj.v_crun == run_name)
            self.assertTrue(newtraj.res.runs.crun.z==newtraj.par.x*newtraj.par.y,' z != x*y: %s != %s * %s' %
                                                  (str(newtraj.crun.z),str(newtraj.x),str(newtraj.y)))


        traj = self.traj
        self.assertTrue(traj.v_idx == -1)
        self.assertTrue(traj.v_crun is None)
        self.assertTrue(traj.v_crun_ == pypetconstants.RUN_NAME_DUMMY)
        self.assertTrue(newtraj.v_idx == idx)
开发者ID:femtotrader,项目名称:pypet,代码行数:40,代码来源:environment_test.py


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