ersilia.lake package

Submodules

ersilia.lake.base module

class ersilia.lake.base.LakeBase(config_json: dict)[source]

Bases: ErsiliaBase

Base class for managing the lake directory.

Parameters:

config_json (dict) – Configuration settings in JSON format.

lake_dir

Absolute path to the lake directory if ISAURA_REPOSITORY_PATH is set, otherwise None.

Type:

str or None

is_installed() bool[source]

Check if the ‘isaura’ package is installed.

Returns:

True if ‘isaura’ is installed, False otherwise.

Return type:

bool

Warns:

ModuleNotFoundError – If ‘isaura’ is not installed, a warning is logged.

ersilia.lake.interface module

class ersilia.lake.interface.IsauraInterface(model_id: str, api_name: str, config_json: dict)[source]

Bases: LakeBase

Interface class for interacting with the Isaura HDF5 API, s caching framework to store repeated calculation from inference.

Parameters:
  • model_id (str) – Identifier for the model.

  • api_name (str) – Name of the API.

  • config_json (dict) – Configuration settings in JSON format.

model_id

Identifier for the model.

Type:

str

api_name

Name of the API.

Type:

str

hdf5

Instance of Hdf5ApiExplorer if available, otherwise None.

Type:

Hdf5ApiExplorer or None

converter

Converter for transforming data between dictionary lists and dataframes.

Type:

DictlistDataframeConverter

is_available

True if Hdf5ApiExplorer is available, otherwise False.

Type:

bool

done_todo(input: list) tuple[source]

Determine which keys are done and which are to be processed.

Parameters:

input (list of dict) – List of input dictionaries containing keys.

Returns:

  • done (list of dict) – List of dictionaries for keys that are already processed.

  • todo (list of dict) – List of dictionaries for keys that are yet to be processed.

read(input: list) list[source]

Read data from the HDF5 file based on input keys.

Parameters:

input (list of dict) – List of input dictionaries containing keys.

Returns:

results – List of dictionaries containing input and corresponding output data.

Return type:

list of dict

write(results: list)[source]

Write results to the HDF5 file.

Parameters:

results (list of dict) – List of result dictionaries to be written.

ersilia.lake.manager module

class ersilia.lake.manager.IsauraManager(model_id: str, config_json: dict, credentials_json: dict)[source]

Bases: ErsiliaBase

Manager class for handling Isaura HDF5 operations.

Parameters:
  • model_id (str) – Identifier for the model.

  • config_json (dict) – Configuration settings in JSON format.

  • credentials_json (dict) – Credentials settings in JSON format.

model_id

Identifier for the model.

Type:

str

hdf5

Instance of Hdf5Explorer for managing HDF5 operations.

Type:

Hdf5Explorer

append_local_to_public(secret_keys: list = [])[source]

Append local data to the public repository.

Parameters:

secret_keys (list, optional) – List of secret keys to be used for appending data.

pull()[source]

Pull the latest changes from the remote repository and remove local duplicates.

push(message: str = 'Add data with DVC')[source]

Push local changes to the remote repository.

Parameters:

message (str, optional) – Commit message for the push operation.

remove_local_duplicates()[source]

Remove local duplicate entries in the HDF5 file.

ersilia.lake.s3_logger module

Module contents