DmitrMakeev commited on
Commit
91773a7
·
verified ·
1 Parent(s): 58942b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -892,14 +892,14 @@ class NutrientCalculator:
892
  self._apply(candidate['name'], element, ppm_to_apply)
893
  })
894
 
895
- if not candidates:
896
- raise ValueError(f"Нет удобрений для элемента {element}")
897
-
898
- total_weight = sum(abs(c['weight']) for c in candidates) # Берем модуль весов
899
- for candidate in candidates:
900
- share = abs(candidate['weight']) / total_weight # Используем модуль веса
901
- ppm_to_apply = needed * share
902
- self._apply(candidate['name'], element, ppm_to_apply)
903
 
904
  def calculate_ec(self):
905
  return round(self.total_ec, 2)
 
892
  self._apply(candidate['name'], element, ppm_to_apply)
893
  })
894
 
895
+ if not candidates:
896
+ raise ValueError(f"Нет удобрений для элемента {element}")
897
+
898
+ total_weight = sum(abs(c['weight']) for c in candidates) # Берем модуль весов
899
+ for candidate in candidates:
900
+ share = abs(candidate['weight']) / total_weight # Используем модуль веса
901
+ ppm_to_apply = needed * share
902
+ self._apply(candidate['name'], element, ppm_to_apply)
903
 
904
  def calculate_ec(self):
905
  return round(self.total_ec, 2)