idmtools_platform_comps.comps_operations.workflow_item_operations module#

idmtools comps workflow item operations.

Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.

class idmtools_platform_comps.comps_operations.workflow_item_operations.CompsPlatformWorkflowItemOperations(platform: COMPSPlatform, platform_type: ~typing.Type = <class 'COMPS.Data.WorkItem.WorkItem'>)[source]#

Bases: IPlatformWorkflowItemOperations

Provides IWorkflowItem COMPSPlatform.

platform: COMPSPlatform#
platform_type#

alias of WorkItem

get(workflow_item_id: UUID, columns: List[str] | None = None, load_children: List[str] | None = None, query_criteria: QueryCriteria | None = None, **kwargs) WorkItem[source]#

Get COMPSWorkItem.

Parameters:
  • workflow_item_id – Item id

  • columns – Optional columns to load. Defaults to “id”, “name”, “state”

  • load_children – Optional list of COMPS Children objects to load. Defaults to “Tags”

  • query_criteria – Optional QueryCriteria

  • **kwargs

Returns:

COMPSWorkItem

platform_create(work_item: IWorkflowItem, **kwargs) Tuple[Any][source]#

Creates an workflow_item from an IDMTools work_item object.

Parameters:
  • work_item – WorkflowItem to create

  • **kwargs – Optional arguments mainly for extensibility

Returns:

Created platform item and the UUID of said item

platform_run_item(work_item: IWorkflowItem, **kwargs)[source]#

Start to rum COMPS WorkItem created from work_item.

Parameters:

work_item – workflow item

Returns: None

get_parent(work_item: IWorkflowItem, **kwargs) Any[source]#

Returns the parent of item. If the platform doesn’t support parents, you should throw a TopLevelItem error.

Parameters:
  • work_item – COMPS WorkItem

  • **kwargs – Optional arguments mainly for extensibility

Returns: item parent

Raises:

TopLevelItem

get_children(work_item: IWorkflowItem, **kwargs) List[Any][source]#

Returns the children of an workflow_item object.

Parameters:
  • work_item – WorkflowItem object

  • **kwargs – Optional arguments mainly for extensibility

Returns:

Children of work_item object

refresh_status(workflow_item: IWorkflowItem, **kwargs)[source]#

Refresh status for workflow item.

Parameters:

work_item – Item to refresh status for

Returns:

None

send_assets(workflow_item: IWorkflowItem, **kwargs)[source]#

Add asset as WorkItemFile.

Parameters:

workflow_item – workflow item

Returns: None

list_assets(workflow_item: IWorkflowItem, **kwargs) List[str][source]#

Get list of asset files.

Parameters:
  • workflow_item – workflow item

  • **kwargs – Optional arguments mainly for extensibility

Returns: list of assets associated with WorkItem

get_assets(workflow_item: IWorkflowItem, files: List[str], **kwargs) Dict[str, bytearray][source]#

Retrieve files association with WorkItem.

Parameters:
  • workflow_item – workflow item

  • files – list of file paths

  • **kwargs – Optional arguments mainly for extensibility

Returns: dict with key/value: file_path/file_content

to_entity(work_item: WorkItem, **kwargs) IWorkflowItem[source]#

Converts the platform representation of workflow_item to idmtools representation.

Parameters:
  • work_item – Platform workflow_item object

  • kwargs – optional arguments mainly for extensibility

Returns:

IDMTools workflow item

Get related WorkItems, Suites, Experiments, Simulations and AssetCollections.

Parameters:
  • item – workflow item

  • relation_type – RelationType

Returns: Dict

__init__(platform: COMPSPlatform, platform_type: ~typing.Type = <class 'COMPS.Data.WorkItem.WorkItem'>) None#