Fix pylint warnings in Tooltip.py (Issue #187) Fix the following: ************* Module Tooltip Tooltip.py:2:0: R0402: Use 'from tkinter import ttk' instead (consider-using-from-import) Tooltip.py:119:12: R1731: Consider using 'x_delta = max(x_delta, 0)' instead of unnecessary if block (consider-using-max-builtin) Tooltip.py:122:12: R1731: Consider using 'y_delta = max(y_delta, 0)' instead of unnecessary if block (consider-using-max-builtin)
by Chris Satterlee 2 years 1 month
cd8546f2
Fix pylint warnings in IV_Swinger_plotter.py (Issue #187) Fix the following: ************* Module IV_Swinger_plotter IV_Swinger_plotter.py:374:11: C1803: 'self._data_points == []' can be simplified to 'not self._data_points' as an empty sequence is falsey (use-implicit-booleaness-not-comparison)
by Chris Satterlee 2 years 1 month
684956d7
Fix pylint warnings in IV_Swinger2_sim.py (Issue #187) ************* Module IV_Swinger2_sim IV_Swinger2_sim.py:97:0: R0402: Use 'from tkinter import ttk' instead (consider-using-from-import) IV_Swinger2_sim.py:252:15: W0621: Redefining name 'ohms' from outer scope (line 175) (redefined-outer-name) IV_Swinger2_sim.py:272:16: W0621: Redefining name 'ohms' from outer scope (line 175) (redefined-outer-name) IV_Swinger2_sim.py:312:16: W0621: Redefining name 'ohms' from outer scope (line 175) (redefined-outer-name) IV_Swinger2_sim.py:1008:8: R1730: Consider using 'voc_adc = min(voc_adc, ADC_MAX)' instead of unnecessary if block (consider-using-min-builtin) IV_Swinger2_sim.py:1049:20: R1730: Consider using 'ch0_adc = min(ch0_adc, ADC_MAX)' instead of unnecessary if block (consider-using-min-builtin) IV_Swinger2_sim.py:1051:20: R1730: Consider using 'ch1_adc = min(ch1_adc, ADC_MAX)' instead of unnecessary if block (consider-using-min-builtin) IV_Swinger2_sim.py:1206:12: W0621: Redefining name 'ohms' from outer scope (line 175) (redefined-outer-name) IV_Swinger2_sim.py:1277:12: W0621: Redefining name 'ohms' from outer scope (line 175) (redefined-outer-name) IV_Swinger2_sim.py:1397:4: R0914: Too many local variables (16/15) (too-many-locals)
by Chris Satterlee 2 years 1 month
5857fa7d
Fix pylint warnings in IV_Swinger2_gui.py (Issue #187) ************* Module IV_Swinger2_gui IV_Swinger2_gui.py:5017:0: R0022: Useless option value for 'disable', 'no-self-use' was moved to an optional extension, see https://pylint.pycqa.org/en/latest/whatsnew/2/2.14/summary.html#removed-checkers. (useless-option-value) IV_Swinger2_gui.py:99:0: R0402: Use 'from tkinter import ttk' instead (consider-using-from-import) IV_Swinger2_gui.py:281:15: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) IV_Swinger2_gui.py:353:12: W0621: Redefining name 'e' from outer scope (line 344) (redefined-outer-name) IV_Swinger2_gui.py:732:12: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) IV_Swinger2_gui.py:1868:12: R1714: Consider merging these comparisons with 'in' by using 'event.widget in (self.img_size_combo, self.v_range_entry, self.i_range_entry)'. Use a set instead if elements are hashable. (consider-using-in)
by Chris Satterlee 2 years 1 month
0948ba42
Fix pylint warnings in IV_Swinger2.py (Issue #187) Fixed the following: ************* Module IV_Swinger2 IV_Swinger2.py:502:8: R1731: Consider using 'dist = max(dist, 2)' instead of unnecessary if block (consider-using-max-builtin) IV_Swinger2.py:689:12: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) IV_Swinger2.py:697:29: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) IV_Swinger2.py:699:29: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) IV_Swinger2.py:4491:8: R1731: Consider using 'deflect_begin = max(deflect_begin, 2)' instead of unnecessary if block (consider-using-max-builtin) IV_Swinger2.py:4571:8: R1731: Consider using 'dist = max(dist, 2)' instead of unnecessary if block (consider-using-max-builtin)
by Chris Satterlee 2 years 1 month
0245d695
Fix pylint errors/warnings in IV_Swinger.py (Issue #187) Fixed the following: ************* Module IV_Swinger IV_Swinger.py:202:4: R0402: Use 'from RPi import GPIO' instead (consider-using-from-import) IV_Swinger.py:777:15: E1101: Instance of 'StoppableThread' has no 'isAlive' member (no-member) IV_Swinger.py:783:11: E1101: Instance of 'StoppableThread' has no 'isAlive' member (no-member) IV_Swinger.py:4137:16: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) IV_Swinger.py:4233:16: R1731: Consider using 'time_left = max(time_left, 0)' instead of unnecessary if block (consider-using-max-builtin) IV_Swinger.py:4524:23: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) IV_Swinger.py:4569:20: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
by Chris Satterlee 2 years 1 month
80b68d3d
Add support for low-power PV cells (Issue #186) Most of these changes are to address Issue #186. However, a few are minor changes not directly related to that issue. - Added low values to QTR_WATT_RESISTORS - Removed 3w shunt resistors (0.33, 0.5, 1.0) - Added 1/4w shunt resistors (0.333, 0.5, all other single values) - Added smaller load capacitors - Changed some part numbers for shunt resistors and load caps - Added higher resistance bleed resistors corresponding to lower capacitance load caps - Use new sigfigs function from IV_Swinger - Change min_swing_interval from property to method - Fix minor bug in calculate_bleed_pct - Use 1/4w resistors for optimal Rb if they work - Flag excessive swing time in results
by Chris Satterlee 2 years 1 month
019131cd
Clean up plotting scaling (Issue #185) Added three new global functions: mantissa_and_exp, get_tick_step, and sigfigs. Modified IV_Swinger methods set_x_range, set_y_range, set_x_ticks, set_y_ticks, plot_and_label_isc, plot_and_label_mpp, plot_and_label_voc, and adjust_margins to use the new global functions for unbounded scaling.
by Chris Satterlee 2 years 1 month
8f62122f
Add READ_ADC command for debug with serial monitor (Issue #184) Added a new "config" (misnomer in this case) command to simply read both channels of the ADC and print their values. It has a count parameter that specifies the number of times to repeat the reads in a loop, once every 0.5 seconds. This is for debugging. It is intended to be invoked from the Serial Monitor of the Arduino application. For example, typing "Config: READ_ADC 20" in the command window of the serial monitor, and hitting the Send button will read both ADC channels 20 times over 10 seconds, printing the values in the monitor window.
by Chris Satterlee 2 years 2 months
4c48dda3
Issue #183: relax stability criteria for advanced SSR current calibration The Arduino sketch was modified to only check that the average Pass 1 measurement is within 1% of the pass 2 measurement. Two more minor changes: 1) The ADC saturation condition is changed from comparing to 4095 to comparing to 4085. This is because the ADC doesn't necessarily read the full 4095 even when the saturation current is reached or exceeded (perhaps because the rail-to-rail op amps are not -quite- rail to rail) 2) Changed print to println on saturation message. Without the newline, the command times out in the saturation case
by Chris Satterlee 2 years 3 months
864a2676
Report a bug