idmtools.core.interfaces.iitem module#
IItem is the base of all items that have ids such as AssetCollections, Experiments, etc.
Copyright 2025, Bill Foundation. All rights reserved.
- class idmtools.core.interfaces.iitem.IItem(_uid: str = None, _IItem__pre_creation_hooks: ~typing.List[~typing.Callable[[IItem, IPlatform], None]] = <factory>, _IItem__post_creation_hooks: ~typing.List[~typing.Callable[[IItem, IPlatform], None]] = <factory>)[source]#
Bases:
object
IItem represents items that have identifiable ids.
In addition, IItem facilities pre and post creation hooks through the __pre_creation_hooks, __post_creation_hooks, add_pre_creation_hook, add_post_creation_hook
- property uid#
UID Of the object. :returns: ID
- property id#
Alias for uid.
- Returns:
UID of object
Notes
What is relation to uid?
- property pickle_ignore_fields#
Get list of fields that will be ignored when pickling.
- Returns:
Set of fields that are ignored when pickling the item
- property metadata_fields#
Get list of fields that have metadata.
- Returns:
Set of fields that have metadata
- pre_creation(platform: IPlatform) None [source]#
Called before the actual creation of the entity.
- Parameters:
platform – Platform item is being created on
- Returns:
None
- post_creation(platform: IPlatform) None [source]#
Called after the actual creation of the entity.
- Parameters:
platform – Platform item was created on
- Returns:
None
- add_pre_creation_hook(hook: Callable[[IItem, IPlatform], None])[source]#
Adds a hook function to be called before an item is created.
- Parameters:
hook – Hook function. This should have two arguments, the item and the platform
- Returns:
None
- add_post_creation_hook(hook: Callable[[IItem, IPlatform], None])[source]#
Adds a hook function to be called after an item is created.
- Parameters:
hook – Hook function. This should have two arguments, the item and the platform
- Returns:
None
- post_setstate()[source]#
Function called after restoring the state if additional initialization is required.