Plugin Parameter Types#

Plugin Parameter Type Definition#

A Plugin Parameter Type in Dioptra represents a type used for the validation of an entrypoint, ensuring compatibility for plugin input, output, as well as artifact usage.

Plugin Parameter Type Attributes#

This section describes the attributes that define a Plugin Parameter Type.

Required Attributes#

  • Name: (string) The name of the type.

  • Group: (integer ID) The Group that owns this Plugin Parameter Type and controls access permissions.

  • Description: (string) A description of the type.

  • Structure: (string) A string representing the structure of the type as a JSON object.

System-Managed State#

The following attributes are automatically assigned by the system and cannot be set directly by the user.

  • ID: Unique identifier assigned upon creation.

  • Created On: Timestamp indicating when the Experiment was created.

  • Last Modified On: Timestamp indicating when the Experiment was last modified.

Built-in Types#

Some builtin types are provided:

  • null - represents a None type in python

  • string - represents a str type in python

  • any - allows any type to be passed

  • integer - represents an int type in python

  • number - represents a float type in python

  • boolean - represents a bool type in python

Type Structure Syntax#

Simple Types#

Simple types can be represented with the following empty structure:

{}

Lists#

A type representing a list of other types type_x can be represented as follows:

{ "list" : "type_x"}

Union#

A type representing a union of other types type_x and type_y can be represented as follows:

{ "union": ["type_x", "type_y"] }

Tuples#

A type representing a tuple of other types type_x and type_y can be represented as follows:

{ "tuple": ["type_x", "type_y"] }

Mapping#

A type representing a mapping from one type type_x to another type_y can be represented as follows:

{ "mapping": ["type_x", "type_y"] }

Alternatively, instead of mapping one type to another, a mapping of strings (key1 and key2) to various types (type_x and type_y) can be described as follows:

{
   "mapping": {
      "key1": "type_x",
      "key2": "type_y"
   }
}

Registration Interfaces#

Plugin Parameter Types can be created programmatically via the Python Client or the REST API. They can also be created through the web interface.

Using Python Client#

Create a Plugin Parameter Type

PluginParameterTypesCollectionClient.create(group_id: int, name: str, description: str | None = None, structure: dict[str, Any] | None = None) dioptra.client.plugin_parameter_types.T[source]#

Creates a plugin parameter type.

Parameters
  • group_id – The id of the group that will own the plugin parameter type.

  • name – The name of the new plugin parameter type.

  • description – The description of the new plugin parameter type. Optional, defaults to None.

  • structure – Used to declare the internal structure of a plugin parameter type. If None, then the plugin parameter type is a simple type. Optional, defaults to None.

Returns

The response from the Dioptra API.

Using REST API#

Plugin Parameter Types can be created directly via the HTTP API.

Create Plugin Parameter Types

See the POST /api/v1/pluginParameterTypes endpoint documentation for payload requirements.

See Also#