IDS peak ICV v1.4.0
Loading...
Searching...
No Matches
python_interface_common._internal.utils Namespace Reference

Functions

bool is_equal (int|float left, int|float right, float tolerance=1e-7)
 Compare two numbers for equality, allowing a tolerance for floating point comparison.
 
None validate_parameter_types (*Any args, Tuple[Type,...] accepted_types)
 Validate that all given arguments are instances of the accepted types and are all of the same type.
 

Function Documentation

◆ is_equal()

bool is_equal ( int | float left,
int | float right,
float tolerance = 1e-7 )

Compare two numbers for equality, allowing a tolerance for floating point comparison.

Parameters
leftFirst number (int or float).
rightSecond number (int or float).
toleranceTolerance for floating point comparison. Ignored for integers.
Returns
True if the numbers are considered equal, False otherwise.

◆ validate_parameter_types()

None validate_parameter_types ( *Any args,
Tuple[Type, ...] accepted_types )

Validate that all given arguments are instances of the accepted types and are all of the same type.

Parameters
argsParameters to validate.
accepted_typesTuple of allowed types (default: (int, float)).
Exceptions
TypeErrorIf any argument is not of an accepted type, or if the arguments have inconsistent types.