Skip to content

Commit

Permalink
fix python formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
artlbv committed Apr 4, 2024
1 parent f498337 commit 9cc09ab
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions menu_tools/utils/compare_plots.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
import argparse
import os, sys
import os
import json
import numpy as np
import pandas as pd
from glob import glob

import matplotlib.pyplot as plt
import mplhep as hep

f = plt.figure()
plt.close()
import mplhep as hep


plt.style.use(hep.style.CMS)
plt.rcParams["figure.facecolor"] = "white"

import numpy as np
import pandas as pd
import yaml
import json


def load_json(fname):
with open(fname) as f:
Expand Down Expand Up @@ -174,12 +171,13 @@ def comp_plots(
diff.plot(
ax=axs[1], color=color, label=label
) # , marker = ".", color = color)
# axs[1].errorbar(p1["xbins"],df_p1 - df_p2,
# yerr = np.hypot(plots[0]["efficiency_err"], plots[1]["efficiency_err"]),
# label = label, marker = ".", color = color
# # label = label, ls = lss[i], color = color, mfc="none" if i == 1 else color,
# # **(p1["err_kwargs"])
# )
# axs[1].errorbar(
# p1["xbins"],df_p1 - df_p2,
# yerr = np.hypot(plots[0]["efficiency_err"], plots[1]["efficiency_err"]),
# # label = label, marker = ".", color = color,
# label = label, ls = lss[i], color = color, mfc="none" if i == 1 else color,
# **(p1["err_kwargs"])
# )
if ptype == "turnon":
if len(plots[0]["efficiency_err"][0]) != len(
plots[1]["efficiency_err"][0]
Expand Down Expand Up @@ -254,7 +252,7 @@ def main(v0, v1, v0_jsons):
print("WARNING, unsupported plot type")
continue

f = comp_plots(
comp_plots(
plot1,
plot2,
sfxs=[v0, v1],
Expand All @@ -264,7 +262,10 @@ def main(v0, v1, v0_jsons):
ptype=ptype,
)

# outfname = v0_json.replace(v0,"%svs%s"%(v0,v1)).replace(".json",".png").replace("tools","tools/comparisons")
# outfname = v0_json.replace(
# v0,"%svs%s"%(v0,v1)).replace(
# ".json",".png").replace("tools","tools/comparisons")

outfname = (
v0_json.replace(v0, "%svs%s" % (v0, v1))
.replace(".json", ".png")
Expand Down Expand Up @@ -295,9 +296,10 @@ def main(v0, v1, v0_jsons):
# v0 = "V32nano"
# v0 = "V31"

basedir = "/eos/user/a/alobanov/www/L1T/Phase2/menu/Validation/NewMenuTools"
v0_jsons = glob(
# f"/eos/user/a/alobanov/www/L1T/Phase2/menu/Validation/tool_refact_test/object_performance/{v0}//s*/**.json")
f"/eos/user/a/alobanov/www/L1T/Phase2/menu/Validation/NewMenuTools/{v0}/object_performance/r*/*JetsBy*.json"
# f"{basedir}/{v0}//s*/**.json")
f"{basedir}/{v0}/object_performance/r*/*JetsBy*.json"
)

# v1 = "V29"
Expand Down

0 comments on commit 9cc09ab

Please sign in to comment.