idmtools_platform_comps.comps_operations.experiment_operations module¶
idmtools comps experiment operations.
Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.
- class idmtools_platform_comps.comps_operations.experiment_operations.CompsPlatformExperimentOperations(platform: COMPSPlatform, platform_type: ~typing.Type = <class 'COMPS.Data.Experiment.Experiment'>)¶
Bases:
IPlatformExperimentOperations
Provides Experiment operations to the COMPSPlatform.
- platform: COMPSPlatform¶
- platform_type¶
alias of
Experiment
- get(experiment_id: UUID, columns: Optional[List[str]] = None, load_children: Optional[List[str]] = None, query_criteria: Optional[QueryCriteria] = None, **kwargs) Experiment ¶
Fetch experiments from COMPS.
- Parameters:
experiment_id – Experiment ID
columns – Optional Columns. If not provided, id, name, and suite_id are fetched
load_children – Optional Children. If not provided, tags and configuration are specified
query_criteria – Optional QueryCriteria
**kwargs –
- Returns:
COMPSExperiment with items
- pre_create(experiment: Experiment, **kwargs) NoReturn ¶
Pre-create for Experiment. At moment, validation related to COMPS is all that is done.
- Parameters:
experiment – Experiment to run pre-create for
**kwargs –
- Returns:
None
- platform_create(experiment: Experiment, num_cores: Optional[int] = None, executable_path: Optional[str] = None, command_arg: Optional[str] = None, priority: Optional[str] = None, check_command: bool = True, use_short_path: bool = False, **kwargs) Experiment ¶
Create Experiment on the COMPS Platform.
- Parameters:
experiment – IDMTools Experiment to create
num_cores – Optional num of cores to allocate using MPI
executable_path – Executable path
command_arg – Command Argument
priority – Priority of command
check_command – Run task hooks on item
use_short_path – When set to true, simulation roots will be set to “$COMPS_PATH(USER)
**kwargs – Keyword arguments used to expand functionality. At moment these are usually not used
- Returns:
COMPSExperiment that was created
- platform_modify_experiment(experiment: Experiment, regather_common_assets: bool = False, **kwargs) Experiment ¶
Executed when an Experiment is being ran that is already in Created, Done, In Progress, or Failed State.
- Parameters:
experiment – Experiment to modify
regather_common_assets – Triggers a new AC to be associated with experiment. It is important to note that when using this feature, ensure the previous simulations have finished provisioning. Failure to do so can lead to unexpected behaviour.
- Returns:
Modified experiment.
- post_create(experiment: Experiment, **kwargs) NoReturn ¶
Post create of experiment.
The default behaviour is to display the experiment url if output is enabled.
- post_run_item(experiment: Experiment, **kwargs)¶
Ran after experiment. Nothing is done on comps other that alerting the user to the item.
- Parameters:
experiment – Experiment to run post run item
**kwargs –
- Returns:
None
- get_children(experiment: Experiment, columns: Optional[List[str]] = None, children: Optional[List[str]] = None, **kwargs) List[Simulation] ¶
Get children for a COMPSExperiment.
- Parameters:
experiment – Experiment to get children of Comps Experiment
columns – Columns to fetch. If not provided, id, name, experiment_id, and state will be loaded
children – Children to load. If not provided, Tags will be loaded
**kwargs –
- Returns:
Simulations belonging to the Experiment
- get_parent(experiment: Experiment, **kwargs) Suite ¶
Get Parent of experiment.
- Parameters:
experiment – Experiment to get parent of
**kwargs –
- Returns:
Suite of the experiment
- platform_run_item(experiment: Experiment, **kwargs)¶
Run experiment on COMPS. Here we commission the experiment.
- Parameters:
experiment – Experiment to run
**kwargs –
- Returns:
None
- send_assets(experiment: Experiment, **kwargs)¶
Send assets related to the experiment.
- Parameters:
experiment – Experiment to send assets for
**kwargs –
- Returns:
None
- refresh_status(experiment: Experiment, **kwargs)¶
Reload status for experiment(load simulations).
- Parameters:
experiment – Experiment to load status for
**kwargs –
- Returns:
None
- to_entity(experiment: Experiment, parent: Optional[Suite] = None, children: bool = True, **kwargs) Experiment ¶
Converts a COMPSExperiment to an idmtools Experiment.
- Parameters:
experiment – COMPS Experiment objet to convert
parent – Optional suite parent
children – Should we load children objects?
**kwargs –
- Returns:
Experiment
- get_assets_from_comps_experiment(experiment: Experiment) Optional[AssetCollection] ¶
Get assets for a comps experiment.
- Parameters:
experiment – Experiment to get asset collection for.
- Returns:
AssetCollection if configuration is set and configuration.asset_collection_id is set.
- platform_list_asset(experiment: Experiment, **kwargs) List[Asset] ¶
List assets for an experiment.
- Parameters:
experiment – Experiment to list assets for.
**kwargs –
- Returns:
List of assets