Experiment
- class labstep.entities.experiment.model.Experiment(data, user)
Represents an Experiment on Labstep.
To see all attributes of an experiment run
print(my_experiment)
Specific attributes can be inspected via dot notation like so…
print(my_experiment.name) print(my_experiment.id)
- edit(name=OPTIONAL, entry=OPTIONAL, started_at=OPTIONAL, extraParams={})
Edit an existing Experiment.
- Parameters:
name (str) – The new name of the Experiment.
entry (obj) – A JSON object representing the state of the Experiment Entry.
started_at (str) – The start date of the Experiment in the format of “YYYY-MM-DD HH:MM”.
- Returns:
An object representing the edited Experiment.
- Return type:
Example
my_experiment = user.getExperiment(17000) my_experiment.edit(name='A New Experiment Name', started_at='2018-06-06 12:05')
- delete()
Delete an existing Experiment.
Example
my_experiment = user.getExperiment(17000) my_experiment.delete()
- lock()
Lock an Experiment. Once locked, only owners can unlock.
Example
my_experiment = user.getExperiment(17000) my_experiment.lock()
- unlock()
Unlock a locked Experiment. Can only be done with owner permission.
Example
my_experiment = user.getExperiment(17000) my_experiment.lock() my_experiment.unlock()
- complete(date=OPTIONAL)
Marks an experiment as complete.
- Parameters:
date (str) – Optionally specify a particular datetime it was completed. Date format ‘YYYY-MM-DD HH:MM:SS’
Example
my_experiment = user.getExperiment(17000) my_experiment.complete()
- getEntry()
Returns a JSON document representing the entry for the experiment.
Example
my_experiment = user.getExperiment(17000) print(my_experiment.getEntry())
- addProtocol(protocol)
Add a Labstep Protocol to a Labstep Experiment.
- Parameters:
protocol (Protocol) – The
Protocol
to attach.- Returns:
An object representing the Protocol attached to the Experiment.
- Return type:
Example
# Get an Experiment my_experiment = user.getExperiment(17000) # Get a Protocol my_protocol = user.getProtocol(10000) # Attach the Protocol to the Experiment my_experiment.addProtocol(my_protocol)
- getProtocols(count=OPTIONAL)
Retrieve the Protocols attached to this Labstep Experiment.
- Returns:
List of the Protocols attached to the Experiment.
- Return type:
List[
ExperimentProtocol
]
Example
entity = user.getExperiment(17000) protocols = entity.getProtocols() protocols[0].attributes()
- addChemicalReaction(data=OPTIONAL, extraParams={})
Add Chemical Reaction to a Labstep Experiment.
- Parameters:
data (str) – The data of the reaction in RXN format
- Returns:
An object representing the new Chemical Reaction
- Return type:
Example
experiment = user.getExperiment(17000) chemicalReaction = experiment.addChemicalReaction(data='RXN 233')
- addDataField(fieldName, fieldType='default', value=OPTIONAL, date=OPTIONAL, number=OPTIONAL, unit=OPTIONAL, filepath=OPTIONAL, extraParams={})
Add Data Fields to a Labstep Experiment.
- Parameters:
fieldName (str) – The name of the field.
fieldType (str) – The Metadata field type. Options are: “default”, “date”, “numeric”, or “file”. The “default” type is “Text”.
value (str) – The value accompanying the fieldName entry.
date (str) – The date and time accompanying the fieldName entry. Must be in the format of “YYYY-MM-DD HH:MM”.
number (float) – The quantity.
unit (str) – The unit accompanying the number entry.
filepath (str) – Local path to the file to upload for type ‘file’
- Returns:
An object representing the new Labstep Data Field.
- Return type:
Example
experiment = user.getExperiment(17000) dataField = experiment.addDataField("Refractive Index", value="1.73")
- getDataFields()
Retrieve the Data Fields of a Protocol within an Experiment.
- Returns:
An array of objects representing Data Fields on a Protocol within an Experiment.
- Return type:
Example
experiment = user.getExperiment(17000) exp_protocol = experiment.getProtocols()[0] dataFields = exp_protocol.getDataFields()
- getChemicalReactions()
Returns a list of the chemical reactions in a Protocol within an Experiment.
- Returns:
List of the chemical reactions in an Experiment’s Protocol.
- Return type:
List[
ChemicalReaction
]
Example
experiment = user.getExperiment(17000) exp_chemical_reactions = experiment.getChemicalReactions()
- getSignatures()
Retrieve a list of signatures added to the experiment
- Returns:
List of the signatures added to the Experiment
- Return type:
List[
ExperimentSignature
]
- addSignature(statement=OPTIONAL, lock=False)
Add a signature to experiment
- Parameters:
statement (str) – Statement describing the signature.
lock (boolean) – Whether to lock the experiment against further edits.
- Returns:
The signature that has been added
- Return type:
- getSignatureRequests()
Returns a list of pending signature requests for the experiment.
- Return type:
- requestSignature(user_id, message=OPTIONAL)
Request a signature from another user in the workspace
- Parameters:
user_id (int) – Id of the user you are requesting a signature from
message (str) – Optional message to include in signature request email
- getInventoryFields()
Returns a list of the inventory fields in the Experiment.
- Returns:
List of the inventory fields in an Experiment.
- Return type:
List[
ExperimentInventoryField
]
Example
experiment = user.getExperiment(17000) exp_inventory_fields = experiment.getInventoryFields() print(exp_inventory_fields[0])
- addInventoryField(name=OPTIONAL, amount=OPTIONAL, units=OPTIONAL, resource_id=OPTIONAL, resource_item_id=OPTIONAL, extraParams={})
Add a new inventory field to the Experiment.
- Parameters:
name (str) – The name of the inventory field to add.
amount (str) – The amount used.
units (str) – The units for the amount.
resource_id (int) – The id of the
Resource
used.resource_item_id (ResourceItem) – The id of the specific
ResourceItem
used.
- Returns:
The newly added inventory field entity.
- Return type:
Example
experiment = user.getExperiment(17000) resource = user.getResources(search_query='Sample A')[0] experiment.addInventoryField(name='Sample A', amount='2', units='ml', resource_id=resource.id)
- addToCollection(collection_id)
Add the experiment to a collection.
- Parameters:
collection_id (int) – The id of the collection to add to
- Return type:
None
- getCollections()
Returns the list of collections the protocol is in.
- removeFromCollection(collection_id)
Remove the experiment from a collection.
- Parameters:
collection_id (int) – The id of the collection to remove from
- getTables()
Returns a list of the tables in the entry of an Experiment.
- Returns:
List of the tables in an Experiment entry
- Return type:
List[
ExperimentTable
]
Example
experiment = user.getExperiment(17000) tables = experiment.getTables()
- addTable(name=OPTIONAL, data=OPTIONAL)
Add a new table to an Experiment.
- Parameters:
name (str) – The name of the table.
data (json) – The data of the table in json format.
- Returns:
The newly added table entity.
- Return type:
Example
data = { "rowCount": 12, "columnCount": 12, "colHeaderData": {}, "data": { "dataTable": { 0: { 0: { "value": 'Cell A1' }, 1: { "value": 'Cell B1' } } } } } experiment = user.getExperiment(17000) experiment.addTable(name='Calibration', data=data)
- addFile(filepath=OPTIONAL, rawData=OPTIONAL)
Add a file to an experiment entry. (Only use for files to be embedded in the body of the entry)
- Parameters:
filepath (str) – The path to the file to upload.
rawData (bytes) – Raw bytes data to upload as file
- Returns:
The newly added file entity.
- Return type:
File
Example
experiment = user.getExperiment(17000) experiment.addFile(filepath='./my_file.csv')
- getComments(count=OPTIONAL)
Retrieve the Comments attached to this Labstep Entity.
- Returns:
List of the comments attached.
- Return type:
List[
Comment
]
Example
entity = user.getExperiment(17000) comments = entity.getComments() comments[0].attributes()
- getFiles()
Returns a list of the files in a experiment entry. (Only includes the files embedded in the body of the entry)
- Returns:
List of the files in a experiment.
- Return type:
List[
File
]
Example
experiment = user.getExperiment(17000) experiment_files = experiment.getFiles()
- addExperimentLink(experiment_id)
Link this experiment to a previous experiment.
- getExperimentLinks(direction='forward')
Returns a list of experiments that the current experiment references (direction = “forward”) or a list of experiments that reference the current experiment (direction = “backwards”)
- Returns:
List of linked experiments.
- Return type:
List[
ExperimentLink
]
Example
experiment = user.getExperiment(17000) experimentLinks = experiment.getExperimentLinks(direction="backwards")
- export(path)
Export the experiment to the directory specified.
- Parameters:
path (str) – The path to the directory to save the experiment.
Example
experiment = user.getExperiment(17000) experiment.export('/my_folder')
- getJupyterNotebooks(count=OPTIONAL)
Retrieve the Jupyter Notebooks attached to this Labstep Entity.
- Returns:
List of the Jupyter Notebooks attached.
- Return type:
List[
JupyterNotebook
]
Example
entity = user.getExperiment(17000) jupyter_notebooks = entity.getJupyterNotebooks() print(jupyter_notebooks[0])
- addJupyterNotebook(name=OPTIONAL, data=OPTIONAL)
Add a Jupyter Notebook to an experiment entry.
- Parameters:
name (str) – Name of Jupyter Notebook
data (JSON) – JSON Jupyter Notebook structure
- Returns:
The newly added file entity.
- Return type:
Example
experiment = user.getExperiment(17000) experiment.addJupyterNotebook()
- addConditions(number_of_conditions)
Add conditions to the experiment :Parameters: number_of_conditions (int) – The number of conditions to add
- Returns:
A list of the protocol conditions added to the experiment.
- Return type:
List[
ProtocolCondition
]
Example
experiment = user.getExperiment(17000) conditions = experiment.addConditions(5)
- getConditions()
Retrieve a list of the different conditions associated with this experiment protocol. :returns: A list of the protocol conditions associated with the experiment protocol. :rtype: List[
ProtocolCondition
]Example
experiment = user.getExperiment(17000) conditions = experiment.getConditions()
- addComment(body, filepath=OPTIONAL, extraParams={})
Add a comment and/or file to a Labstep Entity.
- Parameters:
body (str) – The body of the comment.
filepath (str) – A Labstep File entity to attach to the comment, including the filepath.
- Returns:
The comment added.
- Return type:
Example
my_experiment = user.getExperiment(17000) my_experiment.addComment(body='I am commenting!', filepath='pwd/file_to_upload.dat')
- addTag(name)
Add a tag to the Entity (creates a new tag if none exists).
- Parameters:
name (str) – The name of the tag to create.
- Returns:
The Experiment that was tagged.
- Return type:
Example
my_experiment = user.getExperiment(17000) my_experiment.addTag(name='My Tag')
- assign(user_id, extraParams={})
Assign a user to a Labstep Entity as a Collaborator.
- Parameters:
user_id (int) – User to be assigned.
- Returns:
The collaborator added.
- Return type:
Collaborator
Example
- ::
user_id = 120 experiment= getExperiment(10000) collaborator = experiment.assign(user_id)
- getCollaborators(count=OPTIONAL, extraParams={})
Get Collaborators assigned into a Labstep Entity.
- Parameters:
count (int) – Number of collaborators to fetch.
- Returns:
List of the collaborators assigned.
- Return type:
List[
Collaborator
]
Example
- ::
experiment= getExperiment(10000) collaborators = experiment.getCollaborators()
- getPermissions()
Returns the sharing permissions for the Entity.
- Return type:
List[
Permission
]
Returns a sharelink for the Entity.
- Returns:
The sharelink for the entity
- Return type:
- getTags()
Retrieve the Tags attached to a this Labstep Entity.
- Returns:
List of the tags attached.
- Return type:
List[
Tag
]
Example
entity = user.getExperiment(17000) tags = entity.getTags() tags[0].attributes()
Shares the Entity with another Workspace.
- Parameters:
workspace_id (int) – The id of the workspace to share with
permission (str) – Permission to share with. Can be ‘view’ or ‘edit’
- Return type:
None
- transferOwnership(workspace_id)
Transfer ownership of the Entity to a different Workspace
- Parameters:
workspace_id (int) – The id of the workspace to transfer ownership to
- update()
Fetches the most up-to-date version of the entity from Labstep.
Experiment Protocol
- class labstep.entities.experimentProtocol.model.ExperimentProtocol(data, user)
- edit(name=OPTIONAL, body=OPTIONAL, started_at=OPTIONAL, ended_at=OPTIONAL, extraParams={})
Edit an existing ExperimentProtocol.
- Parameters:
name (str) – The new name of the ExperimentProtocol.
body (dict) – A JSON object representing the new body of the ExperimentProtocol.
started_at (str) – The date the ExperimentProtocol was started in the format of “YYYY-MM-DD HH:MM”.
ended_at (str) – The date the ExperimentProtocol was finished in the format of “YYYY-MM-DD HH:MM”.
- Returns:
An object representing the edited ExperimentProtocol.
- Return type:
Example
my_experiment = user.getExperiment(17000) protocols = my_experiment.getProtocols() protocols[0].edit(name='A New Experiment Name', started_at='2018-06-06 12:05')
- getBody()
Returns the body of the protocol as a JSON document
Example
my_experiment = user.getExperiment(17000) protocols = my_experiment.getProtocols() protocols[0].getBody()
- getInventoryFields(count=OPTIONAL, extraParams={})
Returns a list of the inventory fields in a Protocol within an Experiment.
- Returns:
List of the inventory fields in an Experiment’s Protocol.
- Return type:
List[
ExperimentInventoryField
]
Example
experiment = user.getExperiment(17000) exp_protocol = experiment.getProtocols()[0] exp_protocol_inventory_fields = exp_protocol.getInventoryFields() exp_protocol_inventory_fields[0].attributes()
- addInventoryField(name=OPTIONAL, amount=OPTIONAL, units=OPTIONAL, resource_id=OPTIONAL, resource_item_id=OPTIONAL, extraParams={})
Add a new inventory field to the ExperimentProtocol.
- Parameters:
name (str) – The name of the inventory field to add.
amount (str) – The amount used.
units (str) – The units for the amount.
resource_id (int) – The id of the
Resource
used.resource_item_id (ResourceItem) – The id of the specific
ResourceItem
used.
- Returns:
The newly added inventory field entity.
- Return type:
Example
experiment = user.getExperiment(17000) resource = user.getResources(search_query='Sample A')[0] experiment.addInventoryField(name='Sample A', amount='2', units='ml', resource_id=resource.id)
- addChemicalReaction(extraParams={})
Add a new chemical reaction to the ExperimentProtocol.
- Returns:
The newly added chemical reaction
- Return type:
Example
experiment = user.getExperiment(17000) experiment.addChemicalReaction()
- addSteps(N)
Add steps to a Protocol within an Experiment
- Parameters:
N (int) – The number of steps to add.
Example
experiment = user.getExperiment(17000) exp_protocol = experiment.getProtocols()[0] exp_protocol_steps = exp_protocol.addSteps(5)
- addTable(name=OPTIONAL, data=OPTIONAL)
Add a new table to a Protocol within an Experiment.
- Parameters:
name (str) – The name of the table.
data (json) – The data of the table in json format.
- Returns:
The newly added table entity.
- Return type:
Example
data = { "rowCount": 12, "columnCount": 12, "colHeaderData": {}, "data": { "dataTable": { 0: { 0: { "value": 'Cell A1' }, 1: { "value": 'Cell B1' } } } } } experiment = user.getExperiment(17000) exp_protocol = experiment.getProtocols()[0] exp_protocol.addTable(name='Calibration', data=data)
- getSteps()
Returns a list of the steps in a Protocol within an Experiment.
- Returns:
List of the steps in an Experiment’s Protocol.
- Return type:
List[
ExperimentStep
]
Example
experiment = user.getExperiment(17000) exp_protocol = experiment.getProtocols()[0] exp_protocol_steps = exp_protocol.getSteps() exp_protocol_steps[0].attributes()
- getChemicalReactions()
Returns a list of the chemical reactions in a Protocol within an Experiment.
- Returns:
List of the chemical reactions in an Experiment’s Protocol.
- Return type:
List[
ChemicalReaction
]
Example
experiment = user.getExperiment(17000) exp_protocol = experiment.getProtocols()[0] exp_chemical_reactions = exp_protocol.getChemicalReactions()
- addTimer(name=OPTIONAL, hours=OPTIONAL, minutes=OPTIONAL, seconds=OPTIONAL)
Add a new timer to a Protocol within an Experiment.
- Parameters:
name (str) – The name of the timer.
hours (int) – The hours of the timer.
minutes (int) – The minutes of the timer.
seconds (int) – The seconds of the timer.
- Returns:
The newly added timer entity.
- Return type:
ExperimentTimer
Example
experiment = user.getExperiment(17000) exp_protocol = experiment.getProtocols()[0] exp_protocol.addTimer(name='Refluxing', hours='4', minutes='30')
- getTables()
Returns a list of the tables in a Protocol within an Experiment.
- Returns:
List of the tables in an Experiment’s Protocol.
- Return type:
List[
ExperimentTable
]
Example
experiment = user.getExperiment(17000) exp_protocol = experiment.getProtocols()[0] exp_protocol_tables = exp_protocol.getTables() exp_protocol_tables[0].attributes()
- getTimers()
Returns a list of the timers in a Protocol within an Experiment.
- Returns:
List of the timers in an Experiment’s Protocol.
- Return type:
List[
ExperimentTimer
]
Example
experiment = user.getExperiment(17000) exp_protocol = experiment.getProtocols()[0] exp_protocol_timers = exp_protocol.getTimers() exp_protocol_timers[0].attributes()
- getDataFields()
Retrieve the Data Fields of a Protocol within an Experiment.
- Returns:
An array of objects representing the Labstep Data Fields on a Protocol within an Experiment.
- Return type:
Example
experiment = user.getExperiment(17000) exp_protocol = experiment.getProtocols()[0] metadata = exp_protocol.getDataFields()
- addDataField(fieldName, fieldType='default', value=OPTIONAL, date=OPTIONAL, number=OPTIONAL, unit=OPTIONAL, filepath=OPTIONAL, extraParams={})
Add a Data Field to a Protocol within an Experiment.
- Parameters:
fieldName (str) – The name of the field.
fieldType (str) – The field type. Options are: “default”, “date”, “quantity”, or “number”. The “default” type is “Text”.
value (str) – The value accompanying the fieldName entry.
date (str) – The date and time accompanying the fieldName entry. Must be in the format of “YYYY-MM-DD HH:MM”.
number (float) – The quantity.
unit (str) – The unit accompanying the number entry.
filepath (str) – Local path to the file to upload for type ‘file’
- Returns:
An object representing the new Labstep Data Field.
- Return type:
Example
experiment = user.getExperiment(17000) experiment_protocol = experiment.getProtocols()[0] dataField = experiment_protocol.addDataField( "Refractive Index", value="1.73" )
- addFile(filepath=OPTIONAL, rawData=OPTIONAL)
Add a file to an Experiment Protocol.
- Parameters:
filepath (str) – The path to the file to upload.
rawData (bytes) – Raw data to upload as a file.
- Returns:
The newly added file entity.
- Return type:
File
Example
experiment = user.getExperiment(17000) experiment_protocol = experiment.getProtocols()[0] file = experiment_protocol.addFile(filepath='./my_file.csv')
- getFiles()
Returns a list of the files in a Protocol.
- Returns:
List of the files in a Protocol.
- Return type:
List[
File
]
Example
experiment = user.getExperiment(17000) experiment_protocol = experiment.getProtocols()[0] files = experiment_protocol.getFiles()
- export(rootPath, folderName=OPTIONAL)
Export the entity to the directory specified.
- Parameters:
path (str) – The path to the directory to save the experiment.
Example
experiment = user.getExperiment(17000) experiment.export('/my_folder')
- getJupyterNotebooks(count=OPTIONAL)
Retrieve the Jupyter Notebooks attached to this Labstep Entity.
- Returns:
List of the Jupyter Notebooks attached.
- Return type:
List[
JupyterNotebook
]
Example
entity = user.getExperiment(17000) jupyter_notebooks = entity.getJupyterNotebooks() print(jupyter_notebooks[0])
- addJupyterNotebook(name=OPTIONAL, data=OPTIONAL)
Add a Jupyter Notebook to an experiment entry.
- Parameters:
name (str) – Name of Jupyter Notebook
data (JSON) – JSON Jupyter Notebook structure
- Returns:
The newly added file entity.
- Return type:
Example
experiment = user.getExperiment(17000) experiment.addJupyterNotebook()
- addConditions(number_of_conditions)
Add conditions to the experiment protocol :Parameters: number_of_conditions (int) – The number of conditions to add
- Returns:
A list of the protocol conditions added to the experiment.
- Return type:
List[
ProtocolCondition
]
Example
experiment = user.getExperiment(17000) protocol = experiment.getProtocols()[0] conditions = protocol.addConditions(5)
- getConditions()
Retrieve a list of the different conditions associated with this experiment protocol. :returns: A list of the protocol conditions associated with the experiment protocol. :rtype: List[
ProtocolCondition
]Example
experiment = user.getExperiment(17000) protocol = experiment.getProtocols()[0] conditions = protocol.getConditions()
Experiment Inventory Field
- class labstep.entities.experimentInventoryField.model.ExperimentInventoryField(data, user)
- edit(name=OPTIONAL, amount=OPTIONAL, units=OPTIONAL, resource_id=OPTIONAL, resource_item_id=OPTIONAL, extraParams={})
Edit an existing Experiment Inventory Field.
- Parameters:
amount (str) – The amount used / produced in the experiment.
units (str) – The units of the amount.
resource_id (int) – The
Resource
of the Experiment Inventory Field.resource_item_id (int) – The id of the
ResourceItem
of the Experiment Inventory Field.
- Returns:
An object representing the edited Experiment Inventory Field.
- Return type:
Example
experiment = user.getExperiment(17000) exp_protocol = experiment.getProtocols()[0] exp_protocol_inventory = exp_protocol.getInventoryFields() exp_protocol_inventory[0].edit(amount=1.7, units='ml')
Experiment Data Field
- class labstep.entities.experimentDataField.model.ExperimentDataField(data, user)
Represents a single data field attached to a Labstep Experiment.
To see the attributes of the data field run
print(my_data_field)
Specific attributes can be accessed via dot notation like so…
print(my_data_field.value) print(my_data_field.id)
- edit(fieldName=OPTIONAL, value=OPTIONAL, is_variable=OPTIONAL, extraParams={})
Edit the value of an existing data field.
- Parameters:
fieldName (str) – The new name of the field.
value (str) – The new value of the data.
is_variable (boolean) – Whether or not the field is a variable
- Returns:
An object representing the edited data field.
- Return type:
Example
data.edit(value='2.50')
- delete()
Delete an existing Data field.
Example
data.delete()
- linkToInventoryField(inventoryField)
Link a data field to an inventory field.
- Parameters:
inventoryField – The
ExperimentInventoryField
to link the data field to.
Example
inventoryField = experiment.addInventoryField('Sample') data = experiment.addDataField('Concentration') data.linkToInventoryField(inventoryField)
- getLinkedInventoryFields()
Returns the inventory fields linked to this data field..
- Returns:
The inventory field link the data field to.
- Return type:
List[
ExperimentInventoryField
]
Example
inventoryField = experiment.addInventoryField('Sample') data = experiment.addDataField('Concentration') data.linkToInventoryField(inventoryField)
- getValue()
Returns the value of the data field.
- Return type:
Return type depends on the data type of the data field
Example
dataField = experiment.getDataFields()[0] value = dataField.getValue()
- setValue(value)
Sets the value of the data field.
- Parameters:
value – The value to set, depends on the type of the data field.
- Return type:
Return type depends on the data type of the data field
Example
dataFields = experiment.getDataFields() textField = dataFields.get('My text field') textField.setValue('Some String') numericField = dataFields.get('My numeric field') numericField.setValue(56534) dateField = dataFields.get('My date field') dateField.setValue('2021-10-28') singleOptionsField = dataFields.get('My single options field') singleOptionsField.setValue('Option 1') multiOptionsField = dataFields.get('My multi options field') multiOptionsField.setValue(['Option 1','Option 2']) fileField = dataFields.get('My file field') file = user.newFile('/path/to/file') fileField.setValue(file)
- getNotificationAlert()
Retrieve the Notification Alert of a date type metadata field.
- Returns:
An object representing the notification alert of a metadata field of type Date or Date / Time.
- Return type:
notificationAlert
Example
- ::
experiment = user.getExperiment(49574) dataField = experiment.getDataFields()[0] notification_alert = dataField.getNotificationAlert()
- setNotificationAlert(message, minutes_before)
Set the Notification Alert of a date type metadata field.
- Returns:
An object representing the notification alert of a metadata field of type Date or Date / Time.
- Return type:
notificationAlert
Example
- ::
experiment = user.getExperiment(49574) dataField = experiment.getDataFields()[0] dataField.setNotificationAlert(message=’Overdue’, minutes_before=0)
Experiment Step
- class labstep.entities.experimentStep.model.ExperimentStep(data, user)
- edit(completed_at=OPTIONAL)
Edit an existing Experiment Step.
- Parameters:
completed_at (str) – The datetime at which the Experiment Step was completed.
- Returns:
An object representing the edited Experiment Step.
- Return type:
- complete()
Mark an existing Experiment Step as ‘Complete’.
Example
experiment = user.getExperiment(17000) exp_protocol = experiment.getProtocols()[0] exp_protocol_steps = exp_protocol.getSteps() exp_protocol_steps[0].complete() exp_protocol_steps[1].complete() exp_protocol_steps[2].complete()
- export(rootPath)
Export the entity to the directory specified.
- Parameters:
path (str) – The path to the directory to save the experiment.
Example
experiment = user.getExperiment(17000) experiment.export('/my_folder')
Experiment Table
- class labstep.entities.experimentTable.model.ExperimentTable(data, user)
- edit(name=OPTIONAL, data=OPTIONAL)
Edit an existing Experiment Table.
- Parameters:
name (str) – The name of the Experiment Table.
data (str) – The data of the table.
- Returns:
An object representing the edited Experiment Table.
- Return type:
Example
experiment = user.getExperiment(17000) exp_protocol = experiment.getProtocols()[0] exp_protocol_tables = exp_protocol.getTables() data = { "rowCount": 12, "columnCount": 12, "colHeaderData": {}, "data": { "dataTable": { 0: { 0: { "value": 'Cell A1' }, 1: { "value": 'Cell B1' } } } } } exp_protocol_tables[0].edit(data=data)
- getDataFrame()
Converts a Labstep Table to a Pandas DataFrame.
The first row of the Labstep Table is used as the column names for the DataFrame.
- Returns:
A pandas dataframe.
- Return type:
DataFrame
Example
data = { "rowCount": 2, "columnCount": 2, "data": { "dataTable": { 0: { 0: { "value": 'Column A' }, 1: { "value": 'Column B' } }, 1: { 0: { "value": "A1" }, 1: { "value": "B1" } } } } } experiment = user.getExperiment(17000) experiment_table = experiment.addTable(name='Test Table', data=data) dataFrame = experiment_table.getDataFrame() print(dataFrame['Column A'][0])
Experiment Timer
- class labstep.entities.experimentTimer.model.ExperimentTimer(data, user)
- edit(hours=OPTIONAL, minutes=OPTIONAL, seconds=OPTIONAL)
Edit an existing Experiment Timer.
- Parameters:
hours (int) – The hours of the timer.
minutes (int) – The minutes of the timer.
seconds (int) – The seconds of the timer.
- Returns:
An object representing the edited Experiment Timer.
- Return type:
Example
experiment = user.getExperiment(17000) exp_protocol = experiment.getProtocols()[0] exp_protocol_timers = exp_protocol.getTimers() exp_protocol_timers[0].edit(minutes=1, seconds=7)
Experiment Signature
Experiment Signature Request
Experiment Condition
- class labstep.entities.experimentCondition.model.ExperimentCondition(data, user)
- getDataFields()
Returns the variable data fields associated with this condition. :returns: An array of objects representing the Labstep Data Fields on an Experiment Protocol. :rtype: List[
ExperimentDataField
]Example
experiment = user.getExperiment(17000) condition = experiment.getConditions()[0] dataFields = condition.getDataFields()
- getInventoryFields()
Returns the variable inventory fields associated with this condition. :returns: An array of objects representing the Labstep Inventory Fields on an Experiment Protocol. :rtype: List[
ExperimentInventoryField
]Example
experiment = user.getExperiment(17000) condition = experiment.getConditions()[0] inventoryFields = condition.getInventoryFields()