AbdullahImran commited on
Commit
bde892e
·
verified ·
1 Parent(s): c347529

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -9
app.py CHANGED
@@ -135,17 +135,25 @@ def fetch_weather_trend(lat, lon):
135
  return 'same'
136
 
137
  def generate_recommendations(original_severity, weather_trend):
 
 
 
 
138
  projected = task_rules[original_severity][weather_trend]
139
  rec = recommendations[projected]
140
- return (f"**Original Severity:** {original_severity.title()} \" \
141
- f"**Weather Trend:** {weather_trend.title()} \" \
142
- f"**Projected Severity:** {projected.title()}\n\n" \
143
- "### Management Recommendations:\n" \
144
- f"**Immediate:** {rec['immediate']}\n\n" \
145
- f"**Evacuation:** {rec['evacuation']}\n\n" \
146
- f"**Containment:** {rec['containment']}\n\n" \
147
- f"**Prevention:** {rec['prevention']}\n\n" \
148
- f"**Education:** {rec['education']}")
 
 
 
 
149
 
150
  def pipeline(image):
151
  if image is None:
 
135
  return 'same'
136
 
137
  def generate_recommendations(original_severity, weather_trend):
138
+ """
139
+ Generate management recommendations based on original severity and weather trend.
140
+ Returns a formatted markdown string.
141
+ """
142
  projected = task_rules[original_severity][weather_trend]
143
  rec = recommendations[projected]
144
+
145
+ # Build the output string using f-strings and implicit concatenation
146
+ return (
147
+ f"**Original Severity:** {original_severity.title()}\n"
148
+ f"**Weather Trend:** {weather_trend.title()}\n"
149
+ f"**Projected Severity:** {projected.title()}\n\n"
150
+ "### Management Recommendations:\n"
151
+ f"**Immediate:** {rec['immediate']}\n\n"
152
+ f"**Evacuation:** {rec['evacuation']}\n\n"
153
+ f"**Containment:** {rec['containment']}\n\n"
154
+ f"**Prevention:** {rec['prevention']}\n\n"
155
+ f"**Education:** {rec['education']}"
156
+ )
157
 
158
  def pipeline(image):
159
  if image is None: