Property Data
albert.collections.property_data
DataColumnId
module-attribute
DataTemplateId
module-attribute
SearchInventoryId
module-attribute
SearchProjectId
module-attribute
AlbertSession
AlbertSession(
*,
base_url: str,
token: str | None = None,
client_credentials: ClientCredentials | None = None,
retries: int | None = None,
)
Bases: Session
A session that has a base URL, which is prefixed to all request URLs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base_url
|
str
|
The base URL to prefix to all requests. (e.g., "https://sandbox.albertinvent.com") |
required |
retries
|
int
|
The number of retries for failed requests. Defaults to 3. |
None
|
client_credentials
|
ClientCredentials | None
|
The client credentials for programmatic authentication. Optional if token is provided. |
None
|
token
|
str | None
|
The JWT token for authentication. Optional if client credentials are provided. |
None
|
Methods:
Name | Description |
---|---|
request |
|
Source code in src/albert/session.py
request
Source code in src/albert/session.py
BaseCollection
BaseCollection(*, session: AlbertSession)
BaseCollection is the base class for all collection classes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert API Session instance. |
required |
Source code in src/albert/collections/base.py
BulkPropertyData
Bases: BaseAlbertModel
A Simple Data Structure representing all the columns of data in a block's data column.
Methods:
Name | Description |
---|---|
from_dataframe |
Converts a DataFrame to a BulkPropertyData object. |
columns
class-attribute
instance-attribute
columns: list[BulkPropertyDataColumn] = Field(
default_factory=list,
description="The columns of data in the block's data column.",
)
from_dataframe
classmethod
from_dataframe(df: DataFrame) -> BulkPropertyData
Converts a DataFrame to a BulkPropertyData object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df
|
DataFrame
|
The DataFrame to convert. |
required |
Returns:
Type | Description |
---|---|
BulkPropertyData
|
The BulkPropertyData object that represents the data in the DataFrame. |
Source code in src/albert/resources/property_data.py
CheckPropertyData
Bases: BaseResource
block_id
class-attribute
instance-attribute
block_id: str | None = Field(default=None, alias='blockId')
data_exists
class-attribute
instance-attribute
data_exists: bool | None = Field(
default=None, alias="dataExist"
)
interval_id
class-attribute
instance-attribute
interval_id: str | None = Field(
default=None, alias="interval"
)
inventory_id
class-attribute
instance-attribute
inventory_id: str | None = Field(
default=None, alias="inventoryId"
)
DataEntity
EntityLink
Bases: BaseAlbertModel
Methods:
Name | Description |
---|---|
to_entity_link |
|
to_entity_link
to_entity_link() -> EntityLink
InventoryDataColumn
Bases: BaseAlbertModel
data_column_id
class-attribute
instance-attribute
data_column_id: DataColumnId | None = Field(
alias="id", default=None
)
InventoryPropertyData
Bases: BaseResource
custom_property_data
class-attribute
instance-attribute
inventory_name
class-attribute
instance-attribute
inventory_name: str | None = Field(
default=None, alias="inventoryName"
)
InventoryPropertyDataCreate
Bases: BaseResource
data_columns
class-attribute
instance-attribute
data_columns: list[InventoryDataColumn] = Field(
default_factory=list, max_length=1, alias="DataColumn"
)
NotFoundError
OrderBy
PropertyDataCollection
PropertyDataCollection(*, session: AlbertSession)
Bases: BaseCollection
PropertyDataCollection is a collection class for managing Property Data entities in the Albert platform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Methods:
Name | Description |
---|---|
add_properties_to_inventory |
Add new properties to an inventory item. |
add_properties_to_task |
Add new task properties for a given task. |
bulk_delete_task_data |
Bulk delete task data for a given task. |
bulk_load_task_properties |
Bulk load task properties for a given task. WARNING: This will overwrite any existing properties! |
check_block_interval_for_data |
Check if a specific block interval has data. |
check_for_task_data |
Checks if a task has data. |
get_all_task_properties |
Returns all the properties for a specific task. |
get_properties_on_inventory |
Returns all the properties of an inventory item. |
get_task_block_properties |
Returns all the properties within a Property Task block for a specific inventory item. |
search |
Search for property data with various filtering options. |
update_or_create_task_properties |
Update or create task properties for a given task. |
update_property_on_inventory |
Update a property on an inventory item. |
update_property_on_task |
Updates a specific property on a task. |
Source code in src/albert/collections/property_data.py
add_properties_to_inventory
add_properties_to_inventory(
*,
inventory_id: InventoryId,
properties: list[InventoryDataColumn],
) -> list[InventoryPropertyDataCreate]
Add new properties to an inventory item.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inventory_id
|
InventoryId
|
The ID of the inventory item to add properties to. |
required |
properties
|
list[InventoryDataColumn]
|
The properties to add. |
required |
Returns:
Type | Description |
---|---|
list[InventoryPropertyDataCreate]
|
The registered properties. |
Source code in src/albert/collections/property_data.py
add_properties_to_task
add_properties_to_task(
*,
inventory_id: InventoryId,
task_id: TaskId,
block_id: BlockId,
lot_id: LotId | None = None,
properties: list[TaskPropertyCreate],
)
Add new task properties for a given task.
This method only works for new values. If a trial number is provided in the TaskPropertyCreate, it must relate to an existing trial. New trials must be added with no trial number provided. Do not try to create multiple new trials in one call as this will lead to unexpected behavior. Build out new trials in a loop if many new trials are needed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inventory_id
|
InventoryId
|
The ID of the inventory. |
required |
task_id
|
TaskId
|
The ID of the task. |
required |
block_id
|
BlockId
|
The ID of the block. |
required |
lot_id
|
LotId
|
The ID of the lot, by default None. |
None
|
properties
|
list[TaskPropertyCreate]
|
A list of TaskPropertyCreate objects representing the properties to add. |
required |
Returns:
Type | Description |
---|---|
list[TaskPropertyData]
|
The newly created task properties. |
Source code in src/albert/collections/property_data.py
bulk_delete_task_data
bulk_delete_task_data(
*,
task_id: TaskId,
block_id: BlockId,
inventory_id: InventoryId,
lot_id: LotId | None = None,
interval_id=None,
) -> None
Bulk delete task data for a given task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id
|
TaskId
|
The ID of the task. |
required |
block_id
|
BlockId
|
The ID of the block. |
required |
inventory_id
|
InventoryId
|
The ID of the inventory. |
required |
lot_id
|
LotId
|
The ID of the lot, by default None. |
None
|
interval_id
|
IntervalId
|
The ID of the interval, by default None. If provided, will delete data for this specific interval. |
None
|
Returns:
Type | Description |
---|---|
None
|
|
Source code in src/albert/collections/property_data.py
bulk_load_task_properties
bulk_load_task_properties(
*,
inventory_id: InventoryId,
task_id: TaskId,
block_id: BlockId,
property_data: BulkPropertyData,
interval="default",
lot_id: LotId = None,
) -> list[TaskPropertyData]
Bulk load task properties for a given task. WARNING: This will overwrite any existing properties! BulkPropertyData column names must exactly match the names of the data columns (Case Sensitive).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inventory_id
|
InventoryId
|
The ID of the inventory. |
required |
task_id
|
TaskId
|
The ID of the task. |
required |
block_id
|
BlockId
|
The ID of the block. |
required |
lot_id
|
LotId
|
The ID of the lot, by default None. |
None
|
interval
|
str
|
The interval to use for the properties, by default "default". Can be obtained using Workflow.get_interval_id(). |
'default'
|
property_data
|
BulkPropertyData
|
A list of columnwise data containing all your rows of data for a single interval. Can be created using BulkPropertyData.from_dataframe(). |
required |
Returns:
Type | Description |
---|---|
list[TaskPropertyData]
|
The updated or newly created task properties. |
Example
from albert.resources.property_data import BulkPropertyData
data = BulkPropertyData.from_dataframe(df=my_dataframe)
res = client.property_data.bulk_load_task_properties(
block_id="BLK1",
inventory_id="INVEXP102748-042",
property_data=data,
task_id="TASFOR291760",
)
[TaskPropertyData(id="TASFOR291760", ...)]
Source code in src/albert/collections/property_data.py
455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 |
|
check_block_interval_for_data
check_block_interval_for_data(
*,
block_id: BlockId,
task_id: TaskId,
interval_id: IntervalId,
) -> CheckPropertyData
Check if a specific block interval has data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_id
|
BlockId
|
The ID of the block. |
required |
task_id
|
TaskId
|
The ID of the task. |
required |
interval_id
|
IntervalId
|
The ID of the interval. |
required |
Returns:
Type | Description |
---|---|
CheckPropertyData
|
description |
Source code in src/albert/collections/property_data.py
check_for_task_data
check_for_task_data(
*, task_id: TaskId
) -> list[CheckPropertyData]
Checks if a task has data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id
|
TaskId
|
The ID of the task to check for data. |
required |
Returns:
Type | Description |
---|---|
list[CheckPropertyData]
|
A list of CheckPropertyData objects representing the data status of each block + inventory item of the task. |
Source code in src/albert/collections/property_data.py
get_all_task_properties
get_all_task_properties(
*, task_id: TaskId
) -> list[TaskPropertyData]
Returns all the properties for a specific task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id
|
TaskId
|
The ID of the task to retrieve properties for. |
required |
Returns:
Type | Description |
---|---|
list[TaskPropertyData]
|
A list of TaskPropertyData objects representing the properties within the task. |
Source code in src/albert/collections/property_data.py
get_properties_on_inventory
get_properties_on_inventory(
*, inventory_id: InventoryId
) -> InventoryPropertyData
Returns all the properties of an inventory item.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inventory_id
|
InventoryId
|
The ID of the inventory item to retrieve properties for. |
required |
Returns:
Type | Description |
---|---|
InventoryPropertyData
|
The properties of the inventory item. |
Source code in src/albert/collections/property_data.py
get_task_block_properties
get_task_block_properties(
*,
inventory_id: InventoryId,
task_id: TaskId,
block_id: BlockId,
lot_id: LotId | None = None,
) -> TaskPropertyData
Returns all the properties within a Property Task block for a specific inventory item.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inventory_id
|
InventoryId
|
The ID of the inventory. |
required |
task_id
|
TaskId
|
The Property task ID. |
required |
block_id
|
BlockId
|
The Block ID of the block to retrieve properties for. |
required |
lot_id
|
LotId | None
|
The specific Lot of the inventory Item to retrieve lots for, by default None |
None
|
Returns:
Type | Description |
---|---|
TaskPropertyData
|
The properties of the inventory item within the block. |
Source code in src/albert/collections/property_data.py
search
search(
*,
limit: int = 100,
result: str | None = None,
text: str | None = None,
order: OrderBy | None = None,
sort_by: str | None = None,
inventory_ids: list[SearchInventoryId]
| SearchInventoryId
| None = None,
project_ids: list[SearchProjectId]
| SearchProjectId
| None = None,
lot_ids: list[LotId] | LotId | None = None,
data_template_ids: DataTemplateId
| list[DataTemplateId]
| None = None,
data_column_ids: DataColumnId
| list[DataColumnId]
| None = None,
category: list[DataEntity] | DataEntity | None = None,
data_templates: list[str] | str | None = None,
data_columns: list[str] | str | None = None,
parameters: list[str] | str | None = None,
parameter_group: list[str] | str | None = None,
unit: list[str] | str | None = None,
created_by: list[UserId] | UserId | None = None,
task_created_by: list[UserId] | UserId | None = None,
return_fields: list[str] | str | None = None,
return_facets: list[str] | str | None = None,
) -> Iterator[PropertyDataSearchItem]
Search for property data with various filtering options.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit
|
int
|
Maximum number of results to return. |
100
|
result
|
str
|
Find results using search syntax. e.g. to find all results with viscosity < 200 at a temperature of 25 we would do result=viscosity(<200)@temperature(25) |
None
|
text
|
str
|
Free text search across all searchable fields. |
None
|
order
|
OrderBy
|
Sort order (ascending/descending). |
None
|
sort_by
|
str
|
Field to sort results by. |
None
|
inventory_ids
|
SearchInventoryIdType or list of SearchInventoryIdType
|
Filter by inventory IDs. |
None
|
project_ids
|
ProjectIdType or list of ProjectIdType
|
Filter by project IDs. |
None
|
lot_ids
|
LotIdType or list of LotIdType
|
Filter by lot IDs. |
None
|
data_template_ids
|
DataTemplateId or list of DataTemplateId
|
Filter by data template IDs. |
None
|
data_column_ids
|
DataColumnId | list[DataColumnId] | None
|
Filter by data column IDs. |
None
|
category
|
DataEntity or list of DataEntity
|
Filter by data entity categories. |
None
|
data_templates
|
str or list of str (exact match)
|
Filter by data template names. |
None
|
data_columns
|
str or list of str (exact match)
|
Filter by data column names (currently non-functional). |
None
|
parameters
|
str or list of str (exact match)
|
Filter by parameter names. |
None
|
parameter_group
|
str or list of str (exact match)
|
Filter by parameter group names. |
None
|
unit
|
str or list of str (exact match)
|
Filter by unit names. |
None
|
created_by
|
UserIdType or list of UserIdType
|
Filter by creator user IDs. |
None
|
task_created_by
|
UserIdType or list of UserIdType
|
Filter by task creator user IDs. |
None
|
return_fields
|
str or list of str
|
Specific fields to include in results. If None, returns all fields. |
None
|
return_facets
|
str or list of str
|
Specific facets to include in results. |
None
|
Returns:
Type | Description |
---|---|
dict
|
Search results matching the specified criteria. |
Source code in src/albert/collections/property_data.py
783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 |
|
update_or_create_task_properties
update_or_create_task_properties(
*,
inventory_id: InventoryId,
task_id: TaskId,
block_id: BlockId,
lot_id: LotId | None = None,
properties: list[TaskPropertyCreate],
) -> list[TaskPropertyData]
Update or create task properties for a given task.
If a trial number is provided in the TaskPropertyCreate, it must relate to an existing trial. New trials must be added with no trial number provided. Do not try to create multiple new trials in one call as this will lead to unexpected behavior. Build out new trials in a loop if many new trials are needed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inventory_id
|
InventoryId
|
The ID of the inventory. |
required |
task_id
|
TaskId
|
The ID of the task. |
required |
block_id
|
BlockId
|
The ID of the block. |
required |
lot_id
|
LotId
|
The ID of the lot, by default None. |
None
|
properties
|
list[TaskPropertyCreate]
|
A list of TaskPropertyCreate objects representing the properties to update or create. |
required |
Returns:
Type | Description |
---|---|
list[TaskPropertyData]
|
The updated or newly created task properties. |
Source code in src/albert/collections/property_data.py
update_property_on_inventory
update_property_on_inventory(
*,
inventory_id: InventoryId,
property_data: InventoryDataColumn,
) -> InventoryPropertyData
Update a property on an inventory item.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inventory_id
|
InventoryId
|
The ID of the inventory item to update the property on. |
required |
property_data
|
InventoryDataColumn
|
The updated property data. |
required |
Returns:
Type | Description |
---|---|
InventoryPropertyData
|
The updated property data as returned by the server. |
Source code in src/albert/collections/property_data.py
update_property_on_task
update_property_on_task(
*,
task_id: TaskId,
patch_payload: list[PropertyDataPatchDatum],
) -> list[TaskPropertyData]
Updates a specific property on a task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id
|
TaskId
|
The ID of the task. |
required |
patch_payload
|
list[PropertyDataPatchDatum]
|
The specific patch to make to update the property. |
required |
Returns:
Type | Description |
---|---|
list[TaskPropertyData]
|
A list of TaskPropertyData objects representing the properties within the task. |
Source code in src/albert/collections/property_data.py
PropertyDataPatchDatum
Bases: PatchDatum
property_column_id
class-attribute
instance-attribute
property_column_id: DataColumnId | PropertyDataId = Field(
alias="id"
)
PropertyDataSearchItem
Bases: BaseAlbertModel
data_template_id
class-attribute
instance-attribute
data_template_id: DataTemplateId = Field(
..., alias="dataTemplateId"
)
data_template_name
class-attribute
instance-attribute
data_template_name: str = Field(
..., alias="dataTemplateName"
)
inventory_id
class-attribute
instance-attribute
inventory_id: InventoryId = Field(..., alias='inventoryId')
parent_id
class-attribute
instance-attribute
parent_id: TaskId | InventoryId = Field(
..., alias="parentId"
)
task_id
class-attribute
instance-attribute
task_id: TaskId | None = Field(default=None, alias="taskId")
workflow_id
class-attribute
instance-attribute
workflow_id: WorkflowId = Field(..., alias='workflowId')
workflow_name
class-attribute
instance-attribute
workflow_name: str | None = Field(
default=None, alias="workflowName"
)
PropertyTask
Bases: BaseTask
Represents a batch task.
This class is used to create and manage batch tasks. It includes the base task attributes and additional attributes specific to batch tasks.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the batch task. |
inventory_information |
list[InventoryInformation]
|
Information about the inventory associated with the batch task. |
location |
SerializeAsEntityLink[Location]
|
The location where the batch task is performed. |
parent_id |
str
|
The ID of the parent project. |
blocks |
list[Block]
|
A list of blocks associated with the batch task. |
id |
(str, optional)
|
The ID of the batch task, by default None. |
metadata |
(dict[str, MetadataItem], optional)
|
Metadata associated with the batch task, by default an empty dictionary. |
due_date |
(str, optional)
|
The due date of the batch task. YYY-MM-DD format, by default None. |
notes |
(str, optional)
|
Notes associated with the batch task, by default None. |
priority |
(TaskPriority, optional)
|
The priority of the batch task, by default None. |
assigned_to |
(SerializeAsEntityLink[User], optional)
|
The user assigned to the batch task, by default None. |
state |
(TaskState, optional)
|
The state of the batch task, by default None. |
sources |
(list[TaskSource], optional)
|
A list of sources associated with the batch task, by default an empty list. |
security_class |
(SecurityClass, optional)
|
The security class of the batch task, by default None. |
start_date |
str, read only
|
The start date of the batch task, by default None. |
claimed_date |
str, read only
|
The claimed date of the batch task, by default None. |
completed_date |
str, read only
|
The completed date of the batch task, by default None. |
closed_date |
str, read only
|
The closed date of the batch task, by default None. |
batch_task_id
class-attribute
instance-attribute
batch_task_id: str | None = Field(
alias="batchTaskId", default=None
)
blocks
class-attribute
instance-attribute
blocks: list[Block] | None = Field(
alias="Blocks", default=None
)
qc_task
class-attribute
instance-attribute
qc_task: bool | None = Field(alias='qcTask', default=None)
PropertyValue
Bases: BaseAlbertModel
data_column_unique_id
class-attribute
instance-attribute
data_column_unique_id: str | None = Field(
default=None, alias="dataColumnUniqueId"
)
numeric_value
class-attribute
instance-attribute
numeric_value: float | None = Field(
default=None, alias="valueNumeric"
)
property_data
class-attribute
instance-attribute
string_value
class-attribute
instance-attribute
string_value: str | None = Field(
default=None, alias="valueString"
)
unit
class-attribute
instance-attribute
TaskCollection
TaskCollection(*, session: AlbertSession)
Bases: BaseCollection
TaskCollection is a collection class for managing Task entities in the Albert platform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert Session information |
required |
Methods:
Name | Description |
---|---|
add_block |
Add a block to a Property task. |
create |
Create a new task. Tasks can be of different types, such as PropertyTask, and are created using the provided task object. |
delete |
Delete a task. |
get_by_id |
Retrieve a task by its ID. |
get_history |
|
list |
Search for tasks matching the given criteria. |
remove_block |
Remove a block from a Property task. |
update |
Update a task. |
update_block_workflow |
Update the workflow of a specific block within a task. |
Source code in src/albert/collections/tasks.py
add_block
add_block(
*,
task_id: TaskId,
data_template_id: DataTemplateId,
workflow_id: WorkflowId,
) -> None
Add a block to a Property task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id
|
TaskId
|
The ID of the task to add the block to. |
required |
data_template_id
|
DataTemplateId
|
The ID of the data template to use for the block. |
required |
workflow_id
|
WorkflowId
|
The ID of the workflow to assign to the block. |
required |
Returns:
Type | Description |
---|---|
None
|
This method does not return any value. |
Source code in src/albert/collections/tasks.py
create
Create a new task. Tasks can be of different types, such as PropertyTask, and are created using the provided task object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task
|
BaseTask
|
The task object to create. |
required |
Returns:
Type | Description |
---|---|
BaseTask
|
The registered task object. |
Source code in src/albert/collections/tasks.py
delete
delete(*, id: TaskId) -> None
Delete a task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
TaskId
|
The ID of the task to delete. |
required |
get_by_id
Retrieve a task by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
TaskId
|
The ID of the task to retrieve. |
required |
Returns:
Type | Description |
---|---|
BaseTask
|
The task object with the provided ID. |
Source code in src/albert/collections/tasks.py
get_history
get_history(
*,
id: TaskId,
order: OrderBy = DESCENDING,
limit: int = 1000,
entity: HistoryEntity | None = None,
blockId: str | None = None,
startKey: str | None = None,
) -> TaskHistory
Source code in src/albert/collections/tasks.py
list
list(
*,
order: OrderBy = DESCENDING,
text: str | None = None,
sort_by: str | None = None,
tags: list[str] | None = None,
task_id: list[str] | None = None,
linked_task: list[str] | None = None,
category: TaskCategory | None = None,
albert_id: list[str] | None = None,
data_template: list[str] | None = None,
assigned_to: list[str] | None = None,
location: list[str] | None = None,
priority: list[str] | None = None,
status: list[str] | None = None,
parameter_group: list[str] | None = None,
created_by: list[str] | None = None,
project_id: str | None = None,
limit: int = 100,
offset: int = 0,
) -> Iterator[BaseTask]
Search for tasks matching the given criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order
|
OrderBy
|
The order in which to return results, by default OrderBy.DESCENDING |
DESCENDING
|
text
|
str | None
|
The text to search for, by default None |
None
|
sort_by
|
str | None
|
The attribute to sort by, by default None |
None
|
tags
|
list[str] | None
|
The tags to search for, by default None |
None
|
task_id
|
list[str] | None
|
The related task IDs to search for, by default None |
None
|
linked_task
|
list[str] | None
|
The Linked Task IDs to search for, by default None |
None
|
category
|
TaskCategory | None
|
The category of the task to search for, by default None |
None
|
albert_id
|
list[str] | None
|
The Albert IDs to search for, by default None |
None
|
data_template
|
list[str] | None
|
The data template IDs to search for, by default None |
None
|
assigned_to
|
list[str] | None
|
The User IDs to search for, by default None |
None
|
location
|
list[str] | None
|
The Locations names to search for, by default None |
None
|
priority
|
list[str] | None
|
The Priority levels to search for, by default None |
None
|
status
|
list[str] | None
|
The Task Statuses to search for, by default None |
None
|
parameter_group
|
list[str] | None
|
The related Parameter Group IDs to search for, by default None |
None
|
created_by
|
list[str] | None
|
The User IDs of the task creators to search for, by default None |
None
|
project_id
|
str | None
|
The Project ID to search for, by default None |
None
|
Yields:
Type | Description |
---|---|
Iterator[BaseTask]
|
An iterator of matching Task objects. |
Source code in src/albert/collections/tasks.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
|
remove_block
Remove a block from a Property task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id
|
str
|
ID of the Task to remove the block from (e.g., TASFOR1234) |
required |
block_id
|
str
|
ID of the Block to remove (e.g., BLK1) |
required |
Returns:
Type | Description |
---|---|
None
|
|
Source code in src/albert/collections/tasks.py
update
Update a task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task
|
BaseTask
|
The updated Task object. |
required |
Returns:
Type | Description |
---|---|
BaseTask
|
The updated Task object as it exists in the Albert platform. |
Source code in src/albert/collections/tasks.py
update_block_workflow
update_block_workflow(
*,
task_id: TaskId,
block_id: BlockId,
workflow_id: WorkflowId,
) -> None
Update the workflow of a specific block within a task.
This method updates the workflow of a specified block within a task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id
|
str
|
The ID of the task. |
required |
block_id
|
str
|
The ID of the block within the task. |
required |
workflow_id
|
str
|
The ID of the new workflow to be assigned to the block. |
required |
Returns:
Type | Description |
---|---|
None
|
This method does not return any value. |
Notes
- The method asserts that the retrieved task is an instance of
PropertyTask
. - If the block's current workflow matches the new workflow ID, no update is performed.
- The method handles the case where the block has a default workflow named "No Parameter Group".
Source code in src/albert/collections/tasks.py
TaskDataColumn
Bases: BaseAlbertModel
column_sequence
class-attribute
instance-attribute
column_sequence: str | None = Field(
default=None, alias="columnId"
)
TaskPropertyCreate
Bases: BaseResource
Represents a task property to be created.
This class is used to create new task properties. Users can use the Workflowe.get_interval_id
method to find the correct interval given the names and setpoints of the parameters.
Notes
- Users can use
Workflow.get_interval_id(parameter_values={"name1":"value1", "name2":"value2"})
to find the correct interval given the names and setpoints of the parameters. - Leave
trial_number
blank to create a new row/trial. visible_trial_number
can be used to set the relative row number, allowing you to pass multiple rows of data at once.
Methods:
Name | Description |
---|---|
set_visible_trial_number |
|
data_column
class-attribute
instance-attribute
data_column: TaskDataColumn = Field(
...,
alias="DataColumns",
description="The data column associated with the task property.",
)
data_template
class-attribute
instance-attribute
data_template: SerializeAsEntityLink[DataTemplate] = Field(
...,
alias="DataTemplate",
description="The data template associated with the task property.",
)
entity
class-attribute
instance-attribute
entity: Literal[TASK] = Field(
default=TASK,
description="The entity type, which is always `DataEntity.TASK` for task properties.",
)
interval_combination
class-attribute
instance-attribute
interval_combination: str = Field(
alias="intervalCombination",
examples=["default", "ROW4XROW2", "ROW2"],
default="default",
description="The interval combination, which can be found using `Workflow.get_interval_id`.",
)
trial_number
class-attribute
instance-attribute
trial_number: int = Field(
alias="trialNo",
default=None,
description="The trial number/ row number. Leave blank to create a new row/trial.",
)
value
class-attribute
instance-attribute
value: str | None = Field(
default=None,
description="The value of the task property.",
)
visible_trial_number
class-attribute
instance-attribute
visible_trial_number: int | None = Field(
alias="visibleTrialNo",
default=None,
description="Can be used to set the relative row number, allowing you to pass multiple rows of data at once.",
)
set_visible_trial_number
set_visible_trial_number() -> TaskPropertyCreate
Source code in src/albert/resources/property_data.py
TaskPropertyData
Bases: BaseResource
block_id
class-attribute
instance-attribute
block_id: str | None = Field(alias='blockId', default=None)
data
class-attribute
instance-attribute
data: list[DataInterval] = Field(
alias="Data", frozen=True, exclude=True
)
data_template
class-attribute
instance-attribute
data_template: (
SerializeAsEntityLink[DataTemplate] | None
) = Field(default=None, alias="DataTemplate")
finial_workflow
class-attribute
instance-attribute
finial_workflow: SerializeAsEntityLink[Workflow] | None = (
Field(default=None, alias="FinalWorkflow")
)
initial_workflow
class-attribute
instance-attribute
initial_workflow: SerializeAsEntityLink[Workflow] | None = (
Field(default=None, alias="InitialWorkflow")
)
inventory
class-attribute
instance-attribute
Trial
Bases: BaseAlbertModel
data_columns
class-attribute
instance-attribute
data_columns: list[PropertyValue] = Field(
default_factory=list, alias="DataColumns"
)
visible_trial_number
class-attribute
instance-attribute
visible_trial_number: int = Field(
default=1, alias="visibleTrialNo"
)