DmitrMakeev commited on
Commit
08a55df
·
verified ·
1 Parent(s): 1adf04b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -692,7 +692,6 @@ def nutri_call():
692
 
693
 
694
 
695
-
696
  from tabulate import tabulate
697
  import numpy as np
698
 
@@ -889,7 +888,7 @@ class NutrientCalculator:
889
  def _apply_fertilizer(self, fert_name, amount):
890
  """Добавляет указанное количество удобрения"""
891
  fert_composition = self.fertilizers[fert_name]
892
- scaled_composition = amount * fert_composition
893
 
894
  if fert_name not in self.results:
895
  self.results[fert_name] = {
@@ -908,7 +907,7 @@ class NutrientCalculator:
908
  def _remove_fertilizer(self, fert_name, amount):
909
  """Удаляет указанное количество удобрения"""
910
  fert_composition = self.fertilizers[fert_name]
911
- scaled_composition = amount * fert_composition
912
 
913
  if fert_name in self.results:
914
  self.results[fert_name]['граммы'] -= amount
@@ -977,9 +976,6 @@ if __name__ == "__main__":
977
 
978
 
979
 
980
-
981
-
982
-
983
  @app.route('/calculation', methods=['POST'])
984
  def handle_calculation():
985
  try:
 
692
 
693
 
694
 
 
695
  from tabulate import tabulate
696
  import numpy as np
697
 
 
888
  def _apply_fertilizer(self, fert_name, amount):
889
  """Добавляет указанное количество удобрения"""
890
  fert_composition = self.fertilizers[fert_name]
891
+ scaled_composition = Composition(fert_composition.name, fert_composition.vector * amount)
892
 
893
  if fert_name not in self.results:
894
  self.results[fert_name] = {
 
907
  def _remove_fertilizer(self, fert_name, amount):
908
  """Удаляет указанное количество удобрения"""
909
  fert_composition = self.fertilizers[fert_name]
910
+ scaled_composition = Composition(fert_composition.name, fert_composition.vector * amount)
911
 
912
  if fert_name in self.results:
913
  self.results[fert_name]['граммы'] -= amount
 
976
 
977
 
978
 
 
 
 
979
  @app.route('/calculation', methods=['POST'])
980
  def handle_calculation():
981
  try: