rmellipse.workflows.local_interfaces

Classes

CacheInterface

Interface for a local cache.

EnvInterface

Interface with an Enviornment.

Module Contents

class rmellipse.workflows.local_interfaces.CacheInterface(cache_dir: pathlib.Path)

Interface for a local cache.

cache_dir
rm_cached_release(host: str, workspace: str, release_title: str)

Remove a cached release.

Parameters:
hoststr

Name of host

workspacestr

Name of workspace.

release_titlestr

Name of release title.

get_cached_release_dir(host: str, workspace: str, release_title: str) pathlib.Path

Get a directory in the local cache for a given release.

Parameters:
cache_dirstr

_description_

hoststr

_description_

workspacestr

_description_

releasestr

_description_

Returns:
Path

_description_

in_cache(host: str, workspace: str, release_title: str) bool

Check if a release exists in the cache.

Parameters:
hoststr

_description_

workspacestr

_description_

release_titlestr

_description_

Returns:
bool

_description_

class rmellipse.workflows.local_interfaces.EnvInterface(envdir: pathlib.Path)

Interface with an Enviornment.

envdir
packages_dir
rm_broken_packages()

Remove any broken packages in the environment

installed_in_packages() list[str]

Get a list of installed packages

Returns:
list[str]

_description_

installed_in_registry() list[str]

Get a list of releases installed in the registry

Returns:
list[str]

_description_

release_reg_dir(release_title: str)

Dataset registry directory for a release.

Parameters:
release_titlestr

_description_

Returns:
_type_

_description_

release_package_dir(release_title: str)

Package directory for a release.

Parameters:
release_titlestr

_description_

Returns:
_type_

_description_

in_env(release_title: str)

Determine if a release is installed in the environment.

Parameters:
release_titlestr

_description_

Returns:
_type_

_description_

rm_release(release_title: str)

Remove a release from the environment.

Parameters:
release_titlestr

_description_

static with_suffixes_of(path: str | pathlib.Path, use_suffixes_of: str | pathlib.Path) pathlib.Path

Replace name with the suffixes of use_suffixes_of.

Parameters:
namestr | Path

string or path

use_suffixes_ofstr | Path

String or path.

Returns:
Path

Updated path

install_files_namespace(name: str, files: dict[str | pathlib.Path], resolve_relative_to: pathlib.Path)
install_release(release_record: dict, workspace: str, host: str, cache: CacheInterface)

Install a release into the environment.

Parameters:
release_recorddict

_description_

workspacestr

_description_

hoststr

_description_

cacheCacheInterface

_description_

make_registry(release_record: dict, cache_release_dir: pathlib.Path, use_versioned_name: bool = True)

Make a registry that symbolically links to datasets in the cache.

Only symbolic links to files are made, directory structures are copied.

Parameters:
release_recorddict

The record of the of the package being linked too.

cachePath

The cache of the package being linked too. It is assumed to already be downloaded.

envPath

The data environment directory.

use_versioned_name: bool

If True, used the versioned name when making the registry folder.