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: 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>, image_name: str = None, build: bool = False, build_path: str | None = None, Dockerfile: str | None = None, pull_before_build: bool = True, use_nvidia_run: bool = False, _DockerTask__image_built: bool = False, script_path: str = None, r_path: str = 'Rscript')[source]

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)[source]

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[source]

Gather R Assets.

Returns:

Common assets

gather_transient_assets() AssetCollection[source]

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

Returns:

Transient assets(Simulation level Assets)

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

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: 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>, image_name: str = None, build: bool = False, build_path: str | None = None, Dockerfile: str | None = 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[source]

Bases: TaskSpecification

RTaskSpecification defines plugin specification for RTask.

get(configuration: dict) RTask[source]

Get instance of RTask.

Parameters:

configuration – configuration for task

Returns:

RTask with configuration

get_description() str[source]

Returns the Description of the plugin.

Returns:

Plugin Description

get_type() Type[RTask][source]

Get Type for Plugin.

Returns:

RTask

get_version() str[source]

Returns the version of the plugin.

Returns:

Plugin Version