Batch Data
albert.resources.batch_data
BatchValuePatchDatum
Bases: BaseAlbertModel
A single change applied to one cell of the batch data grid.
Used within a BatchValuePatchPayload to record the lot consumed for
a batch value. See
update_used_batch_amounts.
Recording a lot's consumed amount is a two-step operation on the grid:
first add the lot's child row under the ingredient (parent) row, then write
the amount on the child row. Parent rows reject value writes
(400 "Parent row cannot be updated").
Example
from albert.resources.batch_data import BatchValuePatchDatum
# Step 1: add the lot child row under the ingredient row. The lot id
# goes on this datum's `lot_id`; `new_value` is the numeric initial
# amount ("0" is fine). `attribute` stays "lotId".
add_lot = BatchValuePatchDatum(operation="add", lot_id="LOT123", new_value="0")
# Step 2: write the recorded amount on the child row created above
# (re-read the grid to discover its row id). `old_value` is required;
# use "0" for the first write to a new lot row.
write_amount = BatchValuePatchDatum(
attribute="cell",
operation="update",
old_value="0",
new_value="0.025",
)
Show JSON schema:
{
"description": "A single change applied to one cell of the batch data grid.\n\nUsed within a [`BatchValuePatchPayload`][albert.resources.batch_data.BatchValuePatchPayload] to record the lot consumed for\na batch value. See\n[`update_used_batch_amounts`][albert.collections.batch_data.BatchDataCollection.update_used_batch_amounts].\n\nRecording a lot's consumed amount is a two-step operation on the grid:\nfirst add the lot's child row under the ingredient (parent) row, then write\nthe amount on the child row. Parent rows reject value writes\n(``400 \"Parent row cannot be updated\"``).\n\n!!! example\n ```python\n from albert.resources.batch_data import BatchValuePatchDatum\n\n # Step 1: add the lot child row under the ingredient row. The lot id\n # goes on this datum's `lot_id`; `new_value` is the numeric initial\n # amount (\"0\" is fine). `attribute` stays \"lotId\".\n add_lot = BatchValuePatchDatum(operation=\"add\", lot_id=\"LOT123\", new_value=\"0\")\n\n # Step 2: write the recorded amount on the child row created above\n # (re-read the grid to discover its row id). `old_value` is required;\n # use \"0\" for the first write to a new lot row.\n write_amount = BatchValuePatchDatum(\n attribute=\"cell\",\n operation=\"update\",\n old_value=\"0\",\n new_value=\"0.025\",\n )\n ```",
"properties": {
"attribute": {
"default": "lotId",
"description": "The field being changed. Defaults to ``\"lotId\"`` (lot assignment; amounts use ``\"cell\"``).",
"title": "Attribute",
"type": "string"
},
"lotId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The lot to link when adding a lot child row (``operation=\"add\"``, ``attribute=\"lotId\"``).\n\nRequired for that change: the lot is linked only when its id is set here.",
"title": "Lotid"
},
"newValue": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The new value to set for the attribute.",
"title": "Newvalue"
},
"oldValue": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The previous value being replaced, when performing an update.",
"title": "Oldvalue"
},
"operation": {
"description": "The kind of change to apply (e.g. ``\"add\"``, ``\"update\"``, ``\"delete\"``).",
"title": "Operation",
"type": "string"
}
},
"required": [
"operation"
],
"title": "BatchValuePatchDatum",
"type": "object"
}
Fields:
attribute
attribute: str = 'lotId'
The field being changed. Defaults to "lotId" (lot assignment; amounts use "cell").
lot_id
lot_id: str | None = None
The lot to link when adding a lot child row (operation="add", attribute="lotId").
Required for that change: the lot is linked only when its id is set here.
old_value
old_value: str | None = None
The previous value being replaced, when performing an update.
BatchValueId
Bases: BaseAlbertModel
Locates a single cell (value) within the batch data grid.
A value lives at the intersection of a row and a product column, so it is addressed by its row and (optionally) column identifiers.
Example
Show JSON schema:
{
"description": "Locates a single cell (value) within the batch data grid.\n\nA value lives at the intersection of a row and a product column, so it is\naddressed by its row and (optionally) column identifiers.\n\n!!! example\n ```python\n from albert.resources.batch_data import BatchValueId\n\n location = BatchValueId(row_id=\"ROW1\", col_id=\"COL9999999\")\n ```",
"properties": {
"colId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The identifier of the product column the value belongs to.",
"title": "Colid"
},
"rowId": {
"description": "The identifier of the row the value belongs to. Required.",
"title": "Rowid",
"type": "string"
}
},
"required": [
"rowId"
],
"title": "BatchValueId",
"type": "object"
}
Fields:
BatchValuePatchPayload
Bases: BaseAlbertModel
A batch of changes targeting one cell of the batch data grid.
Passed to
update_used_batch_amounts
to record which lots were used for recorded batch amounts.
Example
from albert.resources.batch_data import (
BatchValueId,
BatchValuePatchDatum,
BatchValuePatchPayload,
)
# Step 1 of the lot flow: add the lot's child row under an ingredient
# row. The lot id goes on the datum's `lot_id`; `new_value` is the
# numeric initial amount.
patch = BatchValuePatchPayload(
id=BatchValueId(row_id="ROW1", col_id="COL9999999"),
data=[BatchValuePatchDatum(operation="add", lot_id="LOT123", new_value="0")],
)
To confirm a lot was linked, re-read the grid: the new child row's id is
the lot id. A child row with no id is not linked to any lot, so amounts
written to it are not recorded against a lot. The child row's name can be
blank even when the lot is linked.
Show JSON schema:
{
"$defs": {
"BatchValueId": {
"description": "Locates a single cell (value) within the batch data grid.\n\nA value lives at the intersection of a row and a product column, so it is\naddressed by its row and (optionally) column identifiers.\n\n!!! example\n ```python\n from albert.resources.batch_data import BatchValueId\n\n location = BatchValueId(row_id=\"ROW1\", col_id=\"COL9999999\")\n ```",
"properties": {
"colId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The identifier of the product column the value belongs to.",
"title": "Colid"
},
"rowId": {
"description": "The identifier of the row the value belongs to. Required.",
"title": "Rowid",
"type": "string"
}
},
"required": [
"rowId"
],
"title": "BatchValueId",
"type": "object"
},
"BatchValuePatchDatum": {
"description": "A single change applied to one cell of the batch data grid.\n\nUsed within a [`BatchValuePatchPayload`][albert.resources.batch_data.BatchValuePatchPayload] to record the lot consumed for\na batch value. See\n[`update_used_batch_amounts`][albert.collections.batch_data.BatchDataCollection.update_used_batch_amounts].\n\nRecording a lot's consumed amount is a two-step operation on the grid:\nfirst add the lot's child row under the ingredient (parent) row, then write\nthe amount on the child row. Parent rows reject value writes\n(``400 \"Parent row cannot be updated\"``).\n\n!!! example\n ```python\n from albert.resources.batch_data import BatchValuePatchDatum\n\n # Step 1: add the lot child row under the ingredient row. The lot id\n # goes on this datum's `lot_id`; `new_value` is the numeric initial\n # amount (\"0\" is fine). `attribute` stays \"lotId\".\n add_lot = BatchValuePatchDatum(operation=\"add\", lot_id=\"LOT123\", new_value=\"0\")\n\n # Step 2: write the recorded amount on the child row created above\n # (re-read the grid to discover its row id). `old_value` is required;\n # use \"0\" for the first write to a new lot row.\n write_amount = BatchValuePatchDatum(\n attribute=\"cell\",\n operation=\"update\",\n old_value=\"0\",\n new_value=\"0.025\",\n )\n ```",
"properties": {
"attribute": {
"default": "lotId",
"description": "The field being changed. Defaults to ``\"lotId\"`` (lot assignment; amounts use ``\"cell\"``).",
"title": "Attribute",
"type": "string"
},
"lotId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The lot to link when adding a lot child row (``operation=\"add\"``, ``attribute=\"lotId\"``).\n\nRequired for that change: the lot is linked only when its id is set here.",
"title": "Lotid"
},
"newValue": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The new value to set for the attribute.",
"title": "Newvalue"
},
"oldValue": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The previous value being replaced, when performing an update.",
"title": "Oldvalue"
},
"operation": {
"description": "The kind of change to apply (e.g. ``\"add\"``, ``\"update\"``, ``\"delete\"``).",
"title": "Operation",
"type": "string"
}
},
"required": [
"operation"
],
"title": "BatchValuePatchDatum",
"type": "object"
}
},
"description": "A batch of changes targeting one cell of the batch data grid.\n\nPassed to\n[`update_used_batch_amounts`][albert.collections.batch_data.BatchDataCollection.update_used_batch_amounts]\nto record which lots were used for recorded batch amounts.\n\n!!! example\n ```python\n from albert.resources.batch_data import (\n BatchValueId,\n BatchValuePatchDatum,\n BatchValuePatchPayload,\n )\n\n # Step 1 of the lot flow: add the lot's child row under an ingredient\n # row. The lot id goes on the datum's `lot_id`; `new_value` is the\n # numeric initial amount.\n patch = BatchValuePatchPayload(\n id=BatchValueId(row_id=\"ROW1\", col_id=\"COL9999999\"),\n data=[BatchValuePatchDatum(operation=\"add\", lot_id=\"LOT123\", new_value=\"0\")],\n )\n ```\n\nTo confirm a lot was linked, re-read the grid: the new child row's ``id`` is\nthe lot id. A child row with no ``id`` is not linked to any lot, so amounts\nwritten to it are not recorded against a lot. The child row's ``name`` can be\nblank even when the lot is linked.",
"properties": {
"Id": {
"$ref": "#/$defs/BatchValueId",
"description": "Locates the cell to change (its row and optional column)."
},
"data": {
"description": "The individual changes to apply to that cell.",
"items": {
"$ref": "#/$defs/BatchValuePatchDatum"
},
"title": "Data",
"type": "array"
},
"lotId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Not used to link a lot. Set ``lot_id`` on the\n[`BatchValuePatchDatum`][albert.resources.batch_data.BatchValuePatchDatum] instead:\na lot id set only here adds a child row that is not linked to the lot.",
"title": "Lotid"
}
},
"required": [
"Id"
],
"title": "BatchValuePatchPayload",
"type": "object"
}
Fields:
-
id(BatchValueId) -
data(list[BatchValuePatchDatum]) -
lot_id(str | None)
lot_id
lot_id: str | None = None
Not used to link a lot. Set lot_id on the
BatchValuePatchDatum instead:
a lot id set only here adds a child row that is not linked to the lot.
BatchDataType
BatchDataValue
Bases: BaseAlbertModel
A single recorded amount within the batch data grid.
Represents the value of one row within one product column (a cell of the grid), such as the amount of an ingredient used in a given batch.
Show JSON schema:
{
"description": "A single recorded amount within the batch data grid.\n\nRepresents the value of one row within one product column (a cell of the\ngrid), such as the amount of an ingredient used in a given batch.",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The identifier of the value.",
"title": "Id"
},
"colId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The identifier of the product column this value belongs to.",
"title": "Colid"
},
"type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The type of the value.",
"title": "Type"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name associated with the value.",
"title": "Name"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The recorded amount.",
"title": "Value"
},
"isEditable": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the value can be edited.",
"title": "Iseditable"
},
"unitCategory": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of unit the value is expressed in.",
"title": "Unitcategory"
},
"referenceValue": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The reference amount the value is compared against.",
"title": "Referencevalue"
}
},
"title": "BatchDataValue",
"type": "object"
}
Fields:
-
id(str | None) -
col_id(str | None) -
type(str | None) -
name(str | None) -
value(str | None) -
is_editable(bool | None) -
unit_category(str | None) -
reference_value(str | None)
reference_value
reference_value: str | None = None
The reference amount the value is compared against.
BatchDataRow
Bases: BaseAlbertModel
A row of the batch data grid, typically a formulation component.
Each row represents an ingredient (or a sub-formula) that goes into the batch, together with the amounts recorded for it across the product columns. Sub-formulas expand into nested child rows.
Show JSON schema:
{
"$defs": {
"BatchDataRow": {
"description": "A row of the batch data grid, typically a formulation component.\n\nEach row represents an ingredient (or a sub-formula) that goes into the\nbatch, together with the amounts recorded for it across the product columns.\nSub-formulas expand into nested child rows.",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The identifier of the row.",
"title": "Id"
},
"rowId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The row identifier used to locate values (see [`BatchValueId`][albert.resources.batch_data.BatchValueId]).",
"title": "Rowid"
},
"type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The type of the row.",
"title": "Type"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the component the row represents.",
"title": "Name"
},
"manufacturer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The manufacturer of the component, when known.",
"title": "Manufacturer"
},
"unitCategory": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of unit the row's amounts are expressed in.",
"title": "Unitcategory"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of the component.",
"title": "Category"
},
"isFormula": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the row represents a formula (as opposed to a raw material).",
"title": "Isformula"
},
"isLotParent": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the row groups lots as a parent row.",
"title": "Islotparent"
},
"Values": {
"description": "The recorded amounts for this row, one per product column.",
"items": {
"$ref": "#/$defs/BatchDataValue"
},
"title": "Values",
"type": "array"
},
"ChildRows": {
"description": "Nested rows, e.g. the components of a sub-formula.",
"items": {
"$ref": "#/$defs/BatchDataRow"
},
"title": "Childrows",
"type": "array"
}
},
"title": "BatchDataRow",
"type": "object"
},
"BatchDataValue": {
"description": "A single recorded amount within the batch data grid.\n\nRepresents the value of one row within one product column (a cell of the\ngrid), such as the amount of an ingredient used in a given batch.",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The identifier of the value.",
"title": "Id"
},
"colId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The identifier of the product column this value belongs to.",
"title": "Colid"
},
"type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The type of the value.",
"title": "Type"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name associated with the value.",
"title": "Name"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The recorded amount.",
"title": "Value"
},
"isEditable": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the value can be edited.",
"title": "Iseditable"
},
"unitCategory": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of unit the value is expressed in.",
"title": "Unitcategory"
},
"referenceValue": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The reference amount the value is compared against.",
"title": "Referencevalue"
}
},
"title": "BatchDataValue",
"type": "object"
}
},
"$ref": "#/$defs/BatchDataRow"
}
Fields:
-
id(str | None) -
row_id(str | None) -
type(str | None) -
name(str | None) -
manufacturer(str | None) -
unit_category(str | None) -
category(str | None) -
is_formula(bool | None) -
is_lot_parent(bool | None) -
values(list[BatchDataValue]) -
child_rows(list[BatchDataRow])
BatchDataColumn
Bases: BaseAlbertModel
A product column of the batch data grid.
Each column represents the batch/product being manufactured, carrying its totals and any breakdown into individual lots.
Show JSON schema:
{
"$defs": {
"BatchDataColumn": {
"description": "A product column of the batch data grid.\n\nEach column represents the batch/product being manufactured, carrying its\ntotals and any breakdown into individual lots.",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The identifier of the column.",
"title": "Id"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the product/batch.",
"title": "Name"
},
"colId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The column identifier used to locate values (see [`BatchValueId`][albert.resources.batch_data.BatchValueId]).",
"title": "Colid"
},
"batchTotal": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The total amount recorded for the batch.",
"title": "Batchtotal"
},
"referenceTotal": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The reference total the batch is compared against.",
"title": "Referencetotal"
},
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null,
"description": "The status of the column."
},
"productTotal": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The total amount of product produced.",
"title": "Producttotal"
},
"parentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The identifier of the parent column, when this column is a lot.",
"title": "Parentid"
},
"designColId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The identifier of the corresponding design column.",
"title": "Designcolid"
},
"Lots": {
"description": "The individual lot columns that make up this product column.",
"items": {
"$ref": "#/$defs/BatchDataColumn"
},
"title": "Lots",
"type": "array"
}
},
"title": "BatchDataColumn",
"type": "object"
},
"Status": {
"description": "The status of a resource.\n\nAttributes\n----------\nACTIVE : str\n The resource is fully operational and visible in normal operations.\nINACTIVE : str\n The resource is hidden from normal operations and disabled from use.",
"enum": [
"active",
"inactive"
],
"title": "Status",
"type": "string"
}
},
"$ref": "#/$defs/BatchDataColumn"
}
Fields:
-
id(str | None) -
name(str | None) -
col_id(str | None) -
batch_total(str | None) -
reference_total(str | None) -
status(Status | None) -
product_total(float | None) -
parent_id(str | None) -
design_col_id(str | None) -
lots(list[BatchDataColumn])
BatchData
Bases: BaseResource
The tabular record of how a batch of a formulation was made.
Batch Data is the grid behind a Batch Task
(BatchTask). It pairs formulation component
rows with product columns; each cell holds the amount recorded for that
component in that batch. It is retrieved by the owning Task ID via
BatchDataCollection
(client.batch_data) and is not constructed directly.
Show JSON schema:
{
"$defs": {
"AuditFields": {
"description": "The audit fields for a resource",
"properties": {
"by": {
"default": null,
"title": "By",
"type": "string"
},
"byName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Byname"
},
"at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "At"
}
},
"title": "AuditFields",
"type": "object"
},
"BatchDataColumn": {
"description": "A product column of the batch data grid.\n\nEach column represents the batch/product being manufactured, carrying its\ntotals and any breakdown into individual lots.",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The identifier of the column.",
"title": "Id"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the product/batch.",
"title": "Name"
},
"colId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The column identifier used to locate values (see [`BatchValueId`][albert.resources.batch_data.BatchValueId]).",
"title": "Colid"
},
"batchTotal": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The total amount recorded for the batch.",
"title": "Batchtotal"
},
"referenceTotal": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The reference total the batch is compared against.",
"title": "Referencetotal"
},
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null,
"description": "The status of the column."
},
"productTotal": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The total amount of product produced.",
"title": "Producttotal"
},
"parentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The identifier of the parent column, when this column is a lot.",
"title": "Parentid"
},
"designColId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The identifier of the corresponding design column.",
"title": "Designcolid"
},
"Lots": {
"description": "The individual lot columns that make up this product column.",
"items": {
"$ref": "#/$defs/BatchDataColumn"
},
"title": "Lots",
"type": "array"
}
},
"title": "BatchDataColumn",
"type": "object"
},
"BatchDataRow": {
"description": "A row of the batch data grid, typically a formulation component.\n\nEach row represents an ingredient (or a sub-formula) that goes into the\nbatch, together with the amounts recorded for it across the product columns.\nSub-formulas expand into nested child rows.",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The identifier of the row.",
"title": "Id"
},
"rowId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The row identifier used to locate values (see [`BatchValueId`][albert.resources.batch_data.BatchValueId]).",
"title": "Rowid"
},
"type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The type of the row.",
"title": "Type"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the component the row represents.",
"title": "Name"
},
"manufacturer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The manufacturer of the component, when known.",
"title": "Manufacturer"
},
"unitCategory": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of unit the row's amounts are expressed in.",
"title": "Unitcategory"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of the component.",
"title": "Category"
},
"isFormula": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the row represents a formula (as opposed to a raw material).",
"title": "Isformula"
},
"isLotParent": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the row groups lots as a parent row.",
"title": "Islotparent"
},
"Values": {
"description": "The recorded amounts for this row, one per product column.",
"items": {
"$ref": "#/$defs/BatchDataValue"
},
"title": "Values",
"type": "array"
},
"ChildRows": {
"description": "Nested rows, e.g. the components of a sub-formula.",
"items": {
"$ref": "#/$defs/BatchDataRow"
},
"title": "Childrows",
"type": "array"
}
},
"title": "BatchDataRow",
"type": "object"
},
"BatchDataValue": {
"description": "A single recorded amount within the batch data grid.\n\nRepresents the value of one row within one product column (a cell of the\ngrid), such as the amount of an ingredient used in a given batch.",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The identifier of the value.",
"title": "Id"
},
"colId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The identifier of the product column this value belongs to.",
"title": "Colid"
},
"type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The type of the value.",
"title": "Type"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name associated with the value.",
"title": "Name"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The recorded amount.",
"title": "Value"
},
"isEditable": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the value can be edited.",
"title": "Iseditable"
},
"unitCategory": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of unit the value is expressed in.",
"title": "Unitcategory"
},
"referenceValue": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The reference amount the value is compared against.",
"title": "Referencevalue"
}
},
"title": "BatchDataValue",
"type": "object"
},
"Status": {
"description": "The status of a resource.\n\nAttributes\n----------\nACTIVE : str\n The resource is fully operational and visible in normal operations.\nINACTIVE : str\n The resource is hidden from normal operations and disabled from use.",
"enum": [
"active",
"inactive"
],
"title": "Status",
"type": "string"
}
},
"description": "The tabular record of how a batch of a formulation was made.\n\nBatch Data is the grid behind a Batch Task\n([`BatchTask`][albert.resources.tasks.BatchTask]). It pairs formulation component\nrows with product columns; each cell holds the amount recorded for that\ncomponent in that batch. It is retrieved by the owning Task ID via\n[`BatchDataCollection`][albert.collections.batch_data.BatchDataCollection]\n(``client.batch_data``) and is not constructed directly.",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null,
"description": "The status of the resource, optional."
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the creation of the resource, optional."
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the update of the resource, optional."
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Task ID of the owning batch task (format ``TAS...``).",
"title": "Albertid"
},
"size": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "The number of product columns in the batch data.",
"title": "Size"
},
"lastKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Pagination cursor for fetching the next page of product columns; pass it back as ``start_key`` to [`get_by_id`][albert.collections.batch_data.BatchDataCollection.get_by_id].",
"title": "Lastkey"
},
"Product": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/BatchDataColumn"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The product columns, one per batch/product being manufactured.",
"title": "Product"
},
"Rows": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/BatchDataRow"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The formulation component rows.",
"title": "Rows"
}
},
"title": "BatchData",
"type": "object"
}
Fields:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
id(TaskId | None) -
size(int | None) -
last_key(str | None) -
product(list[BatchDataColumn] | None) -
rows(list[BatchDataRow] | None)
last_key
last_key: str | None = None
Pagination cursor for fetching the next page of product columns; pass it back as start_key to get_by_id.
product
product: list[BatchDataColumn] | None = None
The product columns, one per batch/product being manufactured.
BatchDataProduct
Bases: BaseAlbertModel
A product column to add to, remove from, or reset in the batch data grid.
The fields set identify the kind of column:
- Inventory product column: set
idto the Inventory ID (formatINV...). - Lookup column: set
idandname. - Batch Instructions block column: set
namealone to add it, orcol_idto remove it.
Columns of different kinds cannot be mixed in one call.
Example
Show JSON schema:
{
"description": "A product column to add to, remove from, or reset in the batch data grid.\n\nThe fields set identify the kind of column:\n\n- Inventory product column: set ``id`` to the Inventory ID (format ``INV...``).\n- Lookup column: set ``id`` and ``name``.\n- Batch Instructions block column: set ``name`` alone to add it, or ``col_id``\n to remove it.\n\nColumns of different kinds cannot be mixed in one call.\n\n!!! example\n ```python\n from albert.resources.batch_data import BatchDataProduct\n\n product = BatchDataProduct(id=\"INV123\")\n ```",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Inventory ID of the product (format ``INV...``), or the ID of the lookup column.",
"title": "Id"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The column name. Set alone to add a Batch Instructions block column; set with\n``id`` for a lookup column.",
"title": "Name"
},
"colId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The column ID (format ``COL...``), used to remove a Batch Instructions block column.",
"title": "Colid"
}
},
"title": "BatchDataProduct",
"type": "object"
}
Fields:
id
id: str | None = None
The Inventory ID of the product (format INV...), or the ID of the lookup column.
name
name: str | None = None
The column name. Set alone to add a Batch Instructions block column; set with
id for a lookup column.
col_id
col_id: str | None = None
The column ID (format COL...), used to remove a Batch Instructions block column.
BatchDataDesign
Bases: BaseAlbertModel
Locates a cell of a formulation design grid.
A design cell is identified by its design (worksheet) ID together with its row and column IDs.
Example
Show JSON schema:
{
"description": "Locates a cell of a formulation design grid.\n\nA design cell is identified by its design (worksheet) ID together with its\nrow and column IDs.\n\n!!! example\n ```python\n from albert.resources.batch_data import BatchDataDesign\n\n design = BatchDataDesign(id=\"DES100\", row_id=\"ROW2\", col_id=\"COL4\")\n ```",
"properties": {
"id": {
"description": "The design ID of the formulation design.",
"title": "Id",
"type": "string"
},
"rowId": {
"description": "The row ID within the design.",
"title": "Rowid",
"type": "string"
},
"colId": {
"description": "The column ID within the design.",
"title": "Colid",
"type": "string"
}
},
"required": [
"id",
"rowId",
"colId"
],
"title": "BatchDataDesign",
"type": "object"
}
Fields:
BatchDataDesignRow
Bases: BaseAlbertModel
A design cell to add as a row of the batch data grid.
Example
Show JSON schema:
{
"$defs": {
"BatchDataDesign": {
"description": "Locates a cell of a formulation design grid.\n\nA design cell is identified by its design (worksheet) ID together with its\nrow and column IDs.\n\n!!! example\n ```python\n from albert.resources.batch_data import BatchDataDesign\n\n design = BatchDataDesign(id=\"DES100\", row_id=\"ROW2\", col_id=\"COL4\")\n ```",
"properties": {
"id": {
"description": "The design ID of the formulation design.",
"title": "Id",
"type": "string"
},
"rowId": {
"description": "The row ID within the design.",
"title": "Rowid",
"type": "string"
},
"colId": {
"description": "The column ID within the design.",
"title": "Colid",
"type": "string"
}
},
"required": [
"id",
"rowId",
"colId"
],
"title": "BatchDataDesign",
"type": "object"
}
},
"description": "A design cell to add as a row of the batch data grid.\n\n!!! example\n ```python\n from albert.resources.batch_data import BatchDataDesign, BatchDataDesignRow\n\n row = BatchDataDesignRow(design=BatchDataDesign(id=\"DES100\", row_id=\"ROW2\", col_id=\"COL4\"))\n ```",
"properties": {
"Design": {
"$ref": "#/$defs/BatchDataDesign",
"description": "The design cell to add as a row."
}
},
"required": [
"Design"
],
"title": "BatchDataDesignRow",
"type": "object"
}
Fields:
BatchDataRowCreated
Bases: BaseAlbertModel
A row added to the batch data grid from a design cell.
Show JSON schema:
{
"$defs": {
"BatchDataDesign": {
"description": "Locates a cell of a formulation design grid.\n\nA design cell is identified by its design (worksheet) ID together with its\nrow and column IDs.\n\n!!! example\n ```python\n from albert.resources.batch_data import BatchDataDesign\n\n design = BatchDataDesign(id=\"DES100\", row_id=\"ROW2\", col_id=\"COL4\")\n ```",
"properties": {
"id": {
"description": "The design ID of the formulation design.",
"title": "Id",
"type": "string"
},
"rowId": {
"description": "The row ID within the design.",
"title": "Rowid",
"type": "string"
},
"colId": {
"description": "The column ID within the design.",
"title": "Colid",
"type": "string"
}
},
"required": [
"id",
"rowId",
"colId"
],
"title": "BatchDataDesign",
"type": "object"
}
},
"description": "A row added to the batch data grid from a design cell.",
"properties": {
"taskId": {
"description": "The owning batch task, in the form ``BTD#<Task ID>``.",
"title": "Taskid",
"type": "string"
},
"Design": {
"$ref": "#/$defs/BatchDataDesign",
"description": "The design cell the row was added from."
},
"rowId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The ID of the newly created row (format ``ROW...``).",
"title": "Rowid"
},
"inventoryId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Inventory ID of the component the row represents (format ``INV...``).",
"title": "Inventoryid"
}
},
"required": [
"taskId",
"Design"
],
"title": "BatchDataRowCreated",
"type": "object"
}
Fields:
-
task_id(str) -
design(BatchDataDesign) -
row_id(str | None) -
inventory_id(str | None)
inventory_id
inventory_id: str | None = None
The Inventory ID of the component the row represents (format INV...).
BatchDataLotProduct
Bases: BaseAlbertModel
A product whose batch data references a given lot.
Show JSON schema:
{
"description": "A product whose batch data references a given lot.",
"properties": {
"id": {
"description": "The Inventory ID of the product (format ``INV...``).",
"title": "Id",
"type": "string"
},
"lotId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Lot ID recorded for the product (format ``LOT...``), when the reference is a lot pick.",
"title": "Lotid"
}
},
"required": [
"id"
],
"title": "BatchDataLotProduct",
"type": "object"
}
Fields:
BatchDataLotUsage
Bases: BaseAlbertModel
A batch task and product that reference a given lot.
Returned by
get_by_lot_id
to show where a lot was consumed.
Show JSON schema:
{
"$defs": {
"BatchDataLotProduct": {
"description": "A product whose batch data references a given lot.",
"properties": {
"id": {
"description": "The Inventory ID of the product (format ``INV...``).",
"title": "Id",
"type": "string"
},
"lotId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Lot ID recorded for the product (format ``LOT...``), when the reference is a lot pick.",
"title": "Lotid"
}
},
"required": [
"id"
],
"title": "BatchDataLotProduct",
"type": "object"
}
},
"description": "A batch task and product that reference a given lot.\n\nReturned by\n[`get_by_lot_id`][albert.collections.batch_data.BatchDataCollection.get_by_lot_id]\nto show where a lot was consumed.",
"properties": {
"parentId": {
"description": "The Task ID of the batch task (format ``TAS...``).",
"title": "Parentid",
"type": "string"
},
"Product": {
"$ref": "#/$defs/BatchDataLotProduct",
"description": "The product referencing the lot."
}
},
"required": [
"parentId",
"Product"
],
"title": "BatchDataLotUsage",
"type": "object"
}
Fields:
RawCostEntry
Bases: BaseAlbertModel
A formula lot whose raw material cost is recalculated from a batch task.
The raw cost is computed from the amounts and costs of the ingredient lots consumed in the given batch task, divided by the batch size.
Example
Show JSON schema:
{
"description": "A formula lot whose raw material cost is recalculated from a batch task.\n\nThe raw cost is computed from the amounts and costs of the ingredient lots\nconsumed in the given batch task, divided by the batch size.\n\n!!! example\n ```python\n from albert.resources.batch_data import RawCostEntry\n\n entry = RawCostEntry(task_id=\"TAS123\", product_id=\"INV456\", lot_id=\"LOT789\")\n ```",
"properties": {
"task_id": {
"description": "The Task ID of the batch task whose consumed lots determine the cost\n(format ``TAS...``).",
"title": "Task Id",
"type": "string"
},
"product_id": {
"description": "The Inventory ID of the formula product (format ``INV...``).",
"title": "Product Id",
"type": "string"
},
"lot_id": {
"description": "The Lot ID of the formula lot to price (format ``LOT...``).",
"title": "Lot Id",
"type": "string"
},
"updatedAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Optimistic concurrency timestamp (ISO 8601). When set, the recalculation is\nskipped if the batch data column changed since this time.",
"title": "Updatedat"
}
},
"required": [
"task_id",
"product_id",
"lot_id"
],
"title": "RawCostEntry",
"type": "object"
}
Fields:
-
task_id(TaskId) -
product_id(InventoryId) -
lot_id(LotId) -
updated_at(str | None)
ReactionBatchDataProject
Bases: BaseAlbertModel
The project a reaction batch task belongs to.
Show JSON schema:
{
"description": "The project a reaction batch task belongs to.",
"properties": {
"projectId": {
"description": "The Project ID (format ``PRO...``).",
"title": "Projectid",
"type": "string"
},
"projectName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The project name, when available.",
"title": "Projectname"
}
},
"required": [
"projectId"
],
"title": "ReactionBatchDataProject",
"type": "object"
}
Fields:
-
project_id(str) -
project_name(str | None)
ReactionLot
Bases: BaseAlbertModel
The lot picked for a reagent of a reaction batch task.
Show JSON schema:
{
"description": "The lot picked for a reagent of a reaction batch task.",
"properties": {
"lotId": {
"description": "The Lot ID of the picked lot (format ``LOT...``).",
"title": "Lotid",
"type": "string"
},
"inventoryId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Inventory ID the lot belongs to (format ``INV...``).",
"title": "Inventoryid"
},
"substanceId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The substance ID of the reagent.",
"title": "Substanceid"
},
"amt": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The amount of the lot consumed.",
"title": "Amt"
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit the consumed amount is expressed in.",
"title": "Unit"
},
"inventoryOnHand": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The remaining on-hand quantity of the lot.",
"title": "Inventoryonhand"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the lot.",
"title": "Albertid"
},
"lotNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The lot number.",
"title": "Lotnumber"
},
"parentName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the inventory item the lot belongs to.",
"title": "Parentname"
}
},
"required": [
"lotId"
],
"title": "ReactionLot",
"type": "object"
}
Fields:
-
lot_id(str) -
inventory_id(str | None) -
substance_id(str | None) -
amt(float | None) -
unit(str | None) -
inventory_on_hand(float | None) -
albert_id(str | None) -
lot_number(str | None) -
parent_name(str | None)
ReactionReagent
Bases: BaseAlbertModel
A reagent of a reaction batch task, with its planned and picked amounts.
Show JSON schema:
{
"$defs": {
"ReactionLot": {
"description": "The lot picked for a reagent of a reaction batch task.",
"properties": {
"lotId": {
"description": "The Lot ID of the picked lot (format ``LOT...``).",
"title": "Lotid",
"type": "string"
},
"inventoryId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Inventory ID the lot belongs to (format ``INV...``).",
"title": "Inventoryid"
},
"substanceId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The substance ID of the reagent.",
"title": "Substanceid"
},
"amt": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The amount of the lot consumed.",
"title": "Amt"
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit the consumed amount is expressed in.",
"title": "Unit"
},
"inventoryOnHand": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The remaining on-hand quantity of the lot.",
"title": "Inventoryonhand"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the lot.",
"title": "Albertid"
},
"lotNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The lot number.",
"title": "Lotnumber"
},
"parentName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the inventory item the lot belongs to.",
"title": "Parentname"
}
},
"required": [
"lotId"
],
"title": "ReactionLot",
"type": "object"
}
},
"description": "A reagent of a reaction batch task, with its planned and picked amounts.",
"properties": {
"sttId": {
"description": "The substance ID of the reagent.",
"title": "Sttid",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name of the reagent.",
"title": "Name"
},
"function": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The role of the reagent in the reaction (e.g. solvent, catalyst).",
"title": "Function"
},
"isLimitingReagent": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the reagent limits the reaction yield.",
"title": "Islimitingreagent"
},
"eq": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The equivalents display string. Do not parse as a number.",
"title": "Eq"
},
"mw": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The molecular weight of the reagent.",
"title": "Mw"
},
"purity": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The purity of the reagent.",
"title": "Purity"
},
"totalAmt": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The planned amount of the reagent.",
"title": "Totalamt"
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit amounts are expressed in.",
"title": "Unit"
},
"totalUsed": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The amount of the reagent used so far (the picked lot amount).",
"title": "Totalused"
},
"smiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The SMILES structure string of the reagent.",
"title": "Smiles"
},
"imageUrl": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The URL of the reagent's structure image.",
"title": "Imageurl"
},
"Lot": {
"anyOf": [
{
"$ref": "#/$defs/ReactionLot"
},
{
"type": "null"
}
],
"default": null,
"description": "The lot picked for the reagent; ``None`` until a lot is picked."
}
},
"required": [
"sttId"
],
"title": "ReactionReagent",
"type": "object"
}
Fields:
-
stt_id(str) -
name(str | None) -
function(str | None) -
is_limiting_reagent(bool | None) -
eq(str | None) -
mw(float | None) -
purity(float | None) -
total_amt(float | None) -
unit(str | None) -
total_used(float | None) -
smiles(str | None) -
image_url(str | None) -
lot(ReactionLot | None)
function
function: str | None = None
The role of the reagent in the reaction (e.g. solvent, catalyst).
is_limiting_reagent
is_limiting_reagent: bool | None = None
Whether the reagent limits the reaction yield.
total_used
total_used: float | None = None
The amount of the reagent used so far (the picked lot amount).
ReactionProduct
Bases: BaseAlbertModel
A product of a reaction batch task, with its planned and actual amounts.
Show JSON schema:
{
"description": "A product of a reaction batch task, with its planned and actual amounts.",
"properties": {
"sttId": {
"description": "The substance ID of the product.",
"title": "Sttid",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name of the product.",
"title": "Name"
},
"subId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The sub ID assigned to the product.",
"title": "Subid"
},
"mw": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The molecular weight of the product.",
"title": "Mw"
},
"actual": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The actual amount of product obtained (the recorded yield).",
"title": "Actual"
},
"totalAmt": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The planned amount of the product.",
"title": "Totalamt"
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit amounts are expressed in.",
"title": "Unit"
},
"smiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The SMILES structure string of the product.",
"title": "Smiles"
},
"imageUrl": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The URL of the product's structure image.",
"title": "Imageurl"
}
},
"required": [
"sttId"
],
"title": "ReactionProduct",
"type": "object"
}
Fields:
-
stt_id(str) -
name(str | None) -
sub_id(str | None) -
mw(float | None) -
actual(float | None) -
total_amt(float | None) -
unit(str | None) -
smiles(str | None) -
image_url(str | None)
Reaction
Bases: BaseAlbertModel
A single reaction of a reaction batch task.
Show JSON schema:
{
"$defs": {
"ReactionLot": {
"description": "The lot picked for a reagent of a reaction batch task.",
"properties": {
"lotId": {
"description": "The Lot ID of the picked lot (format ``LOT...``).",
"title": "Lotid",
"type": "string"
},
"inventoryId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Inventory ID the lot belongs to (format ``INV...``).",
"title": "Inventoryid"
},
"substanceId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The substance ID of the reagent.",
"title": "Substanceid"
},
"amt": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The amount of the lot consumed.",
"title": "Amt"
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit the consumed amount is expressed in.",
"title": "Unit"
},
"inventoryOnHand": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The remaining on-hand quantity of the lot.",
"title": "Inventoryonhand"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the lot.",
"title": "Albertid"
},
"lotNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The lot number.",
"title": "Lotnumber"
},
"parentName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the inventory item the lot belongs to.",
"title": "Parentname"
}
},
"required": [
"lotId"
],
"title": "ReactionLot",
"type": "object"
},
"ReactionProduct": {
"description": "A product of a reaction batch task, with its planned and actual amounts.",
"properties": {
"sttId": {
"description": "The substance ID of the product.",
"title": "Sttid",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name of the product.",
"title": "Name"
},
"subId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The sub ID assigned to the product.",
"title": "Subid"
},
"mw": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The molecular weight of the product.",
"title": "Mw"
},
"actual": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The actual amount of product obtained (the recorded yield).",
"title": "Actual"
},
"totalAmt": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The planned amount of the product.",
"title": "Totalamt"
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit amounts are expressed in.",
"title": "Unit"
},
"smiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The SMILES structure string of the product.",
"title": "Smiles"
},
"imageUrl": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The URL of the product's structure image.",
"title": "Imageurl"
}
},
"required": [
"sttId"
],
"title": "ReactionProduct",
"type": "object"
},
"ReactionReagent": {
"description": "A reagent of a reaction batch task, with its planned and picked amounts.",
"properties": {
"sttId": {
"description": "The substance ID of the reagent.",
"title": "Sttid",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name of the reagent.",
"title": "Name"
},
"function": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The role of the reagent in the reaction (e.g. solvent, catalyst).",
"title": "Function"
},
"isLimitingReagent": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the reagent limits the reaction yield.",
"title": "Islimitingreagent"
},
"eq": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The equivalents display string. Do not parse as a number.",
"title": "Eq"
},
"mw": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The molecular weight of the reagent.",
"title": "Mw"
},
"purity": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The purity of the reagent.",
"title": "Purity"
},
"totalAmt": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The planned amount of the reagent.",
"title": "Totalamt"
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit amounts are expressed in.",
"title": "Unit"
},
"totalUsed": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The amount of the reagent used so far (the picked lot amount).",
"title": "Totalused"
},
"smiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The SMILES structure string of the reagent.",
"title": "Smiles"
},
"imageUrl": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The URL of the reagent's structure image.",
"title": "Imageurl"
},
"Lot": {
"anyOf": [
{
"$ref": "#/$defs/ReactionLot"
},
{
"type": "null"
}
],
"default": null,
"description": "The lot picked for the reagent; ``None`` until a lot is picked."
}
},
"required": [
"sttId"
],
"title": "ReactionReagent",
"type": "object"
}
},
"description": "A single reaction of a reaction batch task.",
"properties": {
"id": {
"description": "The reaction ID (format ``RXN...``).",
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name of the reaction.",
"title": "Name"
},
"Reagents": {
"description": "The reagents of the reaction.",
"items": {
"$ref": "#/$defs/ReactionReagent"
},
"title": "Reagents",
"type": "array"
},
"Products": {
"description": "The products of the reaction.",
"items": {
"$ref": "#/$defs/ReactionProduct"
},
"title": "Products",
"type": "array"
}
},
"required": [
"id"
],
"title": "Reaction",
"type": "object"
}
Fields:
-
id(str) -
name(str | None) -
reagents(list[ReactionReagent]) -
products(list[ReactionProduct])
ReactionBatchData
Bases: BaseAlbertModel
The reaction grid of a reaction batch task.
Pairs each reaction's reagents (with their picked lots) and products (with
their actual amounts) for a reaction Batch Task. Retrieved with
get_reaction.
(🧪 Beta) Requires the reaction batch task feature to be enabled for the tenant.
Show JSON schema:
{
"$defs": {
"Reaction": {
"description": "A single reaction of a reaction batch task.",
"properties": {
"id": {
"description": "The reaction ID (format ``RXN...``).",
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name of the reaction.",
"title": "Name"
},
"Reagents": {
"description": "The reagents of the reaction.",
"items": {
"$ref": "#/$defs/ReactionReagent"
},
"title": "Reagents",
"type": "array"
},
"Products": {
"description": "The products of the reaction.",
"items": {
"$ref": "#/$defs/ReactionProduct"
},
"title": "Products",
"type": "array"
}
},
"required": [
"id"
],
"title": "Reaction",
"type": "object"
},
"ReactionBatchDataProject": {
"description": "The project a reaction batch task belongs to.",
"properties": {
"projectId": {
"description": "The Project ID (format ``PRO...``).",
"title": "Projectid",
"type": "string"
},
"projectName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The project name, when available.",
"title": "Projectname"
}
},
"required": [
"projectId"
],
"title": "ReactionBatchDataProject",
"type": "object"
},
"ReactionLot": {
"description": "The lot picked for a reagent of a reaction batch task.",
"properties": {
"lotId": {
"description": "The Lot ID of the picked lot (format ``LOT...``).",
"title": "Lotid",
"type": "string"
},
"inventoryId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Inventory ID the lot belongs to (format ``INV...``).",
"title": "Inventoryid"
},
"substanceId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The substance ID of the reagent.",
"title": "Substanceid"
},
"amt": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The amount of the lot consumed.",
"title": "Amt"
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit the consumed amount is expressed in.",
"title": "Unit"
},
"inventoryOnHand": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The remaining on-hand quantity of the lot.",
"title": "Inventoryonhand"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the lot.",
"title": "Albertid"
},
"lotNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The lot number.",
"title": "Lotnumber"
},
"parentName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the inventory item the lot belongs to.",
"title": "Parentname"
}
},
"required": [
"lotId"
],
"title": "ReactionLot",
"type": "object"
},
"ReactionProduct": {
"description": "A product of a reaction batch task, with its planned and actual amounts.",
"properties": {
"sttId": {
"description": "The substance ID of the product.",
"title": "Sttid",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name of the product.",
"title": "Name"
},
"subId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The sub ID assigned to the product.",
"title": "Subid"
},
"mw": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The molecular weight of the product.",
"title": "Mw"
},
"actual": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The actual amount of product obtained (the recorded yield).",
"title": "Actual"
},
"totalAmt": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The planned amount of the product.",
"title": "Totalamt"
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit amounts are expressed in.",
"title": "Unit"
},
"smiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The SMILES structure string of the product.",
"title": "Smiles"
},
"imageUrl": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The URL of the product's structure image.",
"title": "Imageurl"
}
},
"required": [
"sttId"
],
"title": "ReactionProduct",
"type": "object"
},
"ReactionReagent": {
"description": "A reagent of a reaction batch task, with its planned and picked amounts.",
"properties": {
"sttId": {
"description": "The substance ID of the reagent.",
"title": "Sttid",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The display name of the reagent.",
"title": "Name"
},
"function": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The role of the reagent in the reaction (e.g. solvent, catalyst).",
"title": "Function"
},
"isLimitingReagent": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the reagent limits the reaction yield.",
"title": "Islimitingreagent"
},
"eq": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The equivalents display string. Do not parse as a number.",
"title": "Eq"
},
"mw": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The molecular weight of the reagent.",
"title": "Mw"
},
"purity": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The purity of the reagent.",
"title": "Purity"
},
"totalAmt": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The planned amount of the reagent.",
"title": "Totalamt"
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit amounts are expressed in.",
"title": "Unit"
},
"totalUsed": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The amount of the reagent used so far (the picked lot amount).",
"title": "Totalused"
},
"smiles": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The SMILES structure string of the reagent.",
"title": "Smiles"
},
"imageUrl": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The URL of the reagent's structure image.",
"title": "Imageurl"
},
"Lot": {
"anyOf": [
{
"$ref": "#/$defs/ReactionLot"
},
{
"type": "null"
}
],
"default": null,
"description": "The lot picked for the reagent; ``None`` until a lot is picked."
}
},
"required": [
"sttId"
],
"title": "ReactionReagent",
"type": "object"
}
},
"description": "The reaction grid of a reaction batch task.\n\nPairs each reaction's reagents (with their picked lots) and products (with\ntheir actual amounts) for a reaction Batch Task. Retrieved with\n[`get_reaction`][albert.collections.batch_data.BatchDataCollection.get_reaction].\n\n(\ud83e\uddea Beta) Requires the reaction batch task feature to be enabled for the tenant.",
"properties": {
"taskId": {
"description": "The Task ID of the owning batch task (format ``TAS...``).",
"title": "Taskid",
"type": "string"
},
"state": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The state of the owning task (e.g. ``In Progress``); ``None`` when the task\nstate could not be read.",
"title": "State"
},
"locked": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the grid is read-only (the task is Completed or Closed).",
"title": "Locked"
},
"Project": {
"anyOf": [
{
"$ref": "#/$defs/ReactionBatchDataProject"
},
{
"type": "null"
}
],
"default": null,
"description": "The project the task belongs to, when it has one."
},
"Reactions": {
"description": "The reactions of the task; empty when the reaction snapshot has not been created.",
"items": {
"$ref": "#/$defs/Reaction"
},
"title": "Reactions",
"type": "array"
}
},
"required": [
"taskId"
],
"title": "ReactionBatchData",
"type": "object"
}
Fields:
-
task_id(str) -
state(str | None) -
locked(bool | None) -
project(ReactionBatchDataProject | None) -
reactions(list[Reaction])
state
state: str | None = None
The state of the owning task (e.g. In Progress); None when the task
state could not be read.
project
project: ReactionBatchDataProject | None = None
The project the task belongs to, when it has one.
ReactionLotPick
Bases: BaseAlbertModel
The lot picked for a reagent, with the amount consumed.
Example
Show JSON schema:
{
"description": "The lot picked for a reagent, with the amount consumed.\n\n!!! example\n ```python\n from albert.resources.batch_data import ReactionLotPick\n\n pick = ReactionLotPick(lot_id=\"LOT123\", amt=2.5, unit=\"g\")\n ```",
"properties": {
"lotId": {
"description": "The Lot ID to pick (format ``LOT...``). Required.",
"title": "Lotid",
"type": "string"
},
"inventoryId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Inventory ID the lot belongs to (format ``INV...``).",
"title": "Inventoryid"
},
"substanceId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The substance ID of the reagent.",
"title": "Substanceid"
},
"amt": {
"description": "The amount of the lot consumed. Required.",
"title": "Amt",
"type": "number"
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit the consumed amount is expressed in.",
"title": "Unit"
}
},
"required": [
"lotId",
"amt"
],
"title": "ReactionLotPick",
"type": "object"
}
Fields:
-
lot_id(LotId) -
inventory_id(InventoryId | None) -
substance_id(str | None) -
amt(float) -
unit(str | None)
inventory_id
inventory_id: InventoryId | None = None
The Inventory ID the lot belongs to (format INV...).
ReactionValueId
Bases: BaseAlbertModel
Locates a reagent or product row within a reaction of a reaction batch task.
Example
Show JSON schema:
{
"description": "Locates a reagent or product row within a reaction of a reaction batch task.\n\n!!! example\n ```python\n from albert.resources.batch_data import ReactionValueId\n\n location = ReactionValueId(reaction_id=\"RXN1826\", stt_id=\"STT1f13\")\n ```",
"properties": {
"reactionId": {
"description": "The reaction ID (format ``RXN...``).",
"title": "Reactionid",
"type": "string"
},
"sttId": {
"description": "The substance ID of the reagent or product.",
"title": "Sttid",
"type": "string"
}
},
"required": [
"reactionId",
"sttId"
],
"title": "ReactionValueId",
"type": "object"
}
Fields:
-
reaction_id(str) -
stt_id(str)
ReactionValuePatchDatum
Bases: BaseAlbertModel
A single change to a reagent or product of a reaction batch task.
The supported changes are:
- Pick a lot for a reagent:
operation="add",attribute="lot",new_valueaReactionLotPick. Picking a lot moves inventory immediately. One lot per reagent. - Remove the lot pick:
operation="delete",attribute="lot". - Change the picked amount:
operation="update",attribute="amt",new_valuea number. - Set a product's sub ID:
operation="update",attribute="subId",new_valuea string. - Record a product's actual yield:
operation="update",attribute="actual",new_valuea number (0is valid).
Example
Show JSON schema:
{
"$defs": {
"ReactionLotPick": {
"description": "The lot picked for a reagent, with the amount consumed.\n\n!!! example\n ```python\n from albert.resources.batch_data import ReactionLotPick\n\n pick = ReactionLotPick(lot_id=\"LOT123\", amt=2.5, unit=\"g\")\n ```",
"properties": {
"lotId": {
"description": "The Lot ID to pick (format ``LOT...``). Required.",
"title": "Lotid",
"type": "string"
},
"inventoryId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Inventory ID the lot belongs to (format ``INV...``).",
"title": "Inventoryid"
},
"substanceId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The substance ID of the reagent.",
"title": "Substanceid"
},
"amt": {
"description": "The amount of the lot consumed. Required.",
"title": "Amt",
"type": "number"
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit the consumed amount is expressed in.",
"title": "Unit"
}
},
"required": [
"lotId",
"amt"
],
"title": "ReactionLotPick",
"type": "object"
}
},
"description": "A single change to a reagent or product of a reaction batch task.\n\nThe supported changes are:\n\n- Pick a lot for a reagent: ``operation=\"add\"``, ``attribute=\"lot\"``,\n ``new_value`` a [`ReactionLotPick`][albert.resources.batch_data.ReactionLotPick].\n Picking a lot moves inventory immediately. One lot per reagent.\n- Remove the lot pick: ``operation=\"delete\"``, ``attribute=\"lot\"``.\n- Change the picked amount: ``operation=\"update\"``, ``attribute=\"amt\"``,\n ``new_value`` a number.\n- Set a product's sub ID: ``operation=\"update\"``, ``attribute=\"subId\"``,\n ``new_value`` a string.\n- Record a product's actual yield: ``operation=\"update\"``, ``attribute=\"actual\"``,\n ``new_value`` a number (``0`` is valid).\n\n!!! example\n ```python\n from albert.resources.batch_data import ReactionLotPick, ReactionValuePatchDatum\n\n pick = ReactionValuePatchDatum(\n operation=\"add\",\n attribute=\"lot\",\n new_value=ReactionLotPick(lot_id=\"LOT123\", amt=2.5, unit=\"g\"),\n )\n ```",
"properties": {
"operation": {
"description": "The kind of change to apply (``\"add\"``, ``\"update\"``, or ``\"delete\"``).",
"title": "Operation",
"type": "string"
},
"attribute": {
"description": "The field being changed (``\"lot\"``, ``\"amt\"``, ``\"subId\"``, or ``\"actual\"``).",
"title": "Attribute",
"type": "string"
},
"newValue": {
"anyOf": [
{
"$ref": "#/$defs/ReactionLotPick"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The new value for the change. A\n[`ReactionLotPick`][albert.resources.batch_data.ReactionLotPick] when picking a lot;\na number for ``amt``/``actual``; a string for ``subId``. Unused for ``delete``.",
"title": "Newvalue"
}
},
"required": [
"operation",
"attribute"
],
"title": "ReactionValuePatchDatum",
"type": "object"
}
Fields:
new_value
new_value: ReactionLotPick | float | str | None = None
The new value for the change. A
ReactionLotPick when picking a lot;
a number for amt/actual; a string for subId. Unused for delete.
ReactionValuePatchPayload
Bases: BaseAlbertModel
A batch of changes targeting one reagent or product of a reaction batch task.
Example
from albert.resources.batch_data import (
ReactionLotPick,
ReactionValueId,
ReactionValuePatchDatum,
ReactionValuePatchPayload,
)
patch = ReactionValuePatchPayload(
id=ReactionValueId(reaction_id="RXN1826", stt_id="STT1f13"),
data=[
ReactionValuePatchDatum(
operation="add",
attribute="lot",
new_value=ReactionLotPick(lot_id="LOT123", amt=2.5, unit="g"),
)
],
)
Show JSON schema:
{
"$defs": {
"ReactionLotPick": {
"description": "The lot picked for a reagent, with the amount consumed.\n\n!!! example\n ```python\n from albert.resources.batch_data import ReactionLotPick\n\n pick = ReactionLotPick(lot_id=\"LOT123\", amt=2.5, unit=\"g\")\n ```",
"properties": {
"lotId": {
"description": "The Lot ID to pick (format ``LOT...``). Required.",
"title": "Lotid",
"type": "string"
},
"inventoryId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Inventory ID the lot belongs to (format ``INV...``).",
"title": "Inventoryid"
},
"substanceId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The substance ID of the reagent.",
"title": "Substanceid"
},
"amt": {
"description": "The amount of the lot consumed. Required.",
"title": "Amt",
"type": "number"
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit the consumed amount is expressed in.",
"title": "Unit"
}
},
"required": [
"lotId",
"amt"
],
"title": "ReactionLotPick",
"type": "object"
},
"ReactionValueId": {
"description": "Locates a reagent or product row within a reaction of a reaction batch task.\n\n!!! example\n ```python\n from albert.resources.batch_data import ReactionValueId\n\n location = ReactionValueId(reaction_id=\"RXN1826\", stt_id=\"STT1f13\")\n ```",
"properties": {
"reactionId": {
"description": "The reaction ID (format ``RXN...``).",
"title": "Reactionid",
"type": "string"
},
"sttId": {
"description": "The substance ID of the reagent or product.",
"title": "Sttid",
"type": "string"
}
},
"required": [
"reactionId",
"sttId"
],
"title": "ReactionValueId",
"type": "object"
},
"ReactionValuePatchDatum": {
"description": "A single change to a reagent or product of a reaction batch task.\n\nThe supported changes are:\n\n- Pick a lot for a reagent: ``operation=\"add\"``, ``attribute=\"lot\"``,\n ``new_value`` a [`ReactionLotPick`][albert.resources.batch_data.ReactionLotPick].\n Picking a lot moves inventory immediately. One lot per reagent.\n- Remove the lot pick: ``operation=\"delete\"``, ``attribute=\"lot\"``.\n- Change the picked amount: ``operation=\"update\"``, ``attribute=\"amt\"``,\n ``new_value`` a number.\n- Set a product's sub ID: ``operation=\"update\"``, ``attribute=\"subId\"``,\n ``new_value`` a string.\n- Record a product's actual yield: ``operation=\"update\"``, ``attribute=\"actual\"``,\n ``new_value`` a number (``0`` is valid).\n\n!!! example\n ```python\n from albert.resources.batch_data import ReactionLotPick, ReactionValuePatchDatum\n\n pick = ReactionValuePatchDatum(\n operation=\"add\",\n attribute=\"lot\",\n new_value=ReactionLotPick(lot_id=\"LOT123\", amt=2.5, unit=\"g\"),\n )\n ```",
"properties": {
"operation": {
"description": "The kind of change to apply (``\"add\"``, ``\"update\"``, or ``\"delete\"``).",
"title": "Operation",
"type": "string"
},
"attribute": {
"description": "The field being changed (``\"lot\"``, ``\"amt\"``, ``\"subId\"``, or ``\"actual\"``).",
"title": "Attribute",
"type": "string"
},
"newValue": {
"anyOf": [
{
"$ref": "#/$defs/ReactionLotPick"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The new value for the change. A\n[`ReactionLotPick`][albert.resources.batch_data.ReactionLotPick] when picking a lot;\na number for ``amt``/``actual``; a string for ``subId``. Unused for ``delete``.",
"title": "Newvalue"
}
},
"required": [
"operation",
"attribute"
],
"title": "ReactionValuePatchDatum",
"type": "object"
}
},
"description": "A batch of changes targeting one reagent or product of a reaction batch task.\n\n!!! example\n ```python\n from albert.resources.batch_data import (\n ReactionLotPick,\n ReactionValueId,\n ReactionValuePatchDatum,\n ReactionValuePatchPayload,\n )\n\n patch = ReactionValuePatchPayload(\n id=ReactionValueId(reaction_id=\"RXN1826\", stt_id=\"STT1f13\"),\n data=[\n ReactionValuePatchDatum(\n operation=\"add\",\n attribute=\"lot\",\n new_value=ReactionLotPick(lot_id=\"LOT123\", amt=2.5, unit=\"g\"),\n )\n ],\n )\n ```",
"properties": {
"Id": {
"$ref": "#/$defs/ReactionValueId",
"description": "Locates the reagent or product to change."
},
"data": {
"description": "The individual changes to apply.",
"items": {
"$ref": "#/$defs/ReactionValuePatchDatum"
},
"title": "Data",
"type": "array"
}
},
"required": [
"Id",
"data"
],
"title": "ReactionValuePatchPayload",
"type": "object"
}
Fields:
ReactionCompleteResult
Bases: BaseAlbertModel
The outcome of completing a reaction batch task.
Completing a reaction task creates the output lot for the reaction product
and stamps the task completion date. Completion is idempotent: repeating it
returns the already-created output lot with replay set to True.
Show JSON schema:
{
"description": "The outcome of completing a reaction batch task.\n\nCompleting a reaction task creates the output lot for the reaction product\nand stamps the task completion date. Completion is idempotent: repeating it\nreturns the already-created output lot with ``replay`` set to ``True``.",
"properties": {
"taskId": {
"description": "The Task ID of the completed batch task (format ``TAS...``).",
"title": "Taskid",
"type": "string"
},
"reactionId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The reaction ID that was completed (format ``RXN...``).",
"title": "Reactionid"
},
"inventoryId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Inventory ID of the reaction output (format ``INV...``).",
"title": "Inventoryid"
},
"lotId": {
"description": "The Lot ID of the output lot (format ``LOT...``).",
"title": "Lotid",
"type": "string"
},
"inventoryOnHand": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The on-hand quantity of the output lot. Only set on the first completion.",
"title": "Inventoryonhand"
},
"replay": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "``True`` when the task was already completed and no new lot was created.",
"title": "Replay"
}
},
"required": [
"taskId",
"lotId"
],
"title": "ReactionCompleteResult",
"type": "object"
}
Fields:
-
task_id(str) -
reaction_id(str | None) -
inventory_id(str | None) -
lot_id(str) -
inventory_on_hand(str | None) -
replay(bool | None)
inventory_id
inventory_id: str | None = None
The Inventory ID of the reaction output (format INV...).
inventory_on_hand
inventory_on_hand: str | None = None
The on-hand quantity of the output lot. Only set on the first completion.
replay
replay: bool | None = None
True when the task was already completed and no new lot was created.