Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Mar 25, 2024
1 parent aa2c20e commit da22978
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions scripts/pars_hit_aoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def eres_func(x):
pkl.dump(out_plot_dict, w, protocol=pkl.HIGHEST_PROTOCOL)

pathlib.Path(os.path.dirname(args.hit_pars)).mkdir(parents=True, exist_ok=True)
results_dict = dict(**ecal_dict["results"], aoe = out_dict)
results_dict = dict(**ecal_dict["results"], aoe=out_dict)
with open(args.hit_pars, "w") as w:
final_hit_dict = {
"pars": {"operations": cal_dict},
Expand All @@ -231,8 +231,8 @@ def eres_func(x):

pathlib.Path(os.path.dirname(args.aoe_results)).mkdir(parents=True, exist_ok=True)
final_object_dict = dict(
**object_dict,
aoe=obj,
)
**object_dict,
aoe=obj,
)
with open(args.aoe_results, "wb") as w:
pkl.dump(final_object_dict, w, protocol=pkl.HIGHEST_PROTOCOL)
6 changes: 3 additions & 3 deletions scripts/pars_hit_ecal.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,19 +283,19 @@ def energy_cal_th(
if plot in item:
param_dict.update({plot: item[plot]})
common_dict.update({key: param_dict})
plot_dict = {"ecal":plot_dict}
plot_dict = {"ecal": plot_dict}
plot_dict["common"] = common_dict

with open(args.plot_path, "wb") as f:
pkl.dump(plot_dict, f, protocol=pkl.HIGHEST_PROTOCOL)

# save output dictionary
output_dict = {"pars": out_dict, "results": {"ecal":result_dict}}
output_dict = {"pars": out_dict, "results": {"ecal": result_dict}}
with open(args.save_path, "w") as fp:
pathlib.Path(os.path.dirname(args.save_path)).mkdir(parents=True, exist_ok=True)
json.dump(output_dict, fp, indent=4)

# save calibration objects
with open(args.results_path, "wb") as fp:
pathlib.Path(os.path.dirname(args.results_path)).mkdir(parents=True, exist_ok=True)
pkl.dump({"ecal":ecal_object}, fp, protocol=pkl.HIGHEST_PROTOCOL)
pkl.dump({"ecal": ecal_object}, fp, protocol=pkl.HIGHEST_PROTOCOL)
8 changes: 4 additions & 4 deletions scripts/pars_hit_lq.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def eres_func(x):
pkl.dump(out_plot_dict, w, protocol=pkl.HIGHEST_PROTOCOL)


results_dict = dict(**eres_dict,lq = out_dict)
results_dict = dict(**eres_dict, lq=out_dict)
pathlib.Path(os.path.dirname(args.hit_pars)).mkdir(parents=True, exist_ok=True)
with open(args.hit_pars, "w") as w:
final_hit_dict = {
Expand All @@ -231,8 +231,8 @@ def eres_func(x):

pathlib.Path(os.path.dirname(args.lq_results)).mkdir(parents=True, exist_ok=True)
final_object_dict = dict(
**object_dict,
lq=obj,
)
**object_dict,
lq=obj,
)
with open(args.lq_results, "wb") as w:
pkl.dump(final_object_dict, w, protocol=pkl.HIGHEST_PROTOCOL)

0 comments on commit da22978

Please sign in to comment.