Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def calculatePressures(self):
scale = (100.0 - Temperature + 10.0) / 15.0
values = map(
lambda pressure: sum(c.urgency ** scale for c in pressure.codelets),
self.pressures
)
totalValue = sum(values) or 1.0
values = [value / totalValue for value in values]
self.maxValue = max(values)
for pressure, value in zip(self.pressures, values):
pressure.values += [value * 100.0]
for codelet in self.removedCodelets:
if codelet.pressure:
codelet.pressure.codelets.remove(codelet)
self.removedCodelets = []