Skip to content

Commit

Permalink
fix for ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
MAKOMO committed Jan 26, 2025
1 parent 96d6944 commit c0082f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/artisanlib/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -2240,7 +2240,7 @@ def __init__(self, parent:QWidget, dpi:int, locale:str, aw:'ApplicationWindow')
self.coolingenergies_setup:List[float] = [0]*4 # rating of the cooling burner
self.betweenbatch_after_preheat_setup:bool = True # True adds BBP to pre-heating (and cooling) for the first batch.
self.electricEnergyMix_setup:int = 0 # the amount of renewable electric energy in the energy mix in %

# Others
self.energyresultunit_setup:int = 0 # index in list self.powerunits
self.kind_list: Final[List[str]] = [QApplication.translate('Label','Preheat Measured'),
Expand Down Expand Up @@ -2486,7 +2486,7 @@ def setEnergyLoadDefaults(self) -> None:
self.presssure_percents_setup = self.presssure_percents[:]
self.loadevent_zeropcts_setup = self.loadevent_zeropcts[:]
self.loadevent_hundpcts_setup = self.loadevent_hundpcts[:]
self.meterlabels_setup = self.meterlabels[:]
self.meterlabels_setup = self.meterlabels[:]
self.meterunits_setup = self.meterunits[:]
self.metersources_setup = self.metersources[:]
self.electricEnergyMix_setup = self.electricEnergyMix
Expand All @@ -2501,7 +2501,7 @@ def restoreEnergyLoadDefaults(self) -> None:
self.presssure_percents = self.presssure_percents_setup[:]
self.loadevent_zeropcts = self.loadevent_zeropcts_setup[:]
self.loadevent_hundpcts = self.loadevent_hundpcts_setup[:]
self.meterlabels = self.meterlabels_setup[:]
self.meterlabels = self.meterlabels_setup[:]
self.meterunits = self.meterunits_setup[:]
self.metersources = self.metersources_setup[:]
self.electricEnergyMix = self.electricEnergyMix_setup
Expand Down Expand Up @@ -12356,7 +12356,7 @@ def OffMonitor(self) -> None:

self.threadserver.terminatingSignal.connect(self.OffMonitorCloseDown)
self.flagon = False

self.getMeterReads()

except Exception as ex: # pylint: disable=broad-except
Expand Down Expand Up @@ -12395,18 +12395,18 @@ def calc_meter_read(_start:float, _end:float) -> float:
elif len(self.extratemp2) > (x/2):
begin = self.extratemp2[x // 2][0]
end = self.extratemp2[x // 2][-1]

self.meterreads[i] = [calc_meter_read (
self.convertHeat(begin, self.powerunits[self.meterunits[i]], 'BTU'),
self.convertHeat(end, self.powerunits[self.meterunits[i]], 'BTU')
), begin, end
), begin, end
]
except Exception as ex: # pylint: disable=broad-except
except Exception: # pylint: disable=broad-except
# _log.exception(ex)
# _, _, exc_tb = sys.exc_info()
# self.adderror((QApplication.translate('Error Message', 'Exception:') + ' getMeterReads() {0}').format(str(ex)),getattr(exc_tb, 'tb_lineno', '?'))
pass

def getAmbientData(self) -> None:
_log.debug('getAmbientData()')
# this is needed to suppress the message on the ignored Exception
Expand Down Expand Up @@ -15304,7 +15304,7 @@ def formatLoadLabel(i:int) -> str:
if BTUs > 0:
btu_list.append({'load_pct':load_pct,'duration':duration,'BTUs':BTUs,'CO2g':CO2g,'LoadLabel':loadlabel,'Kind':kind,'SourceType':self.sourcetypes[i],'SortOrder':sortorder})
#### end of loop: for i in range(0,4)

# Meter reads
for j in range(2):
if self.meterreads[j][0] > 0:
Expand All @@ -15317,7 +15317,7 @@ def formatLoadLabel(i:int) -> str:
CO2g = 0
kind = 8 # Meter
btu_list.append({'load_pct':0,'duration':0,'BTUs':BTUs,'CO2g':CO2g,'LoadLabel':loadlabel,'Kind':kind,'SourceType':sourcetype,'SortOrder':sortorder})

btu_list.sort(key=lambda k : k['SortOrder'] )

# summarize the batch metrics
Expand Down
1 change: 1 addition & 0 deletions wiki/ReleaseHistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ v3.1.1
* ADDITIONS
- adds drag-and-drop to Stats Summary table configuration
- allows to hide scheduled items
- adds support for feeding data from energy meters into Artisans roast energy calculator

* CHANGES
- the Phidget driver is now bundled with the Artisan app and does no longer need to be installed separately (but for some legacy USB HID devices, like the original 1046 and 1048, which still need the kernel extension of the driver package installed in the system)
Expand Down

0 comments on commit c0082f2

Please sign in to comment.