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: typing.Union[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[[typing.Union[Simulation, IWorkflowItem], IPlatform], typing.NoReturn]] = <factory>, _ITask__post_creation_hooks: typing.List[typing.Callable[[typing.Union[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>)

Bases: idmtools.entities.itask.ITask

CommandTask is the simplest task.

A CommandTask is basically a command line and assets.

gather_common_asset_hooks: List[Callable[[idmtools.entities.itask.ITask], idmtools.assets.asset_collection.AssetCollection]]

Hooks to gather common assets

gather_transient_asset_hooks: List[Callable[[idmtools.entities.itask.ITask], idmtools.assets.asset_collection.AssetCollection]]

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

gather_common_assets() idmtools.assets.asset_collection.AssetCollection

Gather common(experiment-level) assets for task.

Returns:

AssetCollection containing common assets

gather_transient_assets() idmtools.assets.asset_collection.AssetCollection

Gather transient(experiment-level) assets for task.

Returns:

AssetCollection containing transient assets

reload_from_simulation(simulation: idmtools.entities.simulation.Simulation)

Reload task from a simulation.

Parameters:

simulation – Simulation to load

Returns:

None

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

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: typing.Union[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[[typing.Union[Simulation, IWorkflowItem], IPlatform], typing.NoReturn]] = <factory>, _ITask__post_creation_hooks: typing.List[typing.Callable[[typing.Union[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

Bases: idmtools.registry.task_specification.TaskSpecification

CommandTaskSpecification is the plugin definition for CommandTask.

get(configuration: dict) idmtools.entities.command_task.CommandTask

Get instance of CommandTask with configuration.

Parameters:

configuration – configuration for CommandTask

Returns:

CommandTask with configuration

get_description() str

Get description of plugin.

Returns:

Plugin description

get_example_urls() List[str]

Get example urls related to CommandTask.

Returns:

List of urls that have examples related to CommandTask

get_type() Type[idmtools.entities.command_task.CommandTask]

Get task type provided by plugin.

Returns:

CommandTask

get_version() str

Get version of command task plugin.

Returns:

Version of plugin