Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -438,7 +438,7 @@ rear_temp_avg = dff[dff['Position'].isin([3, 4])]['Temperature (Β°C)'].mean()
|
|
| 438 |
# Mekanikal: Ban depan tanggung beban pengereman & kemudi β stres lebih tinggi
|
| 439 |
if front_pressure_avg < rear_pressure_avg and front_temp_avg > rear_temp_avg:
|
| 440 |
insight_text = f"""
|
| 441 |
-
|
| 442 |
"""
|
| 443 |
|
| 444 |
elif front_pressure_avg > rear_pressure_avg and front_temp_avg < rear_temp_avg:
|
|
@@ -764,13 +764,13 @@ else:
|
|
| 764 |
if not red_sub.empty:
|
| 765 |
h_peak = int(red_sub['hour'].value_counts().idxmax())
|
| 766 |
c_peak = int(red_sub['hour'].value_counts().max())
|
| 767 |
-
insight_lines.append(f"β’ Position {pos},
|
| 768 |
|
| 769 |
amber_sub = band1[band1['is_amber']]
|
| 770 |
if not amber_sub.empty:
|
| 771 |
h_peak = int(amber_sub['hour'].value_counts().idxmax())
|
| 772 |
c_peak = int(amber_sub['hour'].value_counts().max())
|
| 773 |
-
insight_lines.append(f"β’ Position {pos},
|
| 774 |
|
| 775 |
# β Band 2 β
|
| 776 |
if not band2.empty:
|
|
@@ -778,13 +778,13 @@ else:
|
|
| 778 |
if not red_sub.empty:
|
| 779 |
h_peak = int(red_sub['hour'].value_counts().idxmax())
|
| 780 |
c_peak = int(red_sub['hour'].value_counts().max())
|
| 781 |
-
insight_lines.append(f"β’ Position {pos}, 18:00β
|
| 782 |
|
| 783 |
amber_sub = band2[band2['is_amber']]
|
| 784 |
if not amber_sub.empty:
|
| 785 |
h_peak = int(amber_sub['hour'].value_counts().idxmax())
|
| 786 |
c_peak = int(amber_sub['hour'].value_counts().max())
|
| 787 |
-
insight_lines.append(f"β’ Position {pos}, 18:00β
|
| 788 |
|
| 789 |
# Jika tidak ada alarm di posisi 1β4
|
| 790 |
if not insight_lines:
|
|
@@ -796,8 +796,8 @@ has_rear_amber = not red_amber_data[(red_amber_data['Position'].isin([3, 4])) &
|
|
| 796 |
|
| 797 |
if has_front_red or has_rear_amber:
|
| 798 |
insight_lines.extend([
|
| 799 |
-
"β’ The front tyre pressure is
|
| 800 |
-
"β’
|
| 801 |
])
|
| 802 |
|
| 803 |
# Gabungkan jadi satu string, tiap baris baru β \n
|
|
|
|
| 438 |
# Mekanikal: Ban depan tanggung beban pengereman & kemudi β stres lebih tinggi
|
| 439 |
if front_pressure_avg < rear_pressure_avg and front_temp_avg > rear_temp_avg:
|
| 440 |
insight_text = f"""
|
| 441 |
+
Rear tyres have higher pressure because they have higher specifications (10.00 R20 vs 11.00 R20)
|
| 442 |
"""
|
| 443 |
|
| 444 |
elif front_pressure_avg > rear_pressure_avg and front_temp_avg < rear_temp_avg:
|
|
|
|
| 764 |
if not red_sub.empty:
|
| 765 |
h_peak = int(red_sub['hour'].value_counts().idxmax())
|
| 766 |
c_peak = int(red_sub['hour'].value_counts().max())
|
| 767 |
+
insight_lines.append(f"β’ Position {pos}, 06:00β18:00 (Day Shift): Peak Red alarm at {h_peak:02d}:00 ({c_peak} occurrences).")
|
| 768 |
|
| 769 |
amber_sub = band1[band1['is_amber']]
|
| 770 |
if not amber_sub.empty:
|
| 771 |
h_peak = int(amber_sub['hour'].value_counts().idxmax())
|
| 772 |
c_peak = int(amber_sub['hour'].value_counts().max())
|
| 773 |
+
insight_lines.append(f"β’ Position {pos}, 06:00β18:00 (Day Shift): Peak Amber alarm at {h_peak:02d}:00 ({c_peak} occurrences).")
|
| 774 |
|
| 775 |
# β Band 2 β
|
| 776 |
if not band2.empty:
|
|
|
|
| 778 |
if not red_sub.empty:
|
| 779 |
h_peak = int(red_sub['hour'].value_counts().idxmax())
|
| 780 |
c_peak = int(red_sub['hour'].value_counts().max())
|
| 781 |
+
insight_lines.append(f"β’ Position {pos}, 18:00β06:00 (Night Shift): Peak Red alarm at {h_peak:02d}:00 ({c_peak} occurrences).")
|
| 782 |
|
| 783 |
amber_sub = band2[band2['is_amber']]
|
| 784 |
if not amber_sub.empty:
|
| 785 |
h_peak = int(amber_sub['hour'].value_counts().idxmax())
|
| 786 |
c_peak = int(amber_sub['hour'].value_counts().max())
|
| 787 |
+
insight_lines.append(f"β’ Position {pos}, 18:00β06:00 (Night Shift): Peak Amber alarm at {h_peak:02d}:00 ({c_peak} occurrences).")
|
| 788 |
|
| 789 |
# Jika tidak ada alarm di posisi 1β4
|
| 790 |
if not insight_lines:
|
|
|
|
| 796 |
|
| 797 |
if has_front_red or has_rear_amber:
|
| 798 |
insight_lines.extend([
|
| 799 |
+
"β’ The front tyre pressure is closed to upper threshold before equipment is being operated. It is shown by small number of red alarms in the early day shift and increase as being operated. Furthermore, during 04:00β06:00, red alarm decrease and it is likely due to operational slowdown.",
|
| 800 |
+
"β’ In contrast, for rear tyres, notifications often indicate pressure below the lower threshold. As a result, amber alarms frequently occur early in the shift and return to normal as the tyres warm up during operation."
|
| 801 |
])
|
| 802 |
|
| 803 |
# Gabungkan jadi satu string, tiap baris baru β \n
|