idmtools.entities.command_task module

Command Task is the simplest task. It defined a simple task object with a command line.

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

class idmtools.entities.command_task.CommandTask(command: str | ~idmtools.entities.command_line.CommandLine = <property object>, platform_requirements: ~typing.Set[~idmtools.entities.platform_requirements.PlatformRequirements] = <factory>, _ITask__pre_creation_hooks: ~typing.List[~typing.Callable[[Simulation | IWorkflowItem, IPlatform], ~typing.NoReturn]] = <factory>, _ITask__post_creation_hooks: ~typing.List[~typing.Callable[[Simulation | IWorkflowItem, IPlatform], ~typing.NoReturn]] = <factory>, common_assets: ~idmtools.assets.asset_collection.AssetCollection = <factory>, transient_assets: ~idmtools.assets.asset_collection.AssetCollection = <factory>, gather_common_asset_hooks: ~typing.List[~typing.Callable[[~idmtools.entities.itask.ITask], ~idmtools.assets.asset_collection.AssetCollection]] = <factory>, gather_transient_asset_hooks: ~typing.List[~typing.Callable[[~idmtools.entities.itask.ITask], ~idmtools.assets.asset_collection.AssetCollection]] = <factory>)[source]

Bases: ITask

CommandTask is the simplest task.

A CommandTask is basically a command line and assets.

gather_common_asset_hooks: List[Callable[[ITask], AssetCollection]]

Hooks to gather common assets

gather_transient_asset_hooks: List[Callable[[ITask], AssetCollection]]

Defines an extensible simple task that implements functionality through optional supplied use hooks

gather_common_assets() AssetCollection[source]

Gather common(experiment-level) assets for task.

Returns:

AssetCollection containing common assets

gather_transient_assets() AssetCollection[source]

Gather transient(experiment-level) assets for task.

Returns:

AssetCollection containing transient assets

reload_from_simulation(simulation: Simulation)[source]

Reload task from a simulation.

Parameters:

simulation – Simulation to load

Returns:

None

pre_creation(parent: Simulation | IWorkflowItem, platform: IPlatform)[source]

pre-creation for the command task.

The default is to set the windows on the command line based on the platform.

Parameters:
  • parent – Parent of task

  • platform – Platform we are going to pre-creation

Returns:

None

__init__(command: str | ~idmtools.entities.command_line.CommandLine = <property object>, platform_requirements: ~typing.Set[~idmtools.entities.platform_requirements.PlatformRequirements] = <factory>, _ITask__pre_creation_hooks: ~typing.List[~typing.Callable[[Simulation | IWorkflowItem, IPlatform], ~typing.NoReturn]] = <factory>, _ITask__post_creation_hooks: ~typing.List[~typing.Callable[[Simulation | IWorkflowItem, IPlatform], ~typing.NoReturn]] = <factory>, common_assets: ~idmtools.assets.asset_collection.AssetCollection = <factory>, transient_assets: ~idmtools.assets.asset_collection.AssetCollection = <factory>, gather_common_asset_hooks: ~typing.List[~typing.Callable[[~idmtools.entities.itask.ITask], ~idmtools.assets.asset_collection.AssetCollection]] = <factory>, gather_transient_asset_hooks: ~typing.List[~typing.Callable[[~idmtools.entities.itask.ITask], ~idmtools.assets.asset_collection.AssetCollection]] = <factory>) None
class idmtools.entities.command_task.CommandTaskSpecification[source]

Bases: TaskSpecification

CommandTaskSpecification is the plugin definition for CommandTask.

get(configuration: dict) CommandTask[source]

Get instance of CommandTask with configuration.

Parameters:

configuration – configuration for CommandTask

Returns:

CommandTask with configuration

get_description() str[source]

Get description of plugin.

Returns:

Plugin description

get_example_urls() List[str][source]

Get example urls related to CommandTask.

Returns:

List of urls that have examples related to CommandTask

get_type() Type[CommandTask][source]

Get task type provided by plugin.

Returns:

CommandTask

get_version() str[source]

Get version of command task plugin.

Returns:

Version of plugin