Parameter Types

Copyright (C) 2023 Cadence Design Systems, Inc. (Cadence)

class floe.api.parameters.BaseParameter(name: str | None = None, title: str | None = None, default=None, null: bool = False, help_text: str = '', promoted: bool = False, promoted_name: str | None = None, required: bool = False, hidden: bool = False, value=None, static: bool = False, max_value=None, min_value=None, max_length=None, choices=None, level='basic', description: str = '', many: bool = False, order: int | None = None)

Base parameter class.

classmethod from_json(spec: dict) BaseParameter

Constructs and returns a new parameter instance from a JSON representation.

is_input() bool

Determines if input parameter based on the type_name suffix

is_output() bool

Determines if output parameter based on the type_name suffix

json() dict

Returns a parameter’s JSON representation.

validate(value)

Check that value is a valid value for the parameter. If value is None, validates the parameter’s default value. :param value: The value to be checked :raises: ValueError :return: None

class floe.api.parameters.BooleanParameter(*args, **kwargs)

True or False. The strings ‘1’ or ‘true’ are coerced to True, everything else is False.

class floe.api.parameters.DecimalParameter(name: str | None = None, title: str | None = None, default=None, null: bool = False, help_text: str = '', promoted: bool = False, promoted_name: str | None = None, required: bool = False, hidden: bool = False, value=None, static: bool = False, max_value=None, min_value=None, max_length=None, choices=None, level='basic', description: str = '', many: bool = False, order: int | None = None)

A floating point value optionally bounded by min_value or max_value.

validate(value)

Check that value is a valid value for the parameter. If value is None, validates the parameter’s default value. :param value: The value to be checked :raises: ValueError :return: None

class floe.api.parameters.FileInputParameter(name: str | None = None, title: str | None = None, default=None, null: bool = False, help_text: str = '', promoted: bool = False, promoted_name: str | None = None, required: bool = False, hidden: bool = False, value=None, static: bool = False, max_value=None, min_value=None, max_length=None, choices=None, level='basic', description: str = '', many: bool = False, order: int | None = None)

A string containing the name of a file to be used for input.

class floe.api.parameters.FileOutputParameter(name: str | None = None, title: str | None = None, default=None, null: bool = False, help_text: str = '', promoted: bool = False, promoted_name: str | None = None, required: bool = False, hidden: bool = False, value=None, static: bool = False, max_value=None, min_value=None, max_length=None, choices=None, level='basic', description: str = '', many: bool = False, order: int | None = None)

A string containing the name of a file to be used for output.

class floe.api.parameters.IntegerParameter(name: str | None = None, title: str | None = None, default=None, null: bool = False, help_text: str = '', promoted: bool = False, promoted_name: str | None = None, required: bool = False, hidden: bool = False, value=None, static: bool = False, max_value=None, min_value=None, max_length=None, choices=None, level='basic', description: str = '', many: bool = False, order: int | None = None)

An integer optionally bounded by min_value or max_value.

validate(value)

Check that value is a valid value for the parameter. If value is None, validates the parameter’s default value. :param value: The value to be checked :raises: ValueError :return: None

class floe.api.parameters.JSONParameter(name: str | None = None, title: str | None = None, default=None, null: bool = False, help_text: str = '', promoted: bool = False, promoted_name: str | None = None, required: bool = False, hidden: bool = False, value=None, static: bool = False, max_value=None, min_value=None, max_length=None, choices=None, level='basic', description: str = '', many: bool = False, order: int | None = None)

A JSON object map (i.e. dictionary). Strings are deserialized into JSON.

class floe.api.parameters.ParameterGroup(title: str, parameters: List[BaseParameter], name: str | None = None, description: str = '', order: int | None = None, collapsed: bool = False)

A logical grouping of parameters that acts as a hint to a user interface.

json() dict

Converts a parameter group instance into its JSON representation.

replace_parameter(param: BaseParameter, new_param: BaseParameter) None

Replaces a parameter in a group with a new parameter.

class floe.api.parameters.PromotedParameterGroup(title: str, parameters: List[BaseParameter], name: str | None = None, description: str = '', order: int | None = None, collapsed: bool = False)

A logical grouping of promoted parameters that acts as a hint to a user interface.

replace_parameter(param: BaseParameter, new_param: BaseParameter) None

This method is not supported for PromotedParameterGroup. Use my_floe.modify_parameter_group() instead.

class floe.api.parameters.StringParameter(name: str | None = None, title: str | None = None, default=None, null: bool = False, help_text: str = '', promoted: bool = False, promoted_name: str | None = None, required: bool = False, hidden: bool = False, value=None, static: bool = False, max_value=None, min_value=None, max_length=None, choices=None, level='basic', description: str = '', many: bool = False, order: int | None = None)

A string, optionally bound by max_length.

validate(value)

Check that value is a valid value for the parameter. If value is None, validates the parameter’s default value. :param value: The value to be checked :raises: ValueError :return: None