Skip to content

Commit

Permalink
Final fixes for plots and tables
Browse files Browse the repository at this point in the history
  • Loading branch information
vulder committed Nov 27, 2023
1 parent 28ac7b6 commit 438e8fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def precise_pim_regression_check(
abs_cut_off: int = 20
) -> bool:
is_regression = False
abs_cut_off = 100

for feature, old_values in baseline_pim.items():
if feature in current_pim:
Expand All @@ -178,12 +179,10 @@ def precise_pim_regression_check(

ttest_res = ttest_ind(old_values, new_values)

# TODO: check, maybe we need a "very small value cut off"
if ttest_res.pvalue < 0.05:
# print(f"Found regression for feature {feature}.")
is_regression = True
else:
if np.mean(old_values) > 20:
if np.mean(old_values) > abs_cut_off:
print(
f"Could not find feature {feature} in new trace. "
f"({np.mean(old_values)}us lost)"
Expand Down Expand Up @@ -603,7 +602,6 @@ def compute_profiler_predictions(
return None

try:
#print(f"{report_files[0]}")
result_dict[config_id] = profiler.is_regression(
report_files[0], patch_name
)
Expand Down
7 changes: 3 additions & 4 deletions varats/varats/plots/feature_perf_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def plot(self, view_mode: bool) -> None:
value_name="value"
)

colors = sns.color_palette("Paired", len(case_studies) * 2)
colors = sns.color_palette("Paired", len(profilers) * 2)
_, axes = plt.subplots(ncols=len(profilers), nrows=1, sharey=True)

for idx, profiler in enumerate(profilers):
Expand All @@ -129,7 +129,6 @@ def plot(self, view_mode: bool) -> None:
cut=0,
split=True,
palette=color_slice,
alpha=.25,
linewidth=1,
ax=ax
)
Expand All @@ -144,8 +143,8 @@ def plot(self, view_mode: bool) -> None:
linewidth=0.5,
marker='x',
palette=[
mcolors.CSS4_COLORS['dimgrey'],
mcolors.CSS4_COLORS['darkgrey']
mcolors.XKCD_COLORS['xkcd:dark grey'],
mcolors.CSS4_COLORS['dimgrey']
],
size=7,
ax=ax
Expand Down
5 changes: 4 additions & 1 deletion varats/varats/tables/feature_perf_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ def tabulate(self, table_format: TableFormat, wrap_table: bool) -> str:
overhead_df['overhead_memory_rel'].replace([np.inf, -np.inf],
np.nan,
inplace=True)
print(f"{overhead_df=}")

# Merge with precision data
merged_df = pd.merge(
Expand Down Expand Up @@ -615,6 +614,10 @@ def tabulate(self, table_format: TableFormat, wrap_table: bool) -> str:
locs: int
if case_study.project_cls.DOMAIN == ProjectDomains.TEST:
src_folder = f'projects/{project_name}'
if src_folder.endswith(
"projects/SynthCTTemplateSpecialization"
):
src_folder = "projects/SynthCTSpecialization"
locs = self._calc_folder_locs(
project_git_path, rev.hash, src_folder
)
Expand Down

0 comments on commit 438e8fd

Please sign in to comment.