SHELLAPANDIANGANHUNGING commited on
Commit
87be6b5
Β·
verified Β·
1 Parent(s): b985caa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
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
- Tyre pressure increases with operating temperature, rising from cold inflation levels as heat builds during operation.
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}, 12:00–18:00: 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}, 12:00–18:00: Peak Amber alarm at {h_peak:02d}:00 ({c_peak} occurrences).")
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–00:00: 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–00:00: 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,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 high, close to threshold, with a small number of Red alarms. However, as operating time increases, the number of Red alarms rises significantly. Furthermore, during 04:00–06:00, operational slowdown likely occurs β€” leading to a decrease in Red alarm notifications.",
800
- "β€’ When the unit begins operation, notifications often indicate pressure below the minimum threshold due to initially low rear tyre pressure. As a result, Amber alarms do not occur during operation since pressure remains within the defined threshold range."
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