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
- 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 ¶