Schema Module¶
This module contains schema definitions and validation functionality.
schema
¶
Schema definitions for Nextpipe.
This module contains schema definitions used for pipeline configurations.
CLASS | DESCRIPTION |
---|---|
AppOption |
Option for running an app. |
AppRunConfig |
Configuration for running an app. |
AppOption
dataclass
¶
AppRunConfig
dataclass
¶
AppRunConfig(
input: dict[str, Any] = None,
options: Union[
list[AppOption], dict[str, Any]
] = list(),
name: Optional[str] = None,
)
Configuration for running an app.
You can import the AppRunConfig
class directly from nextpipe
:
This class represents a configuration object used when running an app in a pipeline, containing input data, options, and an optional name.
PARAMETER | DESCRIPTION |
---|---|
|
Input data for the app, by default None.
TYPE:
|
|
Options for running the app, by default empty. These can be provided as a list of
TYPE:
|
|
Name for the run, by default None.
TYPE:
|
Examples:
>>> from nextpipe import AppRunConfig, AppOption
>>> config = AppRunConfig(
... input={"data": [1, 2, 3]},
... options={"threads": 4},
... name="my-run"
... )
get_options
¶
Get options as a dictionary.
This method converts the options
attribute to a dictionary if it is provided
as a list of AppOption
instances.
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
Dictionary of options. |