DmitrMakeev commited on
Commit
63ab7a8
·
verified ·
1 Parent(s): c95a7ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -945,10 +945,12 @@ def handle_calculation():
945
  'N (NH4+)': 0.0
946
  }
947
 
948
- total_n = float(data['profileSettings'].get('TOTAL_NITROGEN', 125.0))
949
- no3_ratio = float(data['profileSettings'].get('NO3_RATIO', 8.25))
950
- nh4_ratio = 1.0
 
951
 
 
952
  total_parts = no3_ratio + nh4_ratio
953
  calculator.target_profile['N (NO3-)'] = total_n * (no3_ratio / total_parts)
954
  calculator.target_profile['N (NH4+)'] = total_n * (nh4_ratio / total_parts)
@@ -988,7 +990,6 @@ def handle_calculation():
988
 
989
 
990
 
991
-
992
 
993
 
994
  if __name__ == '__main__':
 
945
  'N (NH4+)': 0.0
946
  }
947
 
948
+ # Извлечение значений для азотов
949
+ total_n = float(data['profileSettings'].get('TOTAL_NITROG', 125.0))
950
+ no3_ratio = float(data['profileSettings'].get('NO3_RAT', 8.25)) # Берем значение из запроса
951
+ nh4_ratio = 1.0 # Фиксированное значение для NH4
952
 
953
+ # Расчет соотношения азотов
954
  total_parts = no3_ratio + nh4_ratio
955
  calculator.target_profile['N (NO3-)'] = total_n * (no3_ratio / total_parts)
956
  calculator.target_profile['N (NH4+)'] = total_n * (nh4_ratio / total_parts)
 
990
 
991
 
992
 
 
993
 
994
 
995
  if __name__ == '__main__':