AjaykumarPilla commited on
Commit
eb03e55
·
verified ·
1 Parent(s): 14faef4

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +5 -5
utils.py CHANGED
@@ -7,18 +7,18 @@ def validate_inputs(input_data):
7
  required_fields = [
8
  "project_name", "phase", "task", "current_progress",
9
  "task_expected_duration", "task_actual_duration", "workforce_gap",
10
- "workforce_shift_hours", "weather_condition", "weather_forecast_date"
 
11
  ]
12
  for field in required_fields:
13
  if not input_data[field]:
14
- return f"Please select or fill in {field.replace('_', ' ').title()}"
15
  if not (0 <= input_data["current_progress"] <= 100):
16
  return "Current progress must be between 0 and 100"
17
  if not (0 <= input_data["workforce_gap"] <= 100):
18
  return "Workforce gap must be between 0 and 100"
19
- valid_weather_conditions = ["Sunny", "Partly Cloudy", "Cloudy", "Light Rain", "Heavy Rain", "Severe Storm"]
20
- if input_data["weather_condition"] not in valid_weather_conditions:
21
- return "Please select a valid weather condition"
22
  return None
23
 
24
  def generate_heatmap(delay_probability, label):
 
7
  required_fields = [
8
  "project_name", "phase", "task", "current_progress",
9
  "task_expected_duration", "task_actual_duration", "workforce_gap",
10
+ "workforce_skill_level", "workforce_shift_hours", "weather_impact_score",
11
+ "weather_condition", "weather_forecast_date", "project_location"
12
  ]
13
  for field in required_fields:
14
  if not input_data[field]:
15
+ return f"Please select or fill in {field.replace('_', ' ').lower()}"
16
  if not (0 <= input_data["current_progress"] <= 100):
17
  return "Current progress must be between 0 and 100"
18
  if not (0 <= input_data["workforce_gap"] <= 100):
19
  return "Workforce gap must be between 0 and 100"
20
+ if not (0 <= input_data["weather_impact_score"] <= 100):
21
+ return "Weather impact score must be between 0 and 100"
 
22
  return None
23
 
24
  def generate_heatmap(delay_probability, label):