fix: reverse max and min in python script (TSUN-287)