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: 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>, 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: str | None = '--config', command_line_argument_no_filename: bool = False)[source]#

Bases: JSONConfiguredTask, PythonTask

JSONConfiguredPythonTask combines JSONConfiguredTask and PythonTask.

Notes

  • TODO Add examples here

configfile_argument: str | None = '--config'#
gather_common_assets()[source]#

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

Returns:

Assets

gather_transient_assets() AssetCollection[source]#

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

Returns:

Transient assets

reload_from_simulation(simulation: Simulation, **kwargs)[source]#

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: Simulation | IWorkflowItem, platform: IPlatform)[source]#

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: Simulation | IWorkflowItem, platform: IPlatform)[source]#

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: 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>, 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: str | None = '--config', command_line_argument_no_filename: bool = False) None#
class idmtools_models.python.json_python_task.JSONConfiguredPythonTaskSpecification[source]#

Bases: TaskSpecification

JSONConfiguredPythonTaskSpecification provides the plugin info for JSONConfiguredPythonTask.

get(configuration: dict) JSONConfiguredPythonTask[source]#

Get instance of JSONConfiguredPythonTask with configuration.

Parameters:

configuration – Configuration for task

Returns:

JSONConfiguredPythonTask with configuration

get_description() str[source]#

Get description for plugin.

Returns:

Plugin Description

get_type() Type[JSONConfiguredPythonTask][source]#

Get Type for Plugin.

Returns:

JSONConfiguredPythonTask

get_version() str[source]#

Returns the version of the plugin.

Returns:

Plugin Version