IDS peak ICV v1.6.0
Loading...
Searching...
No Matches
Interval Class Reference

Public Member Functions

 __init__ (self, Union[int, float] minimum, Union[int, float] maximum)
 Creates an interval.
 
bool __eq__ (self, Any other)
 Check if two intervals are equal.
 
bool __ne__ (self, Any other)
 Check if two intervals are not equal.
 
Union[int, float] minimum (self)
 Returns the lower boundary of the interval.
 
Union[int, float] maximum (self)
 Returns the upper boundary of the interval.
 
Union[int, float] clamp (self, Union[int, float] value)
 Clamps a value to the bounds of this interval.
 
str __str__ (self)
 Returns a string representation of the Interval object.
 
str __repr__ (self)
 Return an unambiguous string of the Interval object.
 

Protected Member Functions

bool _is_negative (self)
 

Protected Attributes

Union[int, float] _minimum = minimum
 
Union[int, float] _maximum = maximum
 

Detailed Description

Represents an interval with lower and upper boundaries.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
Union[int, float] minimum,
Union[int, float] maximum )

Creates an interval.

Parameters
minimumThe lower boundary.
maximumThe upper boundary.
Exceptions
OutOfRangeExceptionIf maximum is less than minimum.

Member Function Documentation

◆ __eq__()

bool __eq__ ( self,
Any other )

Check if two intervals are equal.

Parameters
otherAnother Interval object OR List of boundaries [minimum, maximum] OR Tuple of boundaries (minimum, maximum)
Returns
True if intervals are equal, False otherwise

◆ __ne__()

bool __ne__ ( self,
Any other )

Check if two intervals are not equal.

Parameters
otherAnother Interval object OR List of boundaries [minimum, maximum] OR Tuple of boundaries (minimum, maximum)
Returns
True if intervals are not equal, False otherwise

◆ __repr__()

str __repr__ ( self)

Return an unambiguous string of the Interval object.

◆ __str__()

str __str__ ( self)

Returns a string representation of the Interval object.

Returns
String representation of the Interval object.

◆ _is_negative()

bool _is_negative ( self)
protected

◆ clamp()

Union[int, float] clamp ( self,
Union[int, float] value )

Clamps a value to the bounds of this interval.

Values below the minimum are adjusted to the minimum value, while values above the maximum are adjusted to the maximum value.

Parameters
valueThe value to clamp.
Returns
The clamped value within this interval's boundaries.
Since
ids_peak_common 2.1

◆ maximum()

Union[int, float] maximum ( self)

Returns the upper boundary of the interval.

◆ minimum()

Union[int, float] minimum ( self)

Returns the lower boundary of the interval.

Field Documentation

◆ _maximum

_maximum = maximum
protected

◆ _minimum

_minimum = minimum
protected