예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
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)
예제 #4
0
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)
예제 #5
0
def load_from_index(dt_index):
    # type: (DataType) -> HasTraits
    loader = TVBLoader(REGISTRY)
    return loader.load_from_index(dt_index)
예제 #6
0
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)
예제 #7
0
def path_for_stored_index(dt_index_instance):
    # type: (DataType) -> str
    loader = TVBLoader(REGISTRY)
    return loader.path_for_stored_index(dt_index_instance)
예제 #8
0
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)
예제 #9
0
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)