def load_with_links(source_path): # type: (str) -> (HasTraits, GenericAttributes) """ Load a datatype stored in the tvb h5 file found at the given path, but also create empty linked entities to hold GID """ loader = TVBLoader(REGISTRY) return loader.load_with_links(source_path)
def load_with_references(source_path): # type: (str) -> (HasTraits, GenericAttributes) """ Load a datatype stored in the tvb h5 file found at the given path, but also load linked entities through GID """ loader = TVBLoader(REGISTRY) return loader.load_with_references(source_path)
def load_with_links_from_dir(base_dir, gid): # type: (str, typing.Union[uuid.UUID, str]) -> HasTraits dir_loader = DirLoader(base_dir, REGISTRY, False) fname = dir_loader.find_file_name(gid) fname = os.path.join(base_dir, fname) tvb_loader = TVBLoader(REGISTRY) return tvb_loader.load_with_links(fname)
def load_with_references_from_dir(base_dir, gid): # type: (str, typing.Union[uuid.UUID, str]) -> HasTraits dir_loader = DirLoader(base_dir, REGISTRY, False) fname = dir_loader.find_file_by_gid(gid) tvb_loader = TVBLoader(REGISTRY) def load_ht_function(sub_gid, traited_attr): return dir_loader.load(sub_gid) return tvb_loader.load_complete_by_function(fname, load_ht_function)
def load_from_index(dt_index): # type: (DataType) -> HasTraits loader = TVBLoader(REGISTRY) return loader.load_from_index(dt_index)
def path_for(base_dir, h5_file_class, gid, dt_class=None): # type: (str, typing.Type[H5File], object, str) -> str loader = TVBLoader(REGISTRY) return loader.path_for(base_dir, h5_file_class, gid, dt_class)
def path_for_stored_index(dt_index_instance): # type: (DataType) -> str loader = TVBLoader(REGISTRY) return loader.path_for_stored_index(dt_index_instance)
def load_from_index(dt_index, dt_class=None): # type: (DataType, typing.Type[HasTraits]) -> HasTraits loader = TVBLoader(REGISTRY) return loader.load_from_index(dt_index, dt_class)
def path_for(op_id, h5_file_class, gid, project_name, dt_class=None): # type: (int, typing.Type[H5File], object, str, str) -> str loader = TVBLoader(REGISTRY) return loader.path_for(op_id, h5_file_class, gid, project_name, dt_class)