badaoui HF Staff commited on
Commit
02d37d2
·
verified ·
1 Parent(s): 840d3e5

Update model_page.py

Browse files
Files changed (1) hide show
  1. model_page.py +10 -10
model_page.py CHANGED
@@ -42,11 +42,11 @@ def _create_pie_chart(ax: plt.Axes, device_label: str, filtered_stats: dict) ->
42
  """Create a pie chart for device statistics."""
43
  if not filtered_stats:
44
  ax.text(0.5, 0.5, 'No test results',
45
- horizontalalignment='center', verticalalignment='center',
46
- transform=ax.transAxes, fontsize=14, color='#888888',
47
- fontfamily='monospace', weight='normal')
48
  ax.set_title(device_label, fontsize=DEVICE_TITLE_FONT_SIZE, weight='bold',
49
- pad=DEVICE_TITLE_PAD, color=TITLE_COLOR, fontfamily='monospace')
50
  ax.axis('off')
51
  return
52
 
@@ -63,7 +63,7 @@ def _create_pie_chart(ax: plt.Axes, device_label: str, filtered_stats: dict) ->
63
  shadow=False,
64
  wedgeprops=dict(edgecolor='#1a1a1a', linewidth=BORDER_LINE_WIDTH), # Minimal borders
65
  textprops={'fontsize': 12, 'weight': 'normal',
66
- 'color': LABEL_COLOR, 'fontfamily': 'monospace'}
67
  )
68
 
69
  # Enhanced percentage text styling for better readability
@@ -82,7 +82,7 @@ def _create_pie_chart(ax: plt.Axes, device_label: str, filtered_stats: dict) ->
82
 
83
  # Device label closer to chart and bigger
84
  ax.set_title(device_label, fontsize=DEVICE_TITLE_FONT_SIZE, weight='normal',
85
- pad=DEVICE_TITLE_PAD, color=TITLE_COLOR, fontfamily='monospace')
86
 
87
 
88
  def plot_model_stats(df: pd.DataFrame, model_name: str) -> tuple[plt.Figure, str, str]:
@@ -124,12 +124,12 @@ def plot_model_stats(df: pd.DataFrame, model_name: str) -> tuple[plt.Figure, str
124
  # Add subtle separation line between charts - stops at device labels level
125
  line_x = 0.5
126
  fig.add_artist(plt.Line2D([line_x, line_x], [0.0, SEPARATOR_LINE_Y_END],
127
- color='#333333', linewidth=SEPARATOR_LINE_WIDTH,
128
- alpha=SEPARATOR_ALPHA, transform=fig.transFigure))
129
 
130
  # Add central shared title for model name
131
  fig.suptitle(f'{model_name.lower()}', fontsize=32, weight='bold',
132
- color='#CCCCCC', fontfamily='monospace', y=MODEL_TITLE_Y)
133
 
134
  # Clean layout with padding and space for central title
135
  plt.tight_layout()
@@ -177,4 +177,4 @@ def prepare_textbox_content(failures: dict[str, list], device: str, data_availab
177
  name = name.split("::")[-1]
178
  info_lines.append(name)
179
 
180
- return "\n".join(info_lines)
 
42
  """Create a pie chart for device statistics."""
43
  if not filtered_stats:
44
  ax.text(0.5, 0.5, 'No test results',
45
+ horizontalalignment='center', verticalalignment='center',
46
+ transform=ax.transAxes, fontsize=14, color='#888888',
47
+ fontfamily='monospace', weight='normal')
48
  ax.set_title(device_label, fontsize=DEVICE_TITLE_FONT_SIZE, weight='bold',
49
+ pad=DEVICE_TITLE_PAD, color=TITLE_COLOR, fontfamily='monospace')
50
  ax.axis('off')
51
  return
52
 
 
63
  shadow=False,
64
  wedgeprops=dict(edgecolor='#1a1a1a', linewidth=BORDER_LINE_WIDTH), # Minimal borders
65
  textprops={'fontsize': 12, 'weight': 'normal',
66
+ 'color': LABEL_COLOR, 'fontfamily': 'monospace'}
67
  )
68
 
69
  # Enhanced percentage text styling for better readability
 
82
 
83
  # Device label closer to chart and bigger
84
  ax.set_title(device_label, fontsize=DEVICE_TITLE_FONT_SIZE, weight='normal',
85
+ pad=DEVICE_TITLE_PAD, color=TITLE_COLOR, fontfamily='monospace')
86
 
87
 
88
  def plot_model_stats(df: pd.DataFrame, model_name: str) -> tuple[plt.Figure, str, str]:
 
124
  # Add subtle separation line between charts - stops at device labels level
125
  line_x = 0.5
126
  fig.add_artist(plt.Line2D([line_x, line_x], [0.0, SEPARATOR_LINE_Y_END],
127
+ color='#333333', linewidth=SEPARATOR_LINE_WIDTH,
128
+ alpha=SEPARATOR_ALPHA, transform=fig.transFigure))
129
 
130
  # Add central shared title for model name
131
  fig.suptitle(f'{model_name.lower()}', fontsize=32, weight='bold',
132
+ color='#CCCCCC', fontfamily='monospace', y=MODEL_TITLE_Y)
133
 
134
  # Clean layout with padding and space for central title
135
  plt.tight_layout()
 
177
  name = name.split("::")[-1]
178
  info_lines.append(name)
179
 
180
+ return "\n".join(info_lines)