Added ee to good-names (Issue #187)
by Chris Satterlee 2 years 5 months
Added ee to good-names (Issue #187)

This is needed for one of the pylint fixes to IV_Swinger2_gui.py
ac6bcb73
Fix pylint warnings in Tooltip.py (Issue #187)
by Chris Satterlee 2 years 5 months
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)
cd8546f2
Fix pylint warnings in IV_Swinger_plotter.py (Issu...
by Chris Satterlee 2 years 5 months
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)
684956d7
Fix pylint warnings in IV_Swinger2_sim.py (Issue #...
by Chris Satterlee 2 years 5 months
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)
5857fa7d
Fix pylint warnings in IV_Swinger2_gui.py (Issue #...
by Chris Satterlee 2 years 5 months
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)
0948ba42
Fix pylint warnings in IV_Swinger2.py (Issue #187)
by Chris Satterlee 2 years 5 months
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)
0245d695
Fix pylint errors/warnings in IV_Swinger.py (Issue...
by Chris Satterlee 2 years 5 months
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)
80b68d3d
Add support for low-power PV cells (Issue #186)
by Chris Satterlee 2 years 5 months
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
019131cd
Clean up plotting scaling (Issue #185)
by Chris Satterlee 2 years 5 months
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.
8f62122f
Add READ_ADC command for debug with serial monitor...
by Chris Satterlee 2 years 6 months
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.
4c48dda3
Report a bug