Spaces:
Sleeping
Sleeping
Update utils.py
Browse files
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 |
-
"
|
|
|
|
| 11 |
]
|
| 12 |
for field in required_fields:
|
| 13 |
if not input_data[field]:
|
| 14 |
-
return f"Please select or fill in {field.replace('_', ' ').
|
| 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 |
-
|
| 20 |
-
|
| 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):
|