Skip to content

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.

Example

from albert.resources.batch_data import BatchValuePatchDatum

datum = BatchValuePatchDatum(
    operation="update",
    new_value="LOT123",
    old_value="LOT100",
)
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\n!!! example\n    ```python\n    from albert.resources.batch_data import BatchValuePatchDatum\n\n    datum = BatchValuePatchDatum(\n        operation=\"update\",\n        new_value=\"LOT123\",\n        old_value=\"LOT100\",\n    )\n    ```",
  "properties": {
    "attribute": {
      "default": "lotId",
      "description": "The field being changed. Defaults to ``\"lotId\"``.",
      "title": "Attribute",
      "type": "string"
    },
    "lotId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The lot identifier being assigned, when applicable.",
      "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_id

lot_id: str | None = None

The lot identifier being assigned, when applicable.

new_value

new_value: str | None = None

The new value to set for the attribute.

old_value

old_value: str | None = None

The previous value being replaced, when performing an update.

operation

operation: str

The kind of change to apply (e.g. "add", "update", "delete").

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

from albert.resources.batch_data import BatchValueId

location = BatchValueId(row_id="ROW1", col_id="COL9999999")
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:

col_id

col_id: str | None = None

The identifier of the product column the value belongs to.

row_id

row_id: str

The identifier of the row the value belongs to. Required.

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,
)

patch = BatchValuePatchPayload(
    id=BatchValueId(row_id="ROW1", col_id="COL9999999"),
    data=[BatchValuePatchDatum(operation="update", new_value="LOT123")],
)
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\n!!! example\n    ```python\n    from albert.resources.batch_data import BatchValuePatchDatum\n\n    datum = BatchValuePatchDatum(\n        operation=\"update\",\n        new_value=\"LOT123\",\n        old_value=\"LOT100\",\n    )\n    ```",
      "properties": {
        "attribute": {
          "default": "lotId",
          "description": "The field being changed. Defaults to ``\"lotId\"``.",
          "title": "Attribute",
          "type": "string"
        },
        "lotId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The lot identifier being assigned, when applicable.",
          "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    patch = BatchValuePatchPayload(\n        id=BatchValueId(row_id=\"ROW1\", col_id=\"COL9999999\"),\n        data=[BatchValuePatchDatum(operation=\"update\", new_value=\"LOT123\")],\n    )\n    ```",
  "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": "The lot identifier associated with the change, when applicable.",
      "title": "Lotid"
    }
  },
  "required": [
    "Id"
  ],
  "title": "BatchValuePatchPayload",
  "type": "object"
}

Fields:

id

Locates the cell to change (its row and optional column).

data

The individual changes to apply to that cell.

lot_id

lot_id: str | None = None

The lot identifier associated with the change, when applicable.

BatchDataType

Bases: str, Enum

The kind of identifier used to look up batch data.

Attributes:

Name Type Description
TASK_ID str

Look up batch data by the Task ID of its owning Batch Task.

TASK_ID

TASK_ID = 'taskId'

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

id: str | None = None

The identifier of the value.

col_id

col_id: str | None = None

The identifier of the product column this value belongs to.

type

type: str | None = None

The type of the value.

name

name: str | None = None

The display name associated with the value.

value

value: str | None = None

The recorded amount.

is_editable

is_editable: bool | None = None

Whether the value can be edited.

unit_category

unit_category: str | None = None

The category of unit the value is expressed in.

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

id: str | None = None

The identifier of the row.

row_id

row_id: str | None = None

The row identifier used to locate values (see BatchValueId).

type

type: str | None = None

The type of the row.

name

name: str | None = None

The name of the component the row represents.

manufacturer

manufacturer: str | None = None

The manufacturer of the component, when known.

unit_category

unit_category: str | None = None

The category of unit the row's amounts are expressed in.

category

category: str | None = None

The category of the component.

is_formula

is_formula: bool | None = None

Whether the row represents a formula (as opposed to a raw material).

is_lot_parent

is_lot_parent: bool | None = None

Whether the row groups lots as a parent row.

values

The recorded amounts for this row, one per product column.

child_rows

child_rows: list[BatchDataRow]

Nested rows, e.g. the components of a sub-formula.

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

id: str | None = None

The identifier of the column.

name

name: str | None = None

The name of the product/batch.

col_id

col_id: str | None = None

The column identifier used to locate values (see BatchValueId).

batch_total

batch_total: str | None = None

The total amount recorded for the batch.

reference_total

reference_total: str | None = None

The reference total the batch is compared against.

status

status: Status | None = None

The status of the column.

product_total

product_total: float | None = None

The total amount of product produced.

parent_id

parent_id: str | None = None

The identifier of the parent column, when this column is a lot.

design_col_id

design_col_id: str | None = None

The identifier of the corresponding design column.

lots

The individual lot columns that make up this product column.

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 row entries in the batch data.",
      "title": "Size"
    },
    "lastKey": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Pagination cursor for fetching the next page of rows; 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:

id

id: TaskId | None = None

The Task ID of the owning batch task (format TAS...).

size

size: int | None = None

The number of row entries in the batch data.

last_key

last_key: str | None = None

Pagination cursor for fetching the next page of rows; 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.

rows

rows: list[BatchDataRow] | None = None

The formulation component rows.