本文整理汇总了Python中tvb.tests.framework.datatypes.datatypes_factory.DatatypesFactory.create_crosscoherence方法的典型用法代码示例。如果您正苦于以下问题:Python DatatypesFactory.create_crosscoherence方法的具体用法?Python DatatypesFactory.create_crosscoherence怎么用?Python DatatypesFactory.create_crosscoherence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tvb.tests.framework.datatypes.datatypes_factory.DatatypesFactory
的用法示例。
在下文中一共展示了DatatypesFactory.create_crosscoherence方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CrossCoherenceViewerTest
# 需要导入模块: from tvb.tests.framework.datatypes.datatypes_factory import DatatypesFactory [as 别名]
# 或者: from tvb.tests.framework.datatypes.datatypes_factory.DatatypesFactory import create_crosscoherence [as 别名]
class CrossCoherenceViewerTest(TransactionalTestCase):
"""
Unit-tests for Cross Coherence Viewer.
"""
def setUp(self):
"""
Sets up the environment for running the tests;
creates a test user, a test project, a connectivity and a surface;
imports a CFF data-set
"""
self.datatypeFactory = DatatypesFactory()
self.test_project = self.datatypeFactory.get_project()
self.test_user = self.datatypeFactory.get_user()
TestFactory.import_cff(test_user=self.test_user, test_project=self.test_project)
self.connectivity = TestFactory.get_entity(self.test_project, Connectivity())
self.assertTrue(self.connectivity is not None)
def tearDown(self):
"""
Clean-up tests data
"""
FilesHelper().remove_project_structure(self.test_project.name)
def test_launch(self):
"""
Check that all required keys are present in output from BrainViewer launch.
"""
time_series = self.datatypeFactory.create_timeseries(self.connectivity)
cross_coherence = self.datatypeFactory.create_crosscoherence(time_series)
viewer = CrossCoherenceVisualizer()
result = viewer.launch(cross_coherence)
expected_keys = ['matrix_data', 'matrix_shape', 'matrix_strides', 'frequency']
for key in expected_keys:
self.assertTrue(key in result)