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

to_dict

Serializes the FloatProperties as a dict.

validate

Validates a float against the properties set in FloatProperties.

Attributes

allow_null

True if the config value can be left empty, otherwise False.

default

The default value

inclusive_max

Indicates whether max_val is exclusive of the value (<=, rather than <).

inclusive_min

Indicates whether min_val is inclusive of the value (>=, rather than >).

max_val

A maximum float value.

min_val

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.