Ayesha-Majeed commited on
Commit
945b4da
·
verified ·
1 Parent(s): c7d5c20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -12
app.py CHANGED
@@ -17,6 +17,8 @@ df.columns = df.columns.str.strip()
17
  strain_names = df['pea plant strain'].unique().tolist()
18
  row_options = ["None, Enter Manually"] + [str(i) for i in range(len(df))]
19
 
 
 
20
  # # -----------------------------
21
  # # 2️⃣ Autofill function
22
  # # -----------------------------
@@ -40,18 +42,18 @@ def predict_linear(strain, dose, soil_n, soil_p, soil_k, ph,
40
  # -----------------------------
41
  # 🧩 Convert textbox inputs to floats (or None if blank)
42
  # -----------------------------
43
- def to_float(x):
44
- try:
45
- return float(x)
46
- except (TypeError, ValueError):
47
- return None
48
-
49
- dose = to_float(dose)
50
- soil_n = to_float(soil_n)
51
- soil_p = to_float(soil_p)
52
- soil_k = to_float(soil_k)
53
- ph = to_float(ph)
54
- # -----------------------------
55
  required = [dose, soil_n, soil_p, soil_k, ph]
56
  if any(v is None for v in required):
57
  logs.append("[DEBUG] Missing numeric inputs!")
 
17
  strain_names = df['pea plant strain'].unique().tolist()
18
  row_options = ["None, Enter Manually"] + [str(i) for i in range(len(df))]
19
 
20
+ #-------------- To be commented --------------------
21
+
22
  # # -----------------------------
23
  # # 2️⃣ Autofill function
24
  # # -----------------------------
 
42
  # -----------------------------
43
  # 🧩 Convert textbox inputs to floats (or None if blank)
44
  # -----------------------------
45
+ # def to_float(x):
46
+ # try:
47
+ # return float(x)
48
+ # except (TypeError, ValueError):
49
+ # return None
50
+
51
+ # dose = to_float(dose)
52
+ # soil_n = to_float(soil_n)
53
+ # soil_p = to_float(soil_p)
54
+ # soil_k = to_float(soil_k)
55
+ # ph = to_float(ph)
56
+ # # -----------------------------
57
  required = [dose, soil_n, soil_p, soil_k, ph]
58
  if any(v is None for v in required):
59
  logs.append("[DEBUG] Missing numeric inputs!")