def init_test_env(): """ This method prepares all necessary data for tests execution """ # Set a default test profile, for when running tests from dev-env. from tvb.basic.profile import TvbProfile if TvbProfile.CURRENT_PROFILE_NAME is None: profile = TvbProfile.TEST_SQLITE_PROFILE if len(sys.argv) > 1: for i in range(1, len(sys.argv) - 1): if "--profile=" in sys.argv[i]: profile = sys.argv[i].split("=")[1] TvbProfile.set_profile(profile) print("Not expected to happen except from PyCharm: setting profile", TvbProfile.CURRENT_PROFILE_NAME) db_file = TvbProfile.current.db.DB_URL.replace('sqlite:///', '') if os.path.exists(db_file): os.remove(db_file) from tvb.config.init.model_manager import reset_database from tvb.config.init.initializer import initialize reset_database() initialize(skip_import=True) # Add Dummy DataType REGISTRY.register_datatype(DummyDataType, DummyDataTypeH5, DummyDataTypeIndex) REGISTRY.register_datatype(None, None, DummyDataType2Index)
def populate_datatypes_registry(): REGISTRY.register_datatype(Connectivity, ConnectivityH5, ConnectivityIndex) REGISTRY.register_datatype(None, BurstConfigurationH5, BurstConfiguration) REGISTRY.register_datatype(LocalConnectivity, LocalConnectivityH5, LocalConnectivityIndex) REGISTRY.register_datatype(ProjectionMatrix, ProjectionMatrixH5, ProjectionMatrixIndex, make_proj_matrix, ProjectionsTypeEnum) REGISTRY.register_datatype(RegionVolumeMapping, RegionVolumeMappingH5, RegionVolumeMappingIndex) REGISTRY.register_datatype(RegionMapping, RegionMappingH5, RegionMappingIndex) REGISTRY.register_datatype(Sensors, SensorsH5, SensorsIndex, make_sensors, SensorTypesEnum) REGISTRY.register_datatype(SimulationHistory, SimulationHistoryH5, SimulationHistoryIndex) REGISTRY.register_datatype(CoherenceSpectrum, CoherenceSpectrumH5, CoherenceSpectrumIndex) REGISTRY.register_datatype(ComplexCoherenceSpectrum, ComplexCoherenceSpectrumH5, ComplexCoherenceSpectrumIndex) REGISTRY.register_datatype(FourierSpectrum, FourierSpectrumH5, FourierSpectrumIndex) REGISTRY.register_datatype(WaveletCoefficients, WaveletCoefficientsH5, WaveletCoefficientsIndex) REGISTRY.register_datatype(StructuralMRI, StructuralMRIH5, StructuralMRIIndex) REGISTRY.register_datatype(Surface, SurfaceH5, SurfaceIndex, make_surface, SurfaceTypesEnum) REGISTRY.register_datatype(CrossCorrelation, CrossCorrelationH5, CrossCorrelationIndex) REGISTRY.register_datatype(TimeSeries, TimeSeriesH5, TimeSeriesIndex) REGISTRY.register_datatype(TimeSeriesRegion, TimeSeriesRegionH5, TimeSeriesRegionIndex) REGISTRY.register_datatype(TimeSeriesSurface, TimeSeriesSurfaceH5, TimeSeriesSurfaceIndex) REGISTRY.register_datatype(TimeSeriesVolume, TimeSeriesVolumeH5, TimeSeriesVolumeIndex) REGISTRY.register_datatype(TimeSeriesEEG, TimeSeriesEEGH5, TimeSeriesEEGIndex) REGISTRY.register_datatype(TimeSeriesMEG, TimeSeriesMEGH5, TimeSeriesMEGIndex) REGISTRY.register_datatype(TimeSeriesSEEG, TimeSeriesSEEGH5, TimeSeriesSEEGIndex) REGISTRY.register_datatype(Tracts, TractsH5, TractsIndex) REGISTRY.register_datatype(Volume, VolumeH5, VolumeIndex) REGISTRY.register_datatype(PrincipalComponents, PrincipalComponentsH5, PrincipalComponentsIndex) REGISTRY.register_datatype(IndependentComponents, IndependentComponentsH5, IndependentComponentsIndex) REGISTRY.register_datatype(ConnectivityMeasure, ConnectivityMeasureH5, ConnectivityMeasureIndex) REGISTRY.register_datatype(CorrelationCoefficients, CorrelationCoefficientsH5, CorrelationCoefficientsIndex) REGISTRY.register_datatype(Covariance, CovarianceH5, CovarianceIndex) REGISTRY.register_datatype(Fcd, FcdH5, FcdIndex) REGISTRY.register_datatype(SpatioTemporalPattern, None, SpatioTemporalPatternIndex) REGISTRY.register_datatype(StimuliRegion, StimuliRegionH5, StimuliRegionIndex) REGISTRY.register_datatype(StimuliSurface, StimuliSurfaceH5, StimuliSurfaceIndex) REGISTRY.register_datatype(DatatypeMeasure, DatatypeMeasureH5, DatatypeMeasureIndex) REGISTRY.register_datatype(ConnectivityAnnotations, ConnectivityAnnotationsH5, ConnectivityAnnotationsIndex) REGISTRY.register_datatype(ValueWrapper, ValueWrapperH5, ValueWrapperIndex)