idmtools_models.python.json_python_task module

idmtools json configured python task.

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

class idmtools_models.python.json_python_task.JSONConfiguredPythonTask(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>, script_path: str = None, python_path: str = 'python', parameters: dict = <factory>, envelope: str = None, config_file_name: str = 'config.json', is_config_common: bool = False, configfile_argument: ~typing.Optional[str] = '--config', command_line_argument_no_filename: bool = False)

Bases: JSONConfiguredTask, PythonTask

JSONConfiguredPythonTask combines JSONConfiguredTask and PythonTask.

Notes

  • TODO Add examples here

configfile_argument: Optional[str] = '--config'
gather_common_assets()

Return the common assets for a JSON Configured Task a derived class.

Returns:

Assets

gather_transient_assets() AssetCollection

Get Transient assets. This should general be the config.json.

Returns:

Transient assets

reload_from_simulation(simulation: Simulation, **kwargs)

Reload the task from a simulation.

Parameters:
  • simulation – Simulation to reload from

  • **kwargs

Returns:

None

See Also

idmtools_models.json_configured_task.JSONConfiguredTask.reload_from_simulation() idmtools_models.python.python_task.PythonTask.reload_from_simulation()

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

Pre-creation.

Parameters:
  • parent – Parent of task

  • platform – Platform Python Script is being executed on

Returns:

None

See Also

idmtools_models.json_configured_task.JSONConfiguredTask.pre_creation() idmtools_models.python.python_task.PythonTask.pre_creation()

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

Post-creation.

For us, we proxy the underlying JSONConfiguredTask and PythonTask/

Parameters:
  • parent – Parent

  • platform – Platform Python Script is being executed on

Returns:

None

See Also

idmtools_models.json_configured_task.JSONConfiguredTask.post_creation() idmtools_models.python.python_task.PythonTask.post_creation()

__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>, script_path: str = None, python_path: str = 'python', parameters: dict = <factory>, envelope: str = None, config_file_name: str = 'config.json', is_config_common: bool = False, configfile_argument: ~typing.Optional[str] = '--config', command_line_argument_no_filename: bool = False) None
class idmtools_models.python.json_python_task.JSONConfiguredPythonTaskSpecification

Bases: TaskSpecification

JSONConfiguredPythonTaskSpecification provides the plugin info for JSONConfiguredPythonTask.

get(configuration: dict) JSONConfiguredPythonTask

Get instance of JSONConfiguredPythonTask with configuration.

Parameters:

configuration – Configuration for task

Returns:

JSONConfiguredPythonTask with configuration

get_description() str

Get description for plugin.

Returns:

Plugin Description

get_type() Type[JSONConfiguredPythonTask]

Get Type for Plugin.

Returns:

JSONConfiguredPythonTask

get_version() str

Returns the version of the plugin.

Returns:

Plugin Version