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

Bases: IPlatformExperimentOperations

Provides Experiment operations to the COMPSPlatform.

platform: COMPSPlatform#
platform_type#

alias of Experiment

get(experiment_id: UUID, columns: List[str] | None = None, load_children: List[str] | None = None, query_criteria: QueryCriteria | None = None, **kwargs) Experiment[source]#

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

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: int | None = None, executable_path: str | None = None, command_arg: str | None = None, priority: str | None = None, check_command: bool = True, use_short_path: bool = False, **kwargs) Experiment[source]#

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

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

Post create of experiment.

The default behaviour is to display the experiment url if output is enabled.

post_run_item(experiment: Experiment, **kwargs)[source]#

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: List[str] | None = None, children: List[str] | None = None, **kwargs) List[Simulation][source]#

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

Get Parent of experiment.

Parameters:
  • experiment – Experiment to get parent of

  • **kwargs

Returns:

Suite of the experiment

platform_run_item(experiment: Experiment, **kwargs)[source]#

Run experiment on COMPS. Here we commission the experiment.

Parameters:
  • experiment – Experiment to run

  • **kwargs

Returns:

None

send_assets(experiment: Experiment, **kwargs)[source]#

Send assets related to the experiment.

Parameters:
  • experiment – Experiment to send assets for

  • **kwargs

Returns:

None

refresh_status(experiment: Experiment, **kwargs)[source]#

Reload status for experiment(load simulations).

Parameters:
  • experiment – Experiment to load status for

  • **kwargs

Returns:

None

to_entity(experiment: Experiment, parent: Suite | None = None, children: bool = True, **kwargs) Experiment[source]#

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

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

List assets for an experiment.

Parameters:
  • experiment – Experiment to list assets for.

  • **kwargs

Returns:

List of assets

create_sim_directory_map(experiment_id: str) Dict[source]#

Build simulation working directory mapping. :param experiment_id: experiment id

Returns:

Dict of simulation id as key and working dir as value

platform_delete(experiment_id: str) None[source]#

Delete platform experiment. :param experiment_id: experiment id

Returns:

None

platform_cancel(experiment_id: str) None[source]#

Cancel platform experiment. :param experiment_id: experiment id

Returns:

None

__init__(platform: COMPSPlatform, platform_type: ~typing.Type = <class 'COMPS.Data.Experiment.Experiment'>) None#