Misc Utility Functions#
arcade.configure_logging#
arcade.utils.ByteRangeError#
arcade.utils.FloatOutsideRangeError#
- class arcade.utils.FloatOutsideRangeError(var_name: str, value: float, lower: float, upper: float)[source]#
A float value was outside an expected range
- Parameters:
var_name – the name of the variable or argument
value – the value to fall outside the expected range
lower – the lower bound, inclusive, of the range
upper – the upper bound, inclusive, of the range
arcade.utils.IntOutsideRangeError#
- class arcade.utils.IntOutsideRangeError(var_name: str, value: int, lower: int, upper: int)[source]#
An integer was outside an expected range
This class was originally intended to assist deserialization from data packed into ints, such as
Color
.- Parameters:
var_name – the name of the variable or argument
value – the value to fall outside the expected range
lower – the lower bound, inclusive, of the range
upper – the upper bound, inclusive, of the range
arcade.utils.NormalizedRangeError#
- class arcade.utils.NormalizedRangeError(var_name: str, value: float)[source]#
A float was not between 0.0 and 1.0, inclusive
Note that normalized floats should not normally be bound-checked as before drawing as this is taken care of on the GPU side.
The exceptions to this are when processing data on the Python side, especially when it is cheaper to bound check two floats than call clamping functions.
- Parameters:
var_name – the name of the variable or argument
value – the value to fall outside the expected range
arcade.utils.OutsideRangeError#
- class arcade.utils.OutsideRangeError(var_name: str, value: _CT, lower: _CT, upper: _CT)[source]#
Raised when a value is outside and expected range
This class and its subclasses are intended to be arcade-internal helpers to clearly signal exactly what went wrong. Each helps type annotate and template a string describing exactly what went wrong.
- Parameters:
var_name – the name of the variable or argument
value – the value to fall outside the expected range
lower – the lower bound, inclusive, of the range
upper – the upper bound, inclusive, of the range