Exemple #1
0
def load(source_path):
    # type: (str) -> HasTraits
    """
    Load a datatype stored in the tvb h5 file found at the given path
    """
    loader = Loader(REGISTRY)
    return loader.load(source_path)
Exemple #2
0
def store(datatype, destination):
    # type: (HasTraits, str) -> None
    """
    Stores the given datatype in a tvb h5 file at the given path
    """
    loader = Loader(REGISTRY)
    return loader.store(datatype, destination)
Exemple #3
0
def load(source_path, with_references=False):
    # type: (str, bool) -> HasTraits
    """
    Load a datatype stored in the tvb h5 file found at the given path
    """
    if with_references:
        loader = DirLoader(os.path.dirname(source_path), REGISTRY, with_references)
        return loader.load(fname=os.path.basename(source_path))
    else:
        loader = Loader(REGISTRY)
        return loader.load(source_path)
Exemple #4
0
def store(datatype, destination, recursive=False):
    # type: (HasTraits, str, bool) -> None
    """
    Stores the given datatype in a tvb h5 file at the given path
    """
    if recursive:
        loader = DirLoader(os.path.dirname(destination), REGISTRY, recursive)
        loader.store(datatype, os.path.basename(destination))
    else:
        loader = Loader(REGISTRY)
        loader.store(datatype, destination)