schemas
Provides schemas used in Plugboard.
This includes:
- Pydantic models for specifying Plugboard objects;
TypeDictdefinitions for constructor**kwargs.
Direction
module-attribute
A type for the direction of optimisation.
ParameterSpec
module-attribute
A union type for all parameter specifications.
CategoricalParameterSpec
Bases: BaseFieldSpec
Specification for a categorical parameter.
See: https://docs.ray.io/en/latest/tune/api/search_space.html.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
Literal['ray.tune.choice']
|
The type of the parameter. |
categories |
list[Any]
|
The categories of the parameter. |
ComponentArgsDict
ComponentArgsSpec
Bases: PlugboardBaseModel
Specification of the Component constructor arguments.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the |
initial_values |
dict[str, Any]
|
Initial values for the |
parameters |
dict[str, Any]
|
Parameters for the |
constraints |
dict[str, Any]
|
Constraints for the |
ComponentSpec
Bases: PlugboardBaseModel
Specification of a Component.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
str
|
The type of the |
args |
ComponentArgsSpec
|
The arguments for the |
ConfigSpec
Bases: PlugboardBaseModel
Configuration for a Plugboard simulation.
Attributes:
| Name | Type | Description |
|---|---|---|
plugboard |
ProcessConfigSpec
|
A |
ConnectorBuilderArgsDict
ConnectorBuilderArgsSpec
Bases: PlugboardBaseModel
Specification of the Connector constructor arguments.
Attributes:
| Name | Type | Description |
|---|---|---|
parameters |
dict[str, Any]
|
Parameters for the |
ConnectorBuilderSpec
Bases: PlugboardBaseModel
Specification of a ConnectorBuilder.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
str
|
The type of the |
args |
ConnectorBuilderArgsSpec
|
Optional; The arguments for the |
ConnectorMode
Bases: StrEnum
Defines the mode of a connector.
Attributes:
| Name | Type | Description |
|---|---|---|
PIPELINE |
one-in-one-out task queue. |
|
PUBSUB |
one-to-many event distribution. |
ConnectorSocket
Bases: PlugboardBaseModel
ConnectorSocket defines a source or target connection point on a Connector.
There are two typical types of connections in use: those between attributes of components;
and those connecting components with events which they either emit or consume. When connecting
two component attributes together, the entity is the name of the component, and the
descriptor is the name of the attribute. When connecting components with events, the entity
is the name of the event, and the descriptor is either "publishers" or "subscribers" as
appropriate.
Attributes:
| Name | Type | Description |
|---|---|---|
entity |
str
|
The name of the entity. |
descriptor |
str
|
The name of the descriptor on the entity. |
ConnectorSpec
Bases: PlugboardBaseModel
ConnectorSpec defines a connection between two entities.
Attributes:
| Name | Type | Description |
|---|---|---|
source |
ConnectorSocket
|
The source endpoint. |
target |
ConnectorSocket
|
The target endpoint. |
mode |
ConnectorMode
|
The mode of the connector. |
Entity
FloatParameterSpec
Bases: BaseFieldSpec
Specification for a uniform float parameter.
See: https://docs.ray.io/en/latest/tune/api/search_space.html.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
Literal['ray.tune.uniform']
|
The type of the parameter. |
lower |
float
|
The lower bound of the parameter. |
upper |
float
|
The upper bound of the parameter. |
IODirection
IntParameterSpec
Bases: BaseFieldSpec
Specification for a uniform integer parameter.
See: https://docs.ray.io/en/latest/tune/api/search_space.html.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
Literal['ray.tune.randint']
|
The type of the parameter. |
lower |
int
|
The lower bound of the parameter. |
upper |
int
|
The upper bound of the parameter. |
ObjectiveSpec
Bases: BaseFieldSpec
Specification for an objective field.
OptunaSpec
Bases: PlugboardBaseModel
Specification for the Optuna configuration.
See: https://docs.ray.io/en/latest/tune/api/doc/ray.tune.search.optuna.OptunaSearch.html and https://optuna.readthedocs.io/en/stable/reference/index.html for more information on the Optuna configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
Literal['ray.tune.search.optuna.OptunaSearch']
|
The algorithm type to load. |
space |
str | None
|
Optional; A function defining the search space. Use this to define more complex search spaces that cannot be represented using the built-in parameter types. |
study_name |
str | None
|
Optional; The name of the study. |
storage |
str | None
|
Optional; The storage URI to save the optimisation results to. |
ProcessArgsDict
ProcessArgsSpec
Bases: PlugboardBaseModel
Specification of the Process constructor arguments.
Attributes:
| Name | Type | Description |
|---|---|---|
components |
Annotated[list[ComponentSpec], Len(min_length=1)]
|
Specifies each |
connectors |
list[ConnectorSpec]
|
Specifies the connections between each |
name |
Optional[str]
|
Unique identifier for |
parameters |
dict[str, Any]
|
Parameters for the |
state |
StateBackendSpec
|
Optional; Specifies the |
ProcessConfigSpec
Bases: PlugboardBaseModel
A ProcessSpec within a Plugboard configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
process |
ProcessSpec
|
A |
tune |
TuneSpec | None
|
Optional; A |
ProcessSpec
Bases: PlugboardBaseModel
Specification of a Plugboard Process.
Attributes:
| Name | Type | Description |
|---|---|---|
args |
ProcessArgsSpec
|
The arguments for the |
type |
Literal['plugboard.process.LocalProcess', 'plugboard.process.RayProcess']
|
The type of |
connector_builder |
ConnectorBuilderSpec
|
The |
StateBackendArgsDict
StateBackendArgsSpec
Bases: PlugboardBaseModel
Specification of the StateBackend constructor arguments.
Attributes:
| Name | Type | Description |
|---|---|---|
job_id |
Optional[str]
|
The unique id for the job. |
metadata |
dict[str, Any]
|
Metadata for a run. |
StateBackendSpec
Bases: PlugboardBaseModel
Specification of a Plugboard StateBackend.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
str
|
The type of the |
args |
StateBackendArgsSpec
|
The arguments for the |
Status
Bases: StrEnum
Status describes the status of either a Component or a Process.
Attributes:
| Name | Type | Description |
|---|---|---|
CREATED |
The |
|
INIT |
The |
|
RUNNING |
The |
|
WAITING |
The |
|
COMPLETED |
The |
|
FAILED |
The |
|
STOPPED |
The |
TuneArgsDict
TuneArgsSpec
Bases: PlugboardBaseModel
Specification of the arguments for the Tune class.
Attributes:
| Name | Type | Description |
|---|---|---|
objective |
ObjectiveSpec | list[ObjectiveSpec]
|
The location of the objective(s) to optimise for in the |
parameters |
list[ParameterSpec]
|
The parameters to optimise over. |
num_samples |
PositiveInt
|
The number of samples to draw during the optimisation. |
mode |
Direction | list[Direction]
|
The mode of optimisation. For multi-objective optimisation, this should be a list containing a direction for each objective. |
max_concurrent |
PositiveInt | None
|
The maximum number of concurrent trials. |
algorithm |
Union[OptunaSpec]
|
The algorithm to use for the optimisation. |
TuneSpec
Bases: PlugboardBaseModel
Configuration for an optimisation job.
Attributes:
| Name | Type | Description |
|---|---|---|
args |
TuneArgsSpec
|
The arguments for the |