In CP, the maximum current is obtained according toi_max = max( currents ), which determines the IRange later. But if the currents are passed as negative values (e.g., to reduce metallic salt in working electrode), the IRange would not be correct.
Maybe measuring the maximum of the absolute values of currents can be the solution. Something like:
currents = [abs(current) for current in currents]
i_max = max( currents )
In CP, the maximum current is obtained according to
i_max = max( currents )
, which determines the IRange later. But if the currents are passed as negative values (e.g., to reduce metallic salt in working electrode), the IRange would not be correct. Maybe measuring the maximum of the absolute values of currents can be the solution. Something like: