study_entity
Module for managing database entities related to studies.
This module defines the StudyEntity class, which extends the abstract base class
DatabaseEntity, to encapsulate study-specific
operations and behaviors.
StudyEntity
Bases: DatabaseEntity[StudyModel], RunManagementMixin, NameMixin
A class representing a study in the database.
This class provides methods to interact with and manage a study's data, including retrieving, adding, and removing run IDs from the list of runs associated with the study, as well as saving or deleting the study itself from the database.
Attributes:
| Name | Type | Description |
|---|---|---|
entity_info |
StudyModel
|
An instance of the |
backend |
ResultsBackend
|
An instance of the |
Methods:
| Name | Description |
|---|---|
__repr__ |
Provide a string representation of the |
__str__ |
Provide a human-readable string representation of the |
reload_data |
Reload the latest data for this study from the database. |
get_id |
Retrieve the unique ID of the study. Implementation found in
|
get_additional_data |
Retrieve any additional metadata associated with the study. Implementation found in
|
get_name |
Retrieve the name of the study. |
get_runs |
Retrieve the IDs of the runs associated with this study. |
add_run |
Add a run ID to the list of runs. |
remove_run |
Remove a run ID from the list of runs. |
save |
Save the current state of the study to the database. |
load |
(classmethod) Load a |
delete |
(classmethod) Delete a study from the database by its ID or name. Optionally, remove all associated runs. |
Source code in merlin/db_scripts/entities/study_entity.py
__repr__()
Provide a string representation of the StudyEntity instance.
Returns:
| Type | Description |
|---|---|
str
|
A human-readable string representation of the |
Source code in merlin/db_scripts/entities/study_entity.py
__str__()
Provide a string representation of the StudyEntity instance.
Returns:
| Type | Description |
|---|---|
str
|
A human-readable string representation of the |