param.Magnitude#

class param.Magnitude(default: float | None = 1.0, *, allow_None: bool = False, bounds: tuple[float | int | None, float | int | None] | None=(0.0, 1.0), softbounds: tuple[float | int | None, float | int | None] | None=None, inclusive_bounds: tuple[bool, bool]=(True, True), step: float | int | None = None, set_hook: t.Callable[..., t.Any] | None=<Undefined>, doc: str | None = None, label: str | None = None, precedence: float | None = None, instantiate: bool = False, constant: bool = False, readonly: bool = False, pickle_default_value: bool = True, per_instance: bool = True, allow_refs: bool = False, nested_refs: bool = False, default_factory: Callable[[], t.Any] | None=None, metadata: dict[str, t.Any] | None=None)[source]#

Numeric Parameter required to be in the range [0.0-1.0].

__init__(default: float = 1.0, *, bounds: tuple[float | None, float | None] | None = (0.0, 1.0), softbounds: tuple[float | None, float | None] | None = None, inclusive_bounds: tuple[bool, bool] = (True, True), step: float | None = None, allow_None: Literal[False] = False, doc: str | None = None, label: str | None = None, precedence: float | None = None, instantiate: bool = False, constant: bool = False, readonly: bool = False, pickle_default_value: bool = True, per_instance: bool = True, allow_refs: bool = False, nested_refs: bool = False, default_factory: Callable[[], Any] | None = None, metadata: dict[str, Any] | None = None) None[source]#
__init__(default: float | None = 1.0, *, allow_None: Literal[True] = True, **kwargs: Unpack[_ParameterKwargs]) None

Initialize this parameter object and store the bounds.

Non-dynamic default values are checked against the bounds.

Methods

__init__(, softbounds, ...)

Initialize this parameter object and store the bounds.

crop_to_bounds(val)

Return the given value cropped to be within the hard bounds for this parameter.

deserialize(value)

Given a serializable Python value, return a value that the parameter can be set to.

get_soft_bounds()

schema([safe, subset, mode])

Generate a schema for the parameters of the Parameterized object.

serialize(value)

Given the parameter value, return a Python value suitable for serialization.

set_in_bounds(obj, val)

Set to the given value, but cropped to be within the legal bounds.

Attributes

allow_None

allow_refs

bounds

constant

default

default_factory

doc

inclusive_bounds

instantiate

label

Get the label for this parameter.

metadata

name

nested_refs

owner

per_instance

pickle_default_value

precedence

readonly

rx

The reactive operations namespace.

softbounds

step

time_dependent

time_fn

watchers