Forgot to update tweaks to chart.py (namely not doubling up on marker counts when used multiple times in a run)
This commit is contained in:
parent
97d59d9a34
commit
d7e79d078f
59
chart.py
59
chart.py
|
@ -16,14 +16,14 @@ import matplotlib.pyplot as Plot
|
||||||
import matplotlib.patches as patches
|
import matplotlib.patches as patches
|
||||||
|
|
||||||
# consts
|
# consts
|
||||||
TITLE = "SGDQ 2024"
|
TITLE = "AGDQ 2025"
|
||||||
USE_LEGEND = True # display the legend with markers
|
USE_LEGEND = True # display the legend with markers
|
||||||
TITLE_OFFSET = 0 # 2.5 # to-do: dynamically set this to how many columns are set with legend
|
TITLE_OFFSET = 0 # 2.5 # to-do: dynamically set this to how many columns are set with legend
|
||||||
|
|
||||||
# les constant consts
|
# les constant consts
|
||||||
AUX_MODE = None # total | markers | None
|
AUX_MODE = None # total | markers | None
|
||||||
SORT_BY = None # sort runs by the values
|
SORT_BY = None # sort runs by the values
|
||||||
CUTOFF_SECONDS = 0
|
CUTOFF_SECONDS = 0 # 60 * 5
|
||||||
MODE = "scatter"
|
MODE = "scatter"
|
||||||
|
|
||||||
# more constant consts
|
# more constant consts
|
||||||
|
@ -35,7 +35,7 @@ OUT_FILE_TIMESTAMP = f'./images/{TIMESTAMP}.png'
|
||||||
OUT_FILE = f'./images/ratings[{SORT_BY or AUX_MODE or "chronological"}].png'
|
OUT_FILE = f'./images/ratings[{SORT_BY or AUX_MODE or "chronological"}].png'
|
||||||
|
|
||||||
MIN_COLUMNS = 2 # looks better if there's more than one column with the legend
|
MIN_COLUMNS = 2 # looks better if there's more than one column with the legend
|
||||||
CULL_SINGLETON_MARKERS = True # remove any marker that only has 1 entry
|
CULL_SINGLETON_MARKERS = False # remove any marker that only has 1 entry
|
||||||
COLOR_BY = "mean" # color by this stat's value
|
COLOR_BY = "mean" # color by this stat's value
|
||||||
FADE_BY_STDEV = True # fade outliers
|
FADE_BY_STDEV = True # fade outliers
|
||||||
LINES = ["mean_smart", "median"] # show mean and median lines (or stdev too)
|
LINES = ["mean_smart", "median"] # show mean and median lines (or stdev too)
|
||||||
|
@ -103,7 +103,7 @@ SCORES = {
|
||||||
"K": -1,
|
"K": -1,
|
||||||
"ZZZZ": 2.9,
|
"ZZZZ": 2.9,
|
||||||
"ZZZ-": 3.0,
|
"ZZZ-": 3.0,
|
||||||
"ZZZ": 3.1, "ZZ": 3.15, "Z-": 3.2, "Z": 3.25,
|
"ZZZ": 3.1, "ZZ": 3.15, "Z-": 3.2, "Z": 3.25, "DNF": 3.25,
|
||||||
"L": 3.25, "T": 3.25, "N": 3.25,
|
"L": 3.25, "T": 3.25, "N": 3.25,
|
||||||
"FFF": 3.5, "FF": 3.7,
|
"FFF": 3.5, "FF": 3.7,
|
||||||
"F-": 3.7, "F": 4.0, "F+": 4.3, "E": 4.5,
|
"F-": 3.7, "F": 4.0, "F+": 4.3, "E": 4.5,
|
||||||
|
@ -128,29 +128,30 @@ THREADS = {}
|
||||||
MARKERS = {}
|
MARKERS = {}
|
||||||
REVERSE_MARKERS = {}
|
REVERSE_MARKERS = {}
|
||||||
|
|
||||||
def add_marker( name, tag, color=COLORS["TEXT"], reverse=None ):
|
def add_marker( name, tag, color=COLORS["TEXT"], reverse=None, zoomer=None ):
|
||||||
MARKERS[name] = {
|
MARKERS[name] = {
|
||||||
"tag": tag,
|
"tag": tag,
|
||||||
"color": color,
|
"color": color,
|
||||||
"count": 0,
|
"count": 0,
|
||||||
"reverse": reverse,
|
"reverse": reverse,
|
||||||
|
"zoomer": zoomer,
|
||||||
}
|
}
|
||||||
|
|
||||||
add_marker("girl", tag="!", reverse="femcel")
|
add_marker("girl", tag="!", reverse="femcel", zoomer="gyatt")
|
||||||
add_marker("foid", tag="...", reverse="sex worker")
|
add_marker("foid", tag="...", reverse="sex worker", zoomer="skibidi")
|
||||||
add_marker("tranny", tag="*", reverse="real woman")
|
add_marker("tranny", tag="*", reverse="real woman", zoomer="fr")
|
||||||
add_marker("biohazard", tag="#")
|
add_marker("biohazard", tag="#")
|
||||||
add_marker("male", tag="♂")
|
add_marker("male", tag="♂")
|
||||||
add_marker("female", tag="♀")
|
add_marker("female", tag="♀")
|
||||||
add_marker("BOOBS", tag="( Y )")
|
add_marker("BOOBS", tag="( Y )")
|
||||||
add_marker("vt", tag="^")
|
add_marker("vt", tag="^")
|
||||||
add_marker("race", tag="@")
|
add_marker("race", tag="@")
|
||||||
add_marker("trainwreck/cringekino", tag="%", reverse="flawless")
|
add_marker("trainwreck/cringekino", tag="%", reverse="flawless", zoomer="fanum tax")
|
||||||
add_marker("DNF/invalid", tag="$", reverse="WR")
|
add_marker("DNF/invalid", tag="$", reverse="WR", zoomer="ohio")
|
||||||
add_marker("overestimate", tag=">", reverse="underestimate")
|
add_marker("overestimate", tag=">", reverse="underestimate", zoomer=":skull:")
|
||||||
add_marker("amogus", tag=" sus")
|
add_marker("amogus", tag=" sus")
|
||||||
add_marker("savestated", tag="\\")
|
add_marker("savestated", tag="\\")
|
||||||
add_marker("ad", tag="✡", reverse="organic")
|
add_marker("ad/nonrun", tag="✡", reverse="organic", zoomer="sigma")
|
||||||
|
|
||||||
# Ratings fetch related
|
# Ratings fetch related
|
||||||
|
|
||||||
|
@ -403,13 +404,13 @@ def title_format(s):
|
||||||
|
|
||||||
def plot_sub_scatter(sub, stats):
|
def plot_sub_scatter(sub, stats):
|
||||||
if DROP_Z_S:
|
if DROP_Z_S:
|
||||||
xticks = [("W", 8), ("Mid", 6), ("L", 4)] if ZOOMER else [("S", 9), ("A", 8), ("B", 7), ("C", 6), ("D", 5), ("F", 4)]
|
xticks = [("Bussin", 8), ("Mid Sheesh", 6), ("L Rizz", 4)] if ZOOMER else [("S", 9), ("A", 8), ("B", 7), ("C", 6), ("D", 5), ("F", 4)]
|
||||||
|
|
||||||
# set Range
|
# set Range
|
||||||
lo = xticks[-1][1] - 1
|
lo = xticks[-1][1] - 1
|
||||||
hi = xticks[0][1] + 1
|
hi = xticks[0][1] + 1
|
||||||
else:
|
else:
|
||||||
xticks = [("W", 8), ("Mid", 6), ("L", 4)] if ZOOMER else [("SSS", 10), ("S", 9), ("A", 8), ("B", 7), ("C", 6), ("D", 5), ("F", 4), ("Z", 3)]
|
xticks = [("Bussin", 8), ("Mid Sheesh", 6), ("L Rizz", 4)] if ZOOMER else [("SSS", 10), ("S", 9), ("A", 8), ("B", 7), ("C", 6), ("D", 5), ("F", 4), ("Z", 3)]
|
||||||
|
|
||||||
# set Range
|
# set Range
|
||||||
lo = xticks[-1][1]
|
lo = xticks[-1][1]
|
||||||
|
@ -492,13 +493,13 @@ def plot_sub_scatter(sub, stats):
|
||||||
|
|
||||||
def plot_sub_boxplot(sub, stats):
|
def plot_sub_boxplot(sub, stats):
|
||||||
if DROP_Z_S:
|
if DROP_Z_S:
|
||||||
xticks = [("W", 8), ("Mid", 6), ("L", 4)] if ZOOMER else [("S", 9), ("A", 8), ("B", 7), ("C", 6), ("D", 5), ("F", 4)]
|
xticks = [("Bussin", 8), ("Mid Sheesh", 6), ("L Rizz", 4)] if ZOOMER else [("S", 9), ("A", 8), ("B", 7), ("C", 6), ("D", 5), ("F", 4)]
|
||||||
|
|
||||||
# set Range
|
# set Range
|
||||||
lo = xticks[-1][1] - 1
|
lo = xticks[-1][1] - 1
|
||||||
hi = xticks[0][1] + 1
|
hi = xticks[0][1] + 1
|
||||||
else:
|
else:
|
||||||
xticks = [("W", 8), ("Mid", 6), ("L", 4)] if ZOOMER else [("SSS", 10), ("S", 9), ("A", 8), ("B", 7), ("C", 6), ("D", 5), ("F", 4), ("Z", 3)]
|
xticks = [("Bussin", 8), ("Mid Sheesh", 6), ("L Rizz", 4)] if ZOOMER else [("SSS", 10), ("S", 9), ("A", 8), ("B", 7), ("C", 6), ("D", 5), ("F", 4), ("Z", 3)]
|
||||||
|
|
||||||
# set Range
|
# set Range
|
||||||
lo = xticks[-1][1]
|
lo = xticks[-1][1]
|
||||||
|
@ -520,6 +521,7 @@ def plot_sub_boxplot(sub, stats):
|
||||||
# Set axis labels
|
# Set axis labels
|
||||||
sub.tick_params(axis="y", left=False, labelleft=False)
|
sub.tick_params(axis="y", left=False, labelleft=False)
|
||||||
sub.tick_params(axis="x", bottom=True, top=True, labelbottom=True, labeltop=True)
|
sub.tick_params(axis="x", bottom=True, top=True, labelbottom=True, labeltop=True)
|
||||||
|
|
||||||
sub.set_xticks([t[1] for t in xticks])
|
sub.set_xticks([t[1] for t in xticks])
|
||||||
sub.set_xticklabels([f"{t[0]} " for t in xticks], ha="center")
|
sub.set_xticklabels([f"{t[0]} " for t in xticks], ha="center")
|
||||||
|
|
||||||
|
@ -720,6 +722,7 @@ def create_plot( stats ):
|
||||||
tag = entry["tag"]
|
tag = entry["tag"]
|
||||||
count = entry["count"]
|
count = entry["count"]
|
||||||
reverse = entry["reverse"] if "reverse" in entry else None
|
reverse = entry["reverse"] if "reverse" in entry else None
|
||||||
|
zoomer = entry["zoomer"] if "zoomer" in entry else None
|
||||||
|
|
||||||
if count <= (1 if CULL_SINGLETON_MARKERS else 0):
|
if count <= (1 if CULL_SINGLETON_MARKERS else 0):
|
||||||
continue
|
continue
|
||||||
|
@ -730,6 +733,9 @@ def create_plot( stats ):
|
||||||
if REVERSE and reverse:
|
if REVERSE and reverse:
|
||||||
marker = reverse
|
marker = reverse
|
||||||
|
|
||||||
|
if ZOOMER and zoomer:
|
||||||
|
marker = zoomer
|
||||||
|
|
||||||
title = f'({count}) {marker}{tag}'
|
title = f'({count}) {marker}{tag}'
|
||||||
handles.append(patches.Patch(label=title_format(title), color="#000000"))
|
handles.append(patches.Patch(label=title_format(title), color="#000000"))
|
||||||
|
|
||||||
|
@ -801,14 +807,12 @@ def stat_new(name, ratings, entry={}):
|
||||||
|
|
||||||
# fix up previously split markers
|
# fix up previously split markers
|
||||||
for i, marker in enumerate(stat["markers"]):
|
for i, marker in enumerate(stat["markers"]):
|
||||||
if marker == "DNF":
|
if marker in ["DNF", "invalid"]:
|
||||||
stat["markers"][i] = "DNF/invalid"
|
stat["markers"][i] = "DNF/invalid"
|
||||||
elif marker == "trainwreck":
|
elif marker in ["trainwreck", "cringekino"]:
|
||||||
stat["markers"][i] = "trainwreck/cringekino"
|
|
||||||
elif marker == "invalid":
|
|
||||||
stat["markers"][i] = "DNF/invalid"
|
|
||||||
elif marker == "cringekino":
|
|
||||||
stat["markers"][i] = "trainwreck/cringekino"
|
stat["markers"][i] = "trainwreck/cringekino"
|
||||||
|
elif marker in ["ad", "nonrun"]:
|
||||||
|
stat["markers"][i] = "ad/nonrun"
|
||||||
|
|
||||||
if "event" in entry:
|
if "event" in entry:
|
||||||
stat["event"] = entry["event"]
|
stat["event"] = entry["event"]
|
||||||
|
@ -876,18 +880,23 @@ def read_stats(filename):
|
||||||
if random.random() < entry["randomize"] and rating > hi:
|
if random.random() < entry["randomize"] and rating > hi:
|
||||||
rating = random.uniform(lo, hi)
|
rating = random.uniform(lo, hi)
|
||||||
|
|
||||||
|
if ("reverse" in entry and random.random() < entry["reverse"]) or REVERSE:
|
||||||
|
rating = 10 - rating + 2.75
|
||||||
|
|
||||||
ratings.append( rating )
|
ratings.append( rating )
|
||||||
aux["total"].append( rating )
|
aux["total"].append( rating )
|
||||||
|
|
||||||
stat = stat_new(name, ratings, entry)
|
stat = stat_new(name, ratings, entry)
|
||||||
stats.append(stat)
|
stats.append(stat)
|
||||||
|
|
||||||
# increment marker totals
|
# flatten
|
||||||
for marker in stat["markers"]:
|
for marker in {*stat["markers"]}:
|
||||||
if marker not in MARKERS:
|
if marker not in MARKERS:
|
||||||
continue
|
continue
|
||||||
MARKERS[marker]["count"] += 1
|
MARKERS[marker]["count"] += 1
|
||||||
|
|
||||||
|
# increment marker totals
|
||||||
|
for marker in stat["markers"]:
|
||||||
for rating in ratings:
|
for rating in ratings:
|
||||||
if marker not in aux["markers"]:
|
if marker not in aux["markers"]:
|
||||||
aux["markers"][marker] = []
|
aux["markers"][marker] = []
|
||||||
|
@ -967,10 +976,8 @@ def main():
|
||||||
if CUTOFF_SECONDS > 0:
|
if CUTOFF_SECONDS > 0:
|
||||||
modifiers.append(f'[cutoff={CUTOFF_SECONDS//60}]')
|
modifiers.append(f'[cutoff={CUTOFF_SECONDS//60}]')
|
||||||
|
|
||||||
|
|
||||||
OUT_FILE = f'./images/ratings{"".join(modifiers)}.png'
|
OUT_FILE = f'./images/ratings{"".join(modifiers)}.png'
|
||||||
|
|
||||||
|
|
||||||
REVERSE = args.reverse
|
REVERSE = args.reverse
|
||||||
ZOOMER = args.zoomer
|
ZOOMER = args.zoomer
|
||||||
DARK = not args.light
|
DARK = not args.light
|
||||||
|
|
Loading…
Reference in New Issue
Block a user