mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
GH-114448: Don't sort summarize_stats.py histograms by amount of change (GH-114449)
This commit is contained in:
parent
5cd9c6b1fc
commit
e45bae7a45
1 changed files with 7 additions and 4 deletions
|
@ -460,8 +460,11 @@ class JoinMode(enum.Enum):
|
||||||
# second column of each input table as a new column
|
# second column of each input table as a new column
|
||||||
CHANGE = 1
|
CHANGE = 1
|
||||||
# Join using the first column as a key, indicating the change in the second
|
# Join using the first column as a key, indicating the change in the second
|
||||||
# column of each input table as a ne column, and omit all other columns
|
# column of each input table as a new column, and omit all other columns
|
||||||
CHANGE_ONE_COLUMN = 2
|
CHANGE_ONE_COLUMN = 2
|
||||||
|
# Join using the first column as a key, and indicate the change as a new
|
||||||
|
# column, but don't sort by the amount of change.
|
||||||
|
CHANGE_NO_SORT = 3
|
||||||
|
|
||||||
|
|
||||||
class Table:
|
class Table:
|
||||||
|
@ -484,7 +487,7 @@ class Table:
|
||||||
match self.join_mode:
|
match self.join_mode:
|
||||||
case JoinMode.SIMPLE:
|
case JoinMode.SIMPLE:
|
||||||
return (key, *row_a, *row_b)
|
return (key, *row_a, *row_b)
|
||||||
case JoinMode.CHANGE:
|
case JoinMode.CHANGE | JoinMode.CHANGE_NO_SORT:
|
||||||
return (key, *row_a, *row_b, DiffRatio(row_a[0], row_b[0]))
|
return (key, *row_a, *row_b, DiffRatio(row_a[0], row_b[0]))
|
||||||
case JoinMode.CHANGE_ONE_COLUMN:
|
case JoinMode.CHANGE_ONE_COLUMN:
|
||||||
return (key, row_a[0], row_b[0], DiffRatio(row_a[0], row_b[0]))
|
return (key, row_a[0], row_b[0], DiffRatio(row_a[0], row_b[0]))
|
||||||
|
@ -497,7 +500,7 @@ class Table:
|
||||||
*("Base " + x for x in columns[1:]),
|
*("Base " + x for x in columns[1:]),
|
||||||
*("Head " + x for x in columns[1:]),
|
*("Head " + x for x in columns[1:]),
|
||||||
)
|
)
|
||||||
case JoinMode.CHANGE:
|
case JoinMode.CHANGE | JoinMode.CHANGE_NO_SORT:
|
||||||
return (
|
return (
|
||||||
columns[0],
|
columns[0],
|
||||||
*("Base " + x for x in columns[1:]),
|
*("Base " + x for x in columns[1:]),
|
||||||
|
@ -1027,7 +1030,7 @@ def optimization_section() -> Section:
|
||||||
Table(
|
Table(
|
||||||
("Range", "Count:", "Ratio:"),
|
("Range", "Count:", "Ratio:"),
|
||||||
calc_histogram_table(name, den),
|
calc_histogram_table(name, den),
|
||||||
JoinMode.CHANGE,
|
JoinMode.CHANGE_NO_SORT,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue