Login
Back to bricks list
Introduction Version

Experiment

Experiment class.

:property project: The project of the experiment :type project: gws.project.Project :property protocol: The the protocol of the experiment :type protocol: gws_core.protocol.protocol.Protocol :property created_by: The user who created the experiment. This user may be different from the user who runs the experiment. :type created_by: gws.user.User :property score: The score of the experiment :type score: float :property is_validated: True if the experiment is validated, False otherwise. Defaults to False. :type is_validated: bool

Attributes

creation_type: ExperimentCreationTypedata: Dict[str, Any]id: stris_validated: boollab_config: LabConfigModelproject: Projectstatus: ExperimentStatusvalidated_at: datetime

Functions

__INIT__

Initialize self. See help(type(self)) for accurate signature.

ARCHIVE
CHECK_IS_RUNNABLE

Throw an error if the experiment is not runnable

CHECK_IS_STOPABLE

Throw an error if the experiment is not stopable

CHECK_IS_UPDATABLE

Throw an error if the experiment is not updatable

CLONE
COERCE
Parameters:
NameTypeDefault valueDescription
_coercebool True
DELETE_INSTANCE
DEPENDENCIES
Parameters:
NameTypeDefault valueDescription
search_nullablebool False
ENTITY_IS_VALIDATED
Return type:
bool
EXPORT_PROTOCOL
Return type:
ExperimentProtocolDTO
GET_ENTITY_NAME
Return type:
str
GET_ENTITY_TYPE
Return type:
EntityType
GET_ERROR_INFO
Return type:
Optional[ProcessErrorInfo]
GET_ID
GET_PROCESS_STATUS
Return type:
ExperimentProcessStatus
GET_RUNNING_TASKS
Return type:
List[TaskModel]
GET_SHORT_NAME

Method to get a readable to quickly distinguish the experiment, (used in error message)

Return type:
str
IS_ALIAS
IS_DIRTY
IS_MANUAL
Return type:
bool
IS_SAVED

Returns True if the model is saved in db, False otherwise

Return type:
bool
MARK_AS_DRAFT
MARK_AS_ERROR
Parameters:
NameTypeDefault valueDescription
error_infoProcessErrorInfo
MARK_AS_IN_QUEUE
MARK_AS_PARTIALLY_RUN
MARK_AS_STARTED
Parameters:
NameTypeDefault valueDescription
pidint
MARK_AS_SUCCESS
MARK_AS_WAITING_FOR_CLI_PROCESS

Mark that a process is created for the experiment, but it is not started yet

Parameters:
NameTypeDefault valueDescription
pidint Pid of the linux process
REFRESH
Return type:
ModelType
RESET
SAVE

Sets the data set force_insert to True to force creation of the object set skip_hook to True to skip the before insert or update hook

:raises Exception: If the input data is not a dict

Return type:
ModelType
SET_ERROR_INFO
Parameters:
NameTypeDefault valueDescription
error_infoProcessErrorInfo
TO_DTO
Return type:
ExperimentDTO
TO_SIMPLE_DTO
Return type:
ExperimentSimpleDTO
UNWRAP
VALIDATE
ADD_INDEX - @classmethod
Parameters:
NameTypeDefault valueDescription
fieldsAny
AFTER_ALL_TABLES_INIT - @classmethod

Method call after all the table are inited

Useful when use DeferredForeignKey to create the foreign key manually latter

AFTER_TABLE_CREATION - @classmethod

Method call after the table is created

Usefull to create the full text indexes

ALIAS - @classmethod
Parameters:
NameTypeDefault valueDescription
aliasAny
BIND - @classmethod
Parameters:
NameTypeDefault valueDescription
databaseAny
bind_refsbool True
bind_backrefsbool True
_excludeAny
BIND_CTX - @classmethod
Parameters:
NameTypeDefault valueDescription
databaseAny
bind_refsbool True
bind_backrefsbool True
BULK_CREATE - @classmethod
Parameters:
NameTypeDefault valueDescription
model_listAny
batch_sizeAny
BULK_UPDATE - @classmethod
Parameters:
NameTypeDefault valueDescription
model_listAny
fieldsAny
batch_sizeAny
CLASSNAME - @classmethod

Returns the name of the class

Parameters:
NameTypeDefault valueDescription
slugifybool False True to slugify the class name if true, defaults to false , optional
snakefybool False True to snakefy the class name if true, defaults to false , optional
replace_uppercasebool False Replace upper cases by "-" if true, defaults to false , optional
Return type:
str
CLEAR_PROJECT - @classmethod

Clear project from all the entities that have the project

Parameters:
NameTypeDefault valueDescription
projectsList
COLUMN_EXISTS - @classmethod

Returns True if the column exists in the table

