pyrtma.validators.FloatArray

class FloatArray(validator, len)[source]

Bases: ArrayField[_FPV], Generic[_FPV]

Validator class for float arrays

Validator class for float arrays

Parameters:
  • validator (Type[_FPV]) – Float type validator

  • len (int) – Array length

Methods

count

index

Raises ValueError if the value is not present.

validate_array

Validate array

validate_many

Validate multiple values

validate_one

Validate one value

count(value) integer -- return number of occurrences of value
index(value[, start[, stop]]) integer -- return first index of value.

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

validate_array(value)

Validate array

Parameters:

value (ArrayField) – Array value to validate

Raises:

TypeError – Wrong type

validate_many(value)

Validate multiple values

Parameters:

value – Values to validate

validate_one(value)

Validate one value

Parameters:

value – Value to validate