naroo_reader/classes/science/side.py
2023-08-22 03:37:40 +02:00

22 lines
582 B
Python

class Side:
"""
Set of two index from the same axis
"""
def __init__( self , min = 0 , max = 0 ):
if not isinstance( min , int ) or not isinstance( max , int ):
raise ValueError( 'min and max should be int' )
def scale( self , factor ):
"""
Update coordinate to adapt from compression
"""
self.min = int( self.min * factor )
self.max = int( self.max * factor )
def __str__( self ):
return '\
side: [\
\n min: ' + str( self.min ) + '\
\n max: ' + str( self.max ) + '\
\n]\
'