本文整理汇总了Python中pypet.trajectory.Trajectory.f_migrate方法的典型用法代码示例。如果您正苦于以下问题:Python Trajectory.f_migrate方法的具体用法?Python Trajectory.f_migrate怎么用?Python Trajectory.f_migrate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypet.trajectory.Trajectory
的用法示例。
在下文中一共展示了Trajectory.f_migrate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_migrations
# 需要导入模块: from pypet.trajectory import Trajectory [as 别名]
# 或者: from pypet.trajectory.Trajectory import f_migrate [as 别名]
def test_migrations(self):
traj = Trajectory(name='Test', filename=make_temp_file('migrate.hdf5'))
traj.f_add_result('I.am.a.mean.resu', 42, comment='Test')
traj.f_add_derived_parameter('ffa', 42)
traj.f_store()
new_file = make_temp_file('migrate2.hdf5')
traj.f_migrate(new_filename=new_file)
traj.f_store()
new_traj = Trajectory()
new_traj.f_migrate(new_name=traj.v_name, new_filename=new_file, in_store=True)
new_traj.v_auto_load=True
self.assertTrue(new_traj.results.I.am.a.mean.resu == 42)
示例2: test_file_translation
# 需要导入模块: from pypet.trajectory import Trajectory [as 别名]
# 或者: from pypet.trajectory.Trajectory import f_migrate [as 别名]
def test_file_translation(self):
filename = make_temp_dir('to_new_tree.hdf5')
mytraj = Trajectory('SCRATCH', filename=filename)
mytraj.f_add_parameter('Test.Group.Test', 42)
mytraj.f_add_derived_parameter('trajectory.saaaa',33)
mytraj.f_add_derived_parameter('trajectory.intraj.dpar1',33)
mytraj.f_add_derived_parameter('run_00000008.inrun.dpar2',33)
mytraj.f_add_derived_parameter('run_00000001.inrun.dpar3',35)
mytraj.f_add_result('trajectory.intraj.res1',33)
mytraj.f_add_result('run_00000008.inrun.res1',33)
mytraj.f_store()
mytraj.f_migrate(new_name=mytraj.v_name + 'PETER', in_store=True)
mytraj.f_store()
fu=FileUpdater(filename=filename, backup=True)
fu.update_file()
mytraj = Trajectory(name=mytraj.v_name, add_time=False, filename=filename)
mytraj.f_load(load_parameters=2, load_derived_parameters=2, load_results=2)
for node in mytraj.f_iter_nodes():
self.assertTrue(node.v_name != 'trajectory')
if 'run_' in node.v_full_name:
self.assertTrue('.runs.' in node.v_full_name)
remove_data()