lab

create or use uor lab

create_project(settings)[source]

Create the project directory structure, databases, and settings file. Returns the absolute path to the settings JSON.

Parameters:

settings (dict)

Return type:

str

get_logs()[source]

Retrieve all log entries from the logs database.

This function reads configuration settings to determine the path to the logs database, opens a connection to the database, queries all records from the ‘logs’ table, and returns the results as a pandas DataFrame.

Returns:

A DataFrame containing all rows from the ‘logs’ table, with columns matching the database schema.

Return type:

pd.DataFrame

Raises:
  • KeyError – If ‘data_path’ is not present in the settings.

  • Exception – If there is an error accessing or querying the database.

lab_setup(settings_path)[source]

Initialize the lab environment using settings from a JSON file.

Loads configuration settings, registers the component directory, and logs the setup event in the lab’s logs.csv.

Parameters:
  • settings_path (str) – Path to the JSON settings file. Must exist and contain valid settings.

  • relative_to (str) – if settings have relative paths then that will be consider from this path

Raises:

ValueError – If settings_path is not provided or the file does not exist.

Return type:

None