idmtools_models.r.r_task module

idmtools rtask.

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

class idmtools_models.r.r_task.RTask(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>, image_name: str = None, build: bool = False, build_path: ~typing.Optional[str] = None, Dockerfile: ~typing.Optional[str] = None, pull_before_build: bool = True, use_nvidia_run: bool = False, _DockerTask__image_built: bool = False, script_path: str = None, r_path: str = 'Rscript')

Bases: DockerTask

Defines an RTask for idmtools. Currently only useful for local platform.

Notes

  • TODO rework this to be non-docker

script_path: str = None
r_path: str = 'Rscript'
reload_from_simulation(simulation: Simulation, **kwargs)

Reload RTask from a simulation. Used when fetching an simulation to do a recreation.

Parameters:
  • simulation – Simulation object containing our metadata to rebuild task

  • **kwargs

Returns:

None

gather_common_assets() AssetCollection

Gather R Assets.

Returns:

Common assets

gather_transient_assets() AssetCollection

Gather transient assets. Generally this is the simulation level assets.

Returns:

Transient assets(Simulation level Assets)

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

Called before creation of parent.

Parameters:
  • parent – Parent

  • platform – Platform R Task is executing on

Returns:

None

Raises:

ValueError if script name is not provided

__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>, image_name: str = None, build: bool = False, build_path: ~typing.Optional[str] = None, Dockerfile: ~typing.Optional[str] = None, pull_before_build: bool = True, use_nvidia_run: bool = False, _DockerTask__image_built: bool = False, script_path: str = None, r_path: str = 'Rscript') None
class idmtools_models.r.r_task.RTaskSpecification

Bases: TaskSpecification

RTaskSpecification defines plugin specification for RTask.

get(configuration: dict) RTask

Get instance of RTask.

Parameters:

configuration – configuration for task

Returns:

RTask with configuration

get_description() str

Returns the Description of the plugin.

Returns:

Plugin Description

get_type() Type[RTask]

Get Type for Plugin.

Returns:

RTask

get_version() str

Returns the version of the plugin.

Returns:

Plugin Version