idmtools.core.interfaces.ientity module

class idmtools.core.interfaces.ientity.IEntity(_uid: uuid.UUID = None, _IItem__pre_creation_hooks: List[Callable[[IItem, IPlatform], None]] = <factory>, _IItem__post_creation_hooks: List[Callable[[IItem, IPlatform], None]] = <factory>, platform_id: uuid.UUID = None, _platform: IPlatform = None, parent_id: uuid.UUID = None, _parent: IEntity = None, status: idmtools.core.enums.EntityStatus = None, tags: Dict[str, Any] = <factory>, item_type: idmtools.core.enums.ItemType = None, _platform_object: Any = None)

Bases: idmtools.core.interfaces.iitem.IItem

Interface for all entities in the system.

platform_id: uuid.UUID = None

ID of the platform

parent_id: uuid.UUID = None

Parent id

status: idmtools.core.enums.EntityStatus = None

Status of item

tags: Dict[str, Any]

Tags for item

item_type: idmtools.core.enums.ItemType = None

Item Type(Experiment, Suite, Asset, etc)

update_tags(tags: dict = None) → NoReturn

Shortcut to update the tags with the given dictionary :param tags: New tags

post_creation(platform: IPlatform) → None

Post creation hook for object Returns:

classmethod from_id_file(filename: Union[os.PathLike, str], platform: IPlatform = None, **kwargs)IEntity

Load from a file that container the id

Parameters
  • filename – Filename to load

  • platform

  • **kwargs – Platform extra arguments

Returns:

classmethod from_id(item_id: Union[str, uuid.UUID], platform: IPlatform = None, **kwargs)IEntity

Load an item from an id

Parameters
  • item_id – Id of item

  • platform – Platform. If not supplied, we check the current context

  • **kwargs – Optional platform args

Returns

IEntity of object

property parent

Return parent object for item Returns:

property platform

Get objects platform

Returns

Platform

get_platform_object(force: bool = False, platform: IPlatform = None, **kwargs)

Get the platform representation of an object

Parameters
  • force – Force reload of platform object

  • platform – Allow passing platform object to fetch

  • **kwargs – Optional args used for specific platform behaviour

Returns

Platform Object

property done

Returns if a item is done. For an item to be done, it should be in either failed or succeeded state

Returns

True if status is succeeded or failed

property succeeded

Returns if an item has succeeded

Returns

True if status is SUCCEEDED

property failed

Returns is a item has failed

Returns

True if status is failed

static get_current_platform_or_error(platform)
to_id_file(filename: Union[str, os.PathLike], save_platform: bool = False, platform_args: Dict = None)

Write a id file

Parameters
  • filename – Filename to create

  • save_platform – Save platform to the file as well

  • platform_args – Platform Args

Returns: