本文整理汇总了Python中tvb.tests.framework.datatypes.datatypes_factory.DatatypesFactory.create_covariance方法的典型用法代码示例。如果您正苦于以下问题:Python DatatypesFactory.create_covariance方法的具体用法?Python DatatypesFactory.create_covariance怎么用?Python DatatypesFactory.create_covariance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tvb.tests.framework.datatypes.datatypes_factory.DatatypesFactory
的用法示例。
在下文中一共展示了DatatypesFactory.create_covariance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestCovarianceViewer
# 需要导入模块: from tvb.tests.framework.datatypes.datatypes_factory import DatatypesFactory [as 别名]
# 或者: from tvb.tests.framework.datatypes.datatypes_factory.DatatypesFactory import create_covariance [as 别名]
class TestCovarianceViewer(TransactionalTestCase):
"""
Unit-tests for Covariance Viewer.
"""
def transactional_setup_method(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())
assert self.connectivity is not None
def transactional_teardown_method(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)
covariance = self.datatypeFactory.create_covariance(time_series)
viewer = CovarianceVisualizer()
result = viewer.launch(covariance)
expected_keys = ['matrix_shape', 'matrix_data', 'mainContent', 'isAdapter']
for key in expected_keys:
assert (key in result)