Parameter Groups
albert.collections.parameter_groups.ParameterGroupCollection
Bases: BaseCollection
Manage Parameter Groups in the Albert platform.
A Parameter Group (PRG, IDs formatted PRG...) is a reusable set of
Parameter entities together with their
values, units, and validation rules. Whereas a Data Template's parameters
always relate to a given measurement, a Parameter Group is about making the
sample and/or prepping it for measurement (e.g. a mixing step, a cure
schedule). Some Parameter Groups drive Batch Tasks
(BatchTask); others are stacked within a task.
The group's PGType records which kind of task the group relates to.
A Parameter Group's parameters, together with a Data Template's parameters,
are fixed to setpoints inside a Workflow.
Test standards (e.g. ASTM or ISO) are stored under the "Standards" key of
a group's metadata.
This collection is accessed as client.parameter_groups.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The authenticated Albert session used for API calls. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
base_path |
str
|
The base API route for parameter group requests. |
Methods:
| Name | Description |
|---|---|
create |
Create a new parameter group. |
get_by_id |
Get a single fully populated group by its ID. |
get_by_ids |
Get many groups by their IDs in batches. |
get_by_name |
Get a single group by exact (case-insensitive) name. |
search |
Fast, lightweight search returning partial groups (best for lookups/counts). |
get_all |
Same filters as search, but returns fully populated groups (slower). |
update |
Update an existing group. |
delete |
Delete a group by its ID. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The authenticated Albert session used for API calls. |
required |
Source code in src/albert/collections/parameter_groups.py
get_by_id
get_by_id(*, id: ParameterGroupId) -> ParameterGroup
Get a single, fully populated parameter group by its ID.
For retrieving many groups at once, use get_by_ids. To find groups
without knowing their IDs, use search, get_all, or
get_by_name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
ParameterGroupId
|
The Parameter Group ID (format |
required |
Returns:
| Type | Description |
|---|---|
ParameterGroup
|
The fully populated parameter group. |
Source code in src/albert/collections/parameter_groups.py
get_by_ids
get_by_ids(
*, ids: list[ParameterGroupId]
) -> list[ParameterGroup]
Get multiple fully populated parameter groups by their IDs.
Requests are automatically split into batches, so arbitrarily long ID lists are supported. Groups not found are omitted from the result.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ids
|
list[ParameterGroupId]
|
The Parameter Group IDs to retrieve (format |
required |
Returns:
| Type | Description |
|---|---|
list[ParameterGroup]
|
The matching parameter groups. Order is not guaranteed to match the input. |
Source code in src/albert/collections/parameter_groups.py
search
search(
*,
text: str | None = None,
types: PGType | list[PGType] | None = None,
owner: str | list[str] | None = None,
tags: str | list[str] | None = None,
parameters: str | list[str] | None = None,
additional_field: str | list[str] | None = None,
created_by: str | list[str] | None = None,
from_created_at: str | None = None,
to_created_at: str | None = None,
updated_by: str | list[str] | None = None,
from_updated_at: str | None = None,
to_updated_at: str | None = None,
metadata_filters: dict[str, Any] | None = None,
user_id: UserId | None = None,
is_drop_down: bool | None = None,
sort_by: str | None = None,
data_template: list[str] | None = None,
parameter_group: str | None = None,
source_field: list[str] | None = None,
contains_field: str | list[str] | None = None,
contains_text: str | list[str] | None = None,
facet_text: str | None = None,
facet_field: str | None = None,
is_sam: bool | None = None,
search_query_string: str | None = None,
custom_fields: dict[str, Any] | None = None,
order_by: OrderBy = DESCENDING,
offset: int | None = None,
max_items: int | None = None,
) -> Iterator[ParameterGroupSearchItem]
Search for parameter groups matching the given filters.
Returns lightweight, partially populated results and is the fastest way to
look groups up (best for name lookups, counts, or feeding IDs into another
call). When you need complete groups, use get_all with the same
filters, or pass the resulting IDs to get_by_ids. Results are
returned as a lazily paginated iterator, so iterating fetches additional
pages on demand.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Free-text query matched against group name and related fields. |
None
|
types
|
PGType or list[PGType]
|
Filter by parameter group type ( |
None
|
owner
|
str or list[str]
|
Filter by owner name(s). |
None
|
tags
|
str or list[str]
|
Filter by tag name(s). |
None
|
parameters
|
str or list[str]
|
Filter by parameter name(s). |
None
|
additional_field
|
str or list[str]
|
Additional fields to include on each returned search item. If omitted, a default set (ACL, creation info, metadata, owner, tags, and team) is requested. |
None
|
created_by
|
str or list[str]
|
Filter by creator. Accepts user display name(s) or UserId(s) (e.g.
|
None
|
from_created_at
|
str
|
Only include groups created on or after this date (ISO 8601). |
None
|
to_created_at
|
str
|
Only include groups created on or before this date (ISO 8601). |
None
|
updated_by
|
str or list[str]
|
Filter by user(s) who last updated the group. Accepts UserId(s) only
(e.g. |
None
|
from_updated_at
|
str
|
Only include groups updated on or after this date (ISO 8601). |
None
|
to_updated_at
|
str
|
Only include groups updated on or before this date (ISO 8601). |
None
|
metadata_filters
|
dict[str, Any]
|
Filter by custom field (metadata) values. |
None
|
user_id
|
UserId
|
Filter by the ID of an associated user. |
None
|
is_drop_down
|
bool
|
When True, apply smart dropdown search behavior. |
None
|
sort_by
|
str
|
Attribute to sort results by. |
None
|
data_template
|
list[str]
|
Filter by data template name(s) for smart dropdown search. |
None
|
parameter_group
|
str
|
Filter by parameter group name for smart dropdown search. |
None
|
source_field
|
list[str]
|
Restrict which fields are returned in search results. |
None
|
contains_field
|
str or list[str]
|
Field(s) to apply a "contains" search to. |
None
|
contains_text
|
str or list[str]
|
Text value(s) for the "contains" search. |
None
|
facet_text
|
str
|
Text to match within a facet search. |
None
|
facet_field
|
str
|
Field to search within for facet filtering. |
None
|
is_sam
|
bool
|
When True, filter to equipment-linked parameter groups. |
None
|
search_query_string
|
str
|
Filter by custom field query string. |
None
|
custom_fields
|
dict[str, Any]
|
Filter by custom field values. |
None
|
order_by
|
OrderBy
|
Sort direction. Default |
DESCENDING
|
max_items
|
int
|
Maximum number of items to return in total. If None, iterates over all matches. |
None
|
Yields:
| Type | Description |
|---|---|
ParameterGroupSearchItem
|
Partially populated search results. Call |
Source code in src/albert/collections/parameter_groups.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 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 340 341 342 343 344 345 346 347 | |
get_all
get_all(
*,
text: str | None = None,
types: PGType | list[PGType] | None = None,
owner: str | list[str] | None = None,
tags: str | list[str] | None = None,
parameters: str | list[str] | None = None,
additional_field: str | list[str] | None = None,
created_by: str | list[str] | None = None,
from_created_at: str | None = None,
to_created_at: str | None = None,
updated_by: str | list[str] | None = None,
from_updated_at: str | None = None,
to_updated_at: str | None = None,
metadata_filters: dict[str, Any] | None = None,
user_id: UserId | None = None,
is_drop_down: bool | None = None,
sort_by: str | None = None,
data_template: list[str] | None = None,
parameter_group: str | None = None,
source_field: list[str] | None = None,
contains_field: str | list[str] | None = None,
contains_text: str | list[str] | None = None,
facet_text: str | None = None,
facet_field: str | None = None,
is_sam: bool | None = None,
search_query_string: str | None = None,
custom_fields: dict[str, Any] | None = None,
order_by: OrderBy = DESCENDING,
offset: int | None = None,
max_items: int | None = None,
) -> Iterator[ParameterGroup]
Get fully populated parameter groups matching the given filters.
Accepts the same filters as search but returns complete
ParameterGroup entities rather than lightweight search results.
This is slower because it fetches full detail for every match, so prefer
search when you only need names, IDs, or counts. Results are
returned as a lazily paginated iterator.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Free-text query matched against group name and related fields. |
None
|
types
|
PGType or list[PGType]
|
Filter by parameter group type ( |
None
|
owner
|
str or list[str]
|
Filter by owner name(s). |
None
|
tags
|
str or list[str]
|
Filter by tag name(s). |
None
|
parameters
|
str or list[str]
|
Filter by parameter name(s). |
None
|
additional_field
|
str or list[str]
|
Additional fields to include on each returned search item. If omitted, a default set (ACL, creation info, metadata, owner, tags, and team) is requested. |
None
|
created_by
|
str or list[str]
|
Filter by creator. Accepts user display name(s) or UserId(s) (e.g.
|
None
|
from_created_at
|
str
|
Only include groups created on or after this date (ISO 8601). |
None
|
to_created_at
|
str
|
Only include groups created on or before this date (ISO 8601). |
None
|
updated_by
|
str or list[str]
|
Filter by user(s) who last updated the group. Accepts UserId(s) only
(e.g. |
None
|
from_updated_at
|
str
|
Only include groups updated on or after this date (ISO 8601). |
None
|
to_updated_at
|
str
|
Only include groups updated on or before this date (ISO 8601). |
None
|
metadata_filters
|
dict[str, Any]
|
Filter by custom field (metadata) values. |
None
|
user_id
|
UserId
|
Filter by the ID of an associated user. |
None
|
is_drop_down
|
bool
|
When True, apply smart dropdown search behavior. |
None
|
sort_by
|
str
|
Attribute to sort results by. |
None
|
data_template
|
list[str]
|
Filter by data template name(s) for smart dropdown search. |
None
|
parameter_group
|
str
|
Filter by parameter group name for smart dropdown search. |
None
|
source_field
|
list[str]
|
Restrict which fields are returned in search results. |
None
|
contains_field
|
str or list[str]
|
Field(s) to apply a "contains" search to. |
None
|
contains_text
|
str or list[str]
|
Text value(s) for the "contains" search. |
None
|
facet_text
|
str
|
Text to match within a facet search. |
None
|
facet_field
|
str
|
Field to search within for facet filtering. |
None
|
is_sam
|
bool
|
When True, filter to equipment-linked parameter groups. |
None
|
search_query_string
|
str
|
Filter by custom field query string. |
None
|
custom_fields
|
dict[str, Any]
|
Filter by custom field values. |
None
|
order_by
|
OrderBy
|
Sort direction. Default |
DESCENDING
|
max_items
|
int
|
Maximum number of items to return in total. If None, iterates over all matches. |
None
|
Returns:
| Type | Description |
|---|---|
Iterator[ParameterGroup]
|
Fully populated parameter groups. Preserves |
Source code in src/albert/collections/parameter_groups.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 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 | |
delete
delete(*, id: ParameterGroupId) -> None
Delete a parameter group by its ID.
This permanently removes the parameter group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
ParameterGroupId
|
The Parameter Group ID to delete (format |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/collections/parameter_groups.py
create
create(
*, parameter_group: ParameterGroup
) -> ParameterGroup
Create a new parameter group.
Build a ParameterGroup with a name, a PGType, and a
list of ParameterValue entries, then pass it here. Each
ParameterValue must reference an existing
Parameter (by id or parameter).
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parameter_group
|
ParameterGroup
|
The parameter group to create. |
required |
Returns:
| Type | Description |
|---|---|
ParameterGroup
|
The newly created group, populated with its assigned Parameter Group ID. |
Source code in src/albert/collections/parameter_groups.py
get_by_name
get_by_name(*, name: str) -> ParameterGroup | None
Get a single, fully populated parameter group by its exact name.
Searches for the name and returns the first group whose name matches exactly (case-insensitive). Returns None when no exact match is found.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the parameter group to retrieve. |
required |
Returns:
| Type | Description |
|---|---|
ParameterGroup or None
|
The matching parameter group, or None if no exact match is found. |
Source code in src/albert/collections/parameter_groups.py
update
update(
*, parameter_group: ParameterGroup
) -> ParameterGroup
Update an existing parameter group.
Fetch the group (e.g. with get_by_id), modify the updatable fields
on the returned object, then pass it here. Adding new
ParameterValue entries to parameters also creates those
parameters on the group. Only the fields listed in Notes are applied;
changes to other fields are ignored.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parameter_group
|
ParameterGroup
|
The group to update. Must have a valid |
required |
Returns:
| Type | Description |
|---|---|
ParameterGroup
|
The updated parameter group. |
Notes
The following fields can be updated: description, metadata,
name, and, per parameter, value, unit, required, and
validation.
Source code in src/albert/collections/parameter_groups.py
606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 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 | |