idmtools.registry.platform_specification module

PlatformSpecification provided definition for the platform plugin specification, hooks, and plugin manager.

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

class idmtools.registry.platform_specification.PlatformSpecification

Bases: PluginSpecification, ABC

PlatformSpecification for Platform Plugins.

classmethod get_name(strip_all: bool = True) str

Get name of plugin. By default we remove the PlatformSpecification portion.

Parameters:

strip_all – When true, PlatformSpecification is stripped from name. When false only Specification is Stripped

Returns:

Name of plugin

example_configuration()

Example configuration for the platform. This is useful in help or error messages.

Returns:

Example configuration

get(configuration: dict) IPlatform

Return a new platform using the passed in configuration.

Parameters:

configuration – The INI configuration file to use.

Returns:

The new platform.

get_type() Type[IPlatform]

Get type of the Platform type.

get_configuration_aliases() Dict[str, Dict]

Get a list of configuration aliases for the platform.

A configuration alias should be in the form of “name” -> “Spec, Config Options Dict” where name is the alias the user will use, and the config options is a dictionary of config options to be passed to the item Returns:

class idmtools.registry.platform_specification.PlatformPlugins(strip_all: bool = True)

Bases: SingletonMixin

PlatformPlugin registry.

__init__(strip_all: bool = True) None

Initialize the Platform Registry. When strip all is false, the full plugin name will be used for names in map.

Parameters:

strip_all – Whether to strip common parts of name from plugins in plugin map

get_plugins() Set[PlatformSpecification]

Get platform plugins.

Returns:

Platform plugins

get_aliases() Dict[str, Tuple[PlatformSpecification, Dict]]

Get Platform Configuration Aliases for Platform Plugin.

Returns:

Platform CConfiguration Aliases

get_plugin_map() Dict[str, PlatformSpecification]

Get plugin map for Platform Plugins.

Returns:

Plugin map