You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug is in code that isn't even used for IV Swinger 2. I hit it when running the following command from the CLI (needed to get full code coverage):
This does not fail with the Python 2 code, but with Python 3 it gets the following exception:
Traceback (most recent call last):
File "./IV_Swinger_plotter.py", line 707, in
main()
File "./IV_Swinger_plotter.py", line 702, in main
ivp.run()
File "./IV_Swinger_plotter.py", line 693, in run
ivs_extended.plot_graphs(args, csv_proc)
File "./IV_Swinger_plotter.py", line 502, in plot_graphs
self.plot_with_plotter(gp_command_filename,
File "/Users/csatt/GitHub/IV_Swinger/python3/IV_Swinger.py", line 3234, in plot_with_plotter
self.plot_with_gnuplot(sd_gp_command_filename,
File "/Users/csatt/GitHub/IV_Swinger/python3/IV_Swinger.py", line 3250, in plot_with_gnuplot
self.write_gnuplot_file(sd_gp_command_filename,
File "/Users/csatt/GitHub/IV_Swinger/python3/IV_Swinger.py", line 3162, in write_gnuplot_file
self.adjust_margins()
File "/Users/csatt/GitHub/IV_Swinger/python3/IV_Swinger.py", line 4082, in adjust_margins
if self.plot_max_y < 0.5:
TypeError: '<' not supported between instances of 'NoneType' and 'float'
The problem is that the write_gnuplot_file() method in IV_Swinger.py calls the adjust_margins() method before the plot_max_y property is set by the set_y_range() method. This means plot_max_y has a value of None when the comparison with 0.5 is performed. In Python 2, this doesn't cause an exception because None is treated like 0.0 in the comparison. But Python 3 doesn't allow comparing None to a float.
The call to adjust_margins() needs to be moved after the call to set_y_range().
The text was updated successfully, but these errors were encountered:
This bug is in code that isn't even used for IV Swinger 2. I hit it when running the following command from the CLI (needed to get full code coverage):
% ./IV_Swinger_plotter.py --use_gnuplot ~/Desktop/IV_Swinger2_old/Regression/IV_Swinger2/191116_13_03_12/iv_swinger2_191116_13_03_12.csv
This does not fail with the Python 2 code, but with Python 3 it gets the following exception:
Traceback (most recent call last):
File "./IV_Swinger_plotter.py", line 707, in
main()
File "./IV_Swinger_plotter.py", line 702, in main
ivp.run()
File "./IV_Swinger_plotter.py", line 693, in run
ivs_extended.plot_graphs(args, csv_proc)
File "./IV_Swinger_plotter.py", line 502, in plot_graphs
self.plot_with_plotter(gp_command_filename,
File "/Users/csatt/GitHub/IV_Swinger/python3/IV_Swinger.py", line 3234, in plot_with_plotter
self.plot_with_gnuplot(sd_gp_command_filename,
File "/Users/csatt/GitHub/IV_Swinger/python3/IV_Swinger.py", line 3250, in plot_with_gnuplot
self.write_gnuplot_file(sd_gp_command_filename,
File "/Users/csatt/GitHub/IV_Swinger/python3/IV_Swinger.py", line 3162, in write_gnuplot_file
self.adjust_margins()
File "/Users/csatt/GitHub/IV_Swinger/python3/IV_Swinger.py", line 4082, in adjust_margins
if self.plot_max_y < 0.5:
TypeError: '<' not supported between instances of 'NoneType' and 'float'
The problem is that the write_gnuplot_file() method in IV_Swinger.py calls the adjust_margins() method before the plot_max_y property is set by the set_y_range() method. This means plot_max_y has a value of None when the comparison with 0.5 is performed. In Python 2, this doesn't cause an exception because None is treated like 0.0 in the comparison. But Python 3 doesn't allow comparing None to a float.
The call to adjust_margins() needs to be moved after the call to set_y_range().
The text was updated successfully, but these errors were encountered: