DmitrMakeev commited on
Commit
a46b330
·
verified ·
1 Parent(s): a4d40c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -5
app.py CHANGED
@@ -727,11 +727,11 @@ EC_COEFFICIENTS = {
727
  }
728
 
729
  class NutrientCalculator:
730
- def __init__(self, volume_liters=1.0, profile=BASE_PROFILE):
731
  self.volume = volume_liters
732
  self.results = {}
733
- self.target_profile = profile.copy()
734
- self.actual_profile = {k: 0.0 for k in self.target_profile}
735
  self.fertilizers = NUTRIENT_CONTENT_IN_FERTILIZERS
736
  self.total_ec = 0.0
737
 
@@ -749,8 +749,8 @@ class NutrientCalculator:
749
  # Веса компенсации
750
  self.compensation_weights = {
751
  "Ca": {"weight": 0.3, "fert": "Сульфат кальция", "main_element": "Ca"},
752
- "K": {"weight": 0.1, "fert": "Калий азотнокислый", "main_element": "K"},
753
- "Mg": {"weight": 0.1, "fert": "Сульфат магния", "main_element": "Mg"},
754
  "P": {"weight": 0.1, "fert": "Монофосфат калия", "main_element": "P"},
755
  "S": {"weight": 0.1, "fert": "Калий сернокислый", "main_element": "S"},
756
  "N (NO3-)": {"weight": 0.05, "fert": "Калий азотнокислый", "main_element": "N (NO3-)"},
@@ -871,6 +871,18 @@ class NutrientCalculator:
871
  def calculate_ec(self):
872
  return round(self.total_ec, 2)
873
 
 
 
 
 
 
 
 
 
 
 
 
 
874
  def print_initial_nitrogen_report(self):
875
  try:
876
  print("Исходный расчёт азота:")
 
727
  }
728
 
729
  class NutrientCalculator:
730
+ def __init__(self, volume_liters=1.0):
731
  self.volume = volume_liters
732
  self.results = {}
733
+ self.target_profile = BASE_PROFILE.copy()
734
+ self.actual_profile = {k: 0.0 for k in BASE_PROFILE}
735
  self.fertilizers = NUTRIENT_CONTENT_IN_FERTILIZERS
736
  self.total_ec = 0.0
737
 
 
749
  # Веса компенсации
750
  self.compensation_weights = {
751
  "Ca": {"weight": 0.3, "fert": "Сульфат кальция", "main_element": "Ca"},
752
+ "K": {"weight": 0.2, "fert": "Калий азотнокислый", "main_element": "K"},
753
+ "Mg": {"weight": 0.2, "fert": "Сульфат магния", "main_element": "Mg"},
754
  "P": {"weight": 0.1, "fert": "Монофосфат калия", "main_element": "P"},
755
  "S": {"weight": 0.1, "fert": "Калий сернокислый", "main_element": "S"},
756
  "N (NO3-)": {"weight": 0.05, "fert": "Калий азотнокислый", "main_element": "N (NO3-)"},
 
871
  def calculate_ec(self):
872
  return round(self.total_ec, 2)
873
 
874
+ def print_initial_nitrogen_report(self):
875
+ try:
876
+ print("Исходный расчёт азота:")
877
+ print(f" NO3-: {self.initial_n_profile['NO3-']} ppm")
878
+ print(f" NH4+: {self.initial_n_profile['NH4+']} ppm")
879
+ except Exception as e:
880
+ print(f"Ошибка при выводе отчёта: {str(e)}")
881
+ raise
882
+
883
+ def calculate_ec(self):
884
+ return round(self.total_ec, 2)
885
+
886
  def print_initial_nitrogen_report(self):
887
  try:
888
  print("Исходный расчёт азота:")