yawning_titan.config.item_types.float_item.FloatProperties#
- class yawning_titan.config.item_types.float_item.FloatProperties(_allowed_types=None, allow_null=None, default=None, min_val=None, inclusive_min=None, max_val=None, inclusive_max=None)[source]#
Bases:
ItemTypeProperties
The FloatProperties class holds the properties relevant for defining and validating a float value.
Methods
Serializes the
FloatProperties
as a dict.Validates a float against the properties set in
FloatProperties
.Attributes
True if the config value can be left empty, otherwise False.
The default value
Indicates whether max_val is exclusive of the value (<=, rather than <).
Indicates whether min_val is inclusive of the value (>=, rather than >).
A maximum float value.
A minimum float value.
- min_val = None#
A minimum float value.
- inclusive_min = None#
Indicates whether min_val is inclusive of the value (>=, rather than >).
- max_val = None#
A maximum float value.
- inclusive_max = None#
Indicates whether max_val is exclusive of the value (<=, rather than <).
- allow_null = None#
True if the config value can be left empty, otherwise False.
- default = None#
The default value
- to_dict()[source]#
Serializes the
FloatProperties
as a dict.- Returns:
The
FloatProperties
as a dict.
- validate(val)[source]#
Validates a float against the properties set in
FloatProperties
.- Parameters:
val – A float or int value to be validated.
- Returns:
An instance of
ConfigItemValidation
.- Raise:
ConfigItemValidationError
when validation fails.