Parameters:
NameTypeDefault valueDescription
column_namestr The column name ``
Return type:
bool
COUNT_QUEUED_EXPERIMENTS - @classmethod
Return type:
int
COUNT_RUNNING_EXPERIMENTS - @classmethod
Return type:
int
COUNT_RUNNING_OR_QUEUED_EXPERIMENTS - @classmethod
Return type:
int
CREATE - @classmethod
Parameters:
NameTypeDefault valueDescription
queryAny
CREATE_FOREIGN_KEY_IF_NOT_EXIST - @classmethod

Create a foreign key for a Foreign key field only if the foreign key does not exists

Parameters:
NameTypeDefault valueDescription
fieldForeignKeyField [description]
CREATE_FULL_TEXT_INDEX - @classmethod

Method to create a full text index

Parameters:
NameTypeDefault valueDescription
columnsList [description] [str]
index_namestr
CREATE_TABLE - @classmethod

Create model table

DECORATED_METHOD_NAMES - @classmethod
Parameters:
NameTypeDefault valueDescription
decorator_nameAny
DELETE - @classmethod
DELETE_BY_ID - @classmethod
Parameters:
NameTypeDefault valueDescription
pkAny
DROP_TABLE - @classmethod

Drop model table

FILTER - @classmethod
Parameters:
NameTypeDefault valueDescription
dq_nodesAny
filtersAny
FOREIGN_KEY_EXISTS - @classmethod
Parameters:
NameTypeDefault valueDescription
column_namestr
Return type:
bool
FULL_CLASSNAME - @classmethod

Returns the full name of the class

Parameters:
NameTypeDefault valueDescription
slugifybool False Slugify the returned class name if true, defaults to false , optional
snakefybool False Snakefy the returned class name if true, defaults to false ``
Return type:
str
GET - @classmethod
Parameters:
NameTypeDefault valueDescription
queryAny
filtersAny
GET_BY_ID - @classmethod
Parameters:
NameTypeDefault valueDescription
idstr
Return type:
Optional
GET_BY_ID_AND_CHECK - @classmethod

Get by ID and throw 404 error if object not found

Parameters:
NameTypeDefault valueDescription
idstr [description]
Return type:
ModelType
GET_BY_IDS - @classmethod
Parameters:
NameTypeDefault valueDescription
idsList
Return type:
List
GET_DB - @classmethod
Return type:
DatabaseProxy
GET_DB_MANAGER - @classmethod

Returns the (current) DbManager of this model

Return type:
Type
GET_OR_CREATE - @classmethod
GET_OR_NONE - @classmethod
Parameters:
NameTypeDefault valueDescription
queryAny
filtersAny
GET_RUNNING_EXPERIMENTS - @classmethod
Return type:
ModelSelect
GET_TABLE_NAME - @classmethod

Returns the table name of this class

Return type:
str
INDEX - @classmethod
Parameters:
NameTypeDefault valueDescription
fieldsAny
INDEX_EXISTS - @classmethod

Returns True if the index exists in the table

Parameters:
NameTypeDefault valueDescription
index_namestr The index name ``
Return type:
bool
INHERITORS - @classmethod

Get all the classes that inherit this class

Return type:
List
INSERT - @classmethod
Parameters:
NameTypeDefault valueDescription
_Model__dataAny
insertAny
INSERT_FROM - @classmethod
Parameters:
NameTypeDefault valueDescription
queryAny
fieldsAny
INSERT_MANY - @classmethod
Parameters:
NameTypeDefault valueDescription
rowsAny
fieldsAny
IS_MYSQL_ENGINE - @classmethod
METHOD_NAMES - @classmethod

Returns the list of the methods

Return type:
List
MODULE_NAME - @classmethod

Returns the module name of the class

Return type:
str
NOOP - @classmethod
PROPERTY_METHOD_NAMES - @classmethod
PROPERTY_NAMES - @classmethod

Retrieves the property names

Parameters:
NameTypeDefault valueDescription
instancetype The s of the properties to retrieve. set `none` to retrieve all. `type` or `union[type]`
excludetype
Return type:
List
RAW - @classmethod
Parameters:
NameTypeDefault valueDescription
sqlAny
paramsAny
REPLACE - @classmethod
Parameters:
NameTypeDefault valueDescription
_Model__dataAny
insertAny
REPLACE_MANY - @classmethod
Parameters:
NameTypeDefault valueDescription
rowsAny
fieldsAny
SAVE_ALL - @classmethod
SELECT - @classmethod
Parameters:
NameTypeDefault valueDescription
fieldsAny
SET_BY_ID - @classmethod
Parameters:
NameTypeDefault valueDescription
keyAny
valueAny
TABLE_EXISTS - @classmethod
TRUNCATE_TABLE - @classmethod
Parameters:
NameTypeDefault valueDescription
optionsAny
UPDATE - @classmethod
Parameters:
NameTypeDefault valueDescription
_Model__dataAny
updateAny
VALIDATE_MODEL - @classmethod
COPY - @staticmethod
Parameters:
NameTypeDefault valueDescription
methodAny