DmitrMakeev commited on
Commit
8f9b1e2
·
verified ·
1 Parent(s): 544f49f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -740,10 +740,11 @@ class NutrientCalculator:
740
  'Ca': self.profile["Ca"],
741
  'S': self.profile["S"],
742
  'N (NO3-)': self.profile["TOTAL_NITROG"] * (self.profile["NO3_RAT"] / total_parts),
743
- 'N (NH4+)': self.profile["TOTAL_NITROG"] * (1 / total_parts)
 
744
  }
745
 
746
- self.actual = {k: 0.0 for k in self.target}
747
  self.results = {}
748
 
749
  def calculate(self):
@@ -794,7 +795,7 @@ class NutrientCalculator:
794
 
795
  def _apply_calcium_chloride(self):
796
  cations = self.actual["Ca"] + self.actual["K"] + self.actual["Mg"] + self.actual["N (NH4+)"]
797
- anions = self.actual["N (NO3-)"] + self.actual["S"] + self.actual["P"]
798
  balance = cations - anions
799
 
800
  if balance > 0:
 
740
  'Ca': self.profile["Ca"],
741
  'S': self.profile["S"],
742
  'N (NO3-)': self.profile["TOTAL_NITROG"] * (self.profile["NO3_RAT"] / total_parts),
743
+ 'N (NH4+)': self.profile["TOTAL_NITROG"] * (1 / total_parts),
744
+ 'Cl': 0 # Добавляем хлор с нулевым значением
745
  }
746
 
747
+ self.actual = {k: 0.0 for k in self.target} # Теперь Cl тоже есть
748
  self.results = {}
749
 
750
  def calculate(self):
 
795
 
796
  def _apply_calcium_chloride(self):
797
  cations = self.actual["Ca"] + self.actual["K"] + self.actual["Mg"] + self.actual["N (NH4+)"]
798
+ anions = self.actual["N (NO3-)"] + self.actual["S"] + self.actual["P"] + self.actual["Cl"]
799
  balance = cations - anions
800
 
801
  if balance > 0: