本文整理汇总了Python中pypet.trajectory.Trajectory.f_get_results方法的典型用法代码示例。如果您正苦于以下问题:Python Trajectory.f_get_results方法的具体用法?Python Trajectory.f_get_results怎么用?Python Trajectory.f_get_results使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypet.trajectory.Trajectory
的用法示例。
在下文中一共展示了Trajectory.f_get_results方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TrajectoryTest
# 需要导入模块: from pypet.trajectory import Trajectory [as 别名]
# 或者: from pypet.trajectory.Trajectory import f_get_results [as 别名]
#.........这里部分代码省略.........
################# Derived Parameters ############################
derived_parameters_dict_from_subtree = self.traj.derived_parameters.f_to_dict()
self.assertTrue(len(derived_parameters_dict_from_subtree)>0)
derived_parameters_dict_directly = self.traj.f_get_derived_parameters(copy=True)
self.assertTrue(comp.nested_equal(derived_parameters_dict_directly,derived_parameters_dict_from_subtree),
'%s!=%s' % (str(derived_parameters_dict_directly),str(derived_parameters_dict_directly)))
derived_parameters_dict_directly = self.traj.f_get_derived_parameters(copy=False)
self.assertTrue(comp.nested_equal(derived_parameters_dict_directly,derived_parameters_dict_from_subtree),
'%s!=%s' % (str(derived_parameters_dict_directly),str(derived_parameters_dict_directly)))
derived_parameters_dict_from_subtree = self.traj.derived_parameters.f_to_dict(fast_access=True)
with self.assertRaises(ValueError):
derived_parameters_dict_directly = self.traj.f_get_derived_parameters(copy=False, fast_access=True)
derived_parameters_dict_directly = self.traj.f_get_derived_parameters(copy=True, fast_access=True)
self.assertTrue(comp.nested_equal(derived_parameters_dict_directly,derived_parameters_dict_from_subtree),
'%s!=%s' % (str(derived_parameters_dict_directly),str(derived_parameters_dict_directly)))
############## Results #################################
results_dict_from_subtree = self.traj.results.f_to_dict()
self.assertTrue(len(results_dict_from_subtree)>0)
results_dict_directly = self.traj.f_get_results(copy=True)
self.assertTrue(comp.nested_equal(results_dict_directly,results_dict_from_subtree),
'%s!=%s' % (str(results_dict_directly),str(results_dict_directly)))
results_dict_directly = self.traj.f_get_results(copy=False)
self.assertTrue(comp.nested_equal(results_dict_directly,results_dict_from_subtree),
'%s!=%s' % (str(results_dict_directly),str(results_dict_directly)))
results_dict_from_subtree = self.traj.results.f_to_dict(fast_access=True)
with self.assertRaises(ValueError):
results_dict_directly = self.traj.f_get_results(copy=False, fast_access=True)
results_dict_directly = self.traj.f_get_results(copy=True, fast_access=True)
self.assertTrue(comp.nested_equal(results_dict_directly,results_dict_from_subtree),
'%s!=%s' % (str(results_dict_directly),str(results_dict_directly)))
################### Explored Parameters #######################
# #We need to unlock the parameter because we have accessed it above
# self.traj.f_get('yve').f_unlock()
# explore_dict = {'yve':[4,5,65,66]}
# # We can add to existing explored parameters if we match the length
# self.traj.f_expand(explore_dict)
explore_dict_directly = self.traj.f_get_explored_parameters(copy=False)