Property Data
albert.collections.property_data.PropertyDataCollection
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 |
|---|---|
get_properties_on_inventory |
Returns all the properties of an inventory item. |
add_properties_to_inventory |
Add new properties to an inventory item. |
update_property_on_inventory |
Update a property on an inventory item. |
get_task_block_properties |
Returns all the properties within a Property Task block for a specific inventory item. |
check_for_task_data |
Checks if a task has data. |
check_block_interval_for_data |
Check if a specific block interval has data. |
get_all_task_properties |
Collect task property data for block/inventory combinations in a task. |
update_property_on_task |
Updates a specific property on a task. |
void_task_data |
Void all property data for a task. |
unvoid_task_data |
Unvoid all property data for a task. |
void_interval_data |
Void all property data for a specific interval combination. |
unvoid_interval_data |
Unvoid all property data for a specific interval combination. |
void_trial_data |
Void property data for a specific trial in an interval combination. |
unvoid_trial_data |
Unvoid property data for a specific trial in an interval combination. |
add_properties_to_task |
Add new task properties for a given task. |
update_or_create_task_properties |
Update or create task properties for a given task. |
bulk_load_task_properties |
Bulk load task properties for a given task. WARNING: This will overwrite any existing properties! |
bulk_delete_task_data |
Bulk delete task data for a given task. |
search |
Search for property data with various filtering options. |
Attributes:
| Name | Type | Description |
|---|---|---|
base_path |
|
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
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
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
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
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 entities representing the data status of each block + inventory item of the task. |
Source code in src/albert/collections/property_data.py
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
|
CheckPropertyData 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, with_data_only: bool = False
) -> list[TaskPropertyData]
Collect task property data for block/inventory combinations in a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The ID of the task to retrieve properties for. |
required |
with_data_only
|
bool
|
When True, only return combinations actually having task data ( |
False
|
Returns:
| Type | Description |
|---|---|
list[TaskPropertyData]
|
Task property data for each block/inventory/lot combination. When
|
Source code in src/albert/collections/property_data.py
update_property_on_task
update_property_on_task(
*,
task_id: TaskId,
patch_payload: list[PropertyDataPatchDatum],
inventory_id: InventoryId | None = None,
block_id: BlockId | None = None,
lot_id: LotId | None = None,
return_scope: ReturnScope = "task",
) -> 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. ImagePropertyValue and CurvePropertyValue updates require update_or_create_task_properties. |
required |
inventory_id
|
InventoryId | None
|
Required when return_scope="block". |
None
|
block_id
|
BlockId | None
|
Required when return_scope="block". |
None
|
lot_id
|
LotId | None
|
Optional context for combo fetches. |
None
|
return_scope
|
Literal[task, block, none]
|
Controls the response. "task" (default) returns all task properties, "block" returns only the affected block/inventory/lot combination, and "none" skips fetching data. |
'task'
|
Returns:
| Type | Description |
|---|---|
list[TaskPropertyData]
|
A list of TaskPropertyData entities representing the properties within the task. |
Source code in src/albert/collections/property_data.py
void_task_data
void_task_data(
*,
task_id: TaskId,
inventory_id: InventoryId,
block_id: BlockId,
lot_id: LotId | None = None,
) -> None
Void all property data for a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The ID of the task. |
required |
inventory_id
|
InventoryId
|
The ID of the inventory item. |
required |
block_id
|
BlockId
|
The ID of the block. |
required |
lot_id
|
LotId | None
|
The ID of the lot, by default None. |
None
|
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/collections/property_data.py
unvoid_task_data
unvoid_task_data(
*,
task_id: TaskId,
inventory_id: InventoryId,
block_id: BlockId,
lot_id: LotId | None = None,
) -> None
Unvoid all property data for a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The ID of the task. |
required |
inventory_id
|
InventoryId
|
The ID of the inventory item. |
required |
block_id
|
BlockId
|
The ID of the block. |
required |
lot_id
|
LotId | None
|
The ID of the lot, by default None. |
None
|
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/collections/property_data.py
void_interval_data
void_interval_data(
*,
task_id: TaskId,
interval_id: str,
inventory_id: InventoryId,
block_id: BlockId,
lot_id: LotId | None = None,
data_template_id: DataTemplateId | None = None,
) -> None
Void all property data for a specific interval combination.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The ID of the task. |
required |
interval_id
|
str
|
The interval combination identifier ( |
required |
inventory_id
|
InventoryId
|
The ID of the inventory item. |
required |
block_id
|
BlockId
|
The ID of the block. |
required |
lot_id
|
LotId | None
|
The ID of the lot, by default None. |
None
|
data_template_id
|
DataTemplateId | None
|
When provided, limits the voiding to a specific data template. |
None
|
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/collections/property_data.py
unvoid_interval_data
unvoid_interval_data(
*,
task_id: TaskId,
interval_id: str,
inventory_id: InventoryId,
block_id: BlockId,
lot_id: LotId | None = None,
data_template_id: DataTemplateId | None = None,
) -> None
Unvoid all property data for a specific interval combination.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The ID of the task. |
required |
interval_id
|
str
|
The interval combination identifier ( |
required |
inventory_id
|
InventoryId
|
The ID of the inventory item. |
required |
block_id
|
BlockId
|
The ID of the block. |
required |
lot_id
|
LotId | None
|
The ID of the lot, by default None. |
None
|
data_template_id
|
DataTemplateId | None
|
When provided, limits the unvoiding to a specific data template. |
None
|
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/collections/property_data.py
void_trial_data
void_trial_data(
*,
task_id: TaskId,
interval_id: str,
trial_number: int,
inventory_id: InventoryId,
block_id: BlockId,
lot_id: LotId | None = None,
) -> None
Void property data for a specific trial in an interval combination.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The ID of the task. |
required |
interval_id
|
str
|
The interval combination identifier ( |
required |
trial_number
|
int
|
The trial number to void. |
required |
inventory_id
|
InventoryId
|
The ID of the inventory item. |
required |
block_id
|
BlockId
|
The ID of the block. |
required |
lot_id
|
LotId | None
|
The ID of the lot, by default None. |
None
|
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/collections/property_data.py
unvoid_trial_data
unvoid_trial_data(
*,
task_id: TaskId,
interval_id: str,
trial_number: int,
inventory_id: InventoryId,
block_id: BlockId,
lot_id: LotId | None = None,
) -> None
Unvoid property data for a specific trial in an interval combination.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
TaskId
|
The ID of the task. |
required |
interval_id
|
str
|
The interval combination identifier ( |
required |
trial_number
|
int
|
The trial number to unvoid. |
required |
inventory_id
|
InventoryId
|
The ID of the inventory item. |
required |
block_id
|
BlockId
|
The ID of the block. |
required |
lot_id
|
LotId | None
|
The ID of the lot, by default None. |
None
|
Returns:
| Type | Description |
|---|---|
None
|
|
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],
return_scope: ReturnScope = "task",
) -> list[TaskPropertyData]
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 entities representing the properties to add. |
required |
return_scope
|
Literal[task, block, none]
|
Controls the response. "task" (default) returns all task properties, "block" returns only the affected block/inventory/lot combination, and "none" skips fetching data. |
'task'
|
Returns:
| Type | Description |
|---|---|
list[TaskPropertyData]
|
The newly created task properties. |
Source code in src/albert/collections/property_data.py
638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 | |
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],
return_scope: ReturnScope = "task",
) -> 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 entities representing the properties to update or create. |
required |
return_scope
|
Literal[task, block, none]
|
Controls the response. "task" (default) returns all task properties, "block" returns only the affected block/inventory/lot combination, and "none" skips fetching data. |
'task'
|
Returns:
| Type | Description |
|---|---|
list[TaskPropertyData]
|
The updated or newly created task properties. |
Source code in src/albert/collections/property_data.py
735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 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 | |
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,
return_scope: ReturnScope = "task",
) -> 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 |
return_scope
|
Literal[task, block, none]
|
Controls the response. "task" (default) returns all task properties, "block" returns only the affected block/inventory/lot combination, and "none" skips fetching data. |
'task'
|
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
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 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 | |
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
search
search(
*,
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,
max_items: int | None = None,
) -> Iterator[PropertyDataSearchItem]
Search for property data with various filtering options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
str
|
Query using syntax, e.g. result=viscosity(<200)@temperature(25). |
None
|
text
|
str
|
Free text search across all fields. |
None
|
order
|
OrderBy
|
Sort order (ascending/descending). |
None
|
sort_by
|
str
|
Field to sort results by. |
None
|
inventory_ids
|
SearchInventoryId or list[SearchInventoryId]
|
Filter by inventory IDs. |
None
|
project_ids
|
SearchProjectId or list[SearchProjectId]
|
Filter by project IDs. |
None
|
lot_ids
|
LotId or list[LotId]
|
Filter by lot IDs. |
None
|
data_template_ids
|
DataTemplateId or list[DataTemplateId]
|
Filter by data template IDs. |
None
|
data_column_ids
|
DataColumnId or list[DataColumnId]
|
Filter by data column IDs. |
None
|
category
|
DataEntity or list[DataEntity]
|
Filter by data entity categories. |
None
|
data_templates
|
str or list[str]
|
Filter by data template names. |
None
|
data_columns
|
str or list[str]
|
Filter by data column names. |
None
|
parameters
|
str or list[str]
|
Filter by parameter names. |
None
|
parameter_group
|
str or list[str]
|
Filter by parameter group names. |
None
|
unit
|
str or list[str]
|
Filter by unit names. |
None
|
created_by
|
UserId or list[UserId]
|
Filter by user IDs who created the data. |
None
|
task_created_by
|
UserId or list[UserId]
|
Filter by user IDs who created the task. |
None
|
return_fields
|
str or list[str]
|
Specific fields to return. |
None
|
return_facets
|
str or list[str]
|
Specific facets to return. |
None
|
max_items
|
int
|
Maximum number of items to return in total. If None, fetches all available items. |
None
|
Returns:
| Type | Description |
|---|---|
Iterator[PropertyDataSearchItem]
|
An iterator of search results matching the specified filters. |
Source code in src/albert/collections/property_data.py
1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 | |