run_management
Module for managing entities and their associated runs in the database.
This module provides a mixin class, RunManagementMixin, designed to simplify the management
of runs associated with an entity. The mixin can be used by any class that has the necessary
attributes and methods to support run management, such as reload_data, save, and an
entity_info object containing a runs list.
RunManagementMixin
Mixin for managing runs associated with an entity.
This mixin provides utility methods for handling run IDs associated with an entity.
It assumes that the class using this mixin has the necessary attributes and methods
to support run management, including reload_data, save, and an entity_info object
containing a runs list.
Methods:
| Name | Description |
|---|---|
get_runs |
Retrieve the IDs of the runs associated with the entity. |
add_run |
Add a run ID to the list of runs. |
remove_run |
Remove a run ID from the list of runs. |
Source code in merlin/db_scripts/entities/mixins/run_management.py
add_run(run_id)
Add a new run ID to the list of runs.
Assumptions
- The class using this must have an
entity_infoobject containing arunslist - The class using this must have a
savemethod
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_id
|
str
|
The ID of the run to add. |
required |
Source code in merlin/db_scripts/entities/mixins/run_management.py
construct_run_string()
Constructs and returns a formatted string representation of all runs associated with the current instance.
Returns:
| Type | Description |
|---|---|
str
|
A formatted string containing details of all runs. |
Source code in merlin/db_scripts/entities/mixins/run_management.py
get_runs()
Get every run listed in this entity.
Assumptions
- The class using this must have a
reload_datamethod - The class using this must have an
entity_infoobject containing arunslist
Returns:
| Type | Description |
|---|---|
List[str]
|
A list of run IDs. |
Source code in merlin/db_scripts/entities/mixins/run_management.py
remove_run(run_id)
Remove a run ID from the list of runs.
Does not delete the run entity from the database. This will only remove the run's ID from the list in this entity.
Assumptions
- The class using this must have a
reload_datamethod - The class using this must have an
entity_infoobject containing arunslist - The class using this must have a
savemethod
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_id
|
str
|
The ID of the run to remove. |
required |