chenhaiyang преди 4 години
родител
ревизия
f73f1b703d
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      app/controllers/targets.py

+ 3 - 3
app/controllers/targets.py

@@ -177,8 +177,8 @@ class TemperatureTargetController(TargetController):
 
     async def generate_global(self):
         _RANGE = 1
-        lower, upper = self._cut(x - _RANGE), self._cut(x + _RANGE)
-        new_targets = self._current_targets['new_targets'].apply(lambda x: [lower, upper])
+        new_targets = self._current_targets['new_targets'].apply(lambda x: [self._cut(x - _RANGE),
+                                                                            self._cut(x + _RANGE)])
         time_index = self._current_targets.reset_index()['time']
         result = {}
         for i in range(len(time_index)):
@@ -239,7 +239,7 @@ class Co2TargetController(TargetController):
 
         return self._cut(new_target)
 
-    async def get_targets(self):
+    async def get_targets(self) -> float:
         current_upper_target = self._current_targets['co2Max'].loc[self._quarter_time]
         if current_upper_target is np.NAN:
             current_upper_target = 500.0