Skip to content

Commit a61804a

Browse files
authored
Merge pull request #36 from legend-exp/pre-commit-ci-update-config
chore: update pre-commit hooks
2 parents f103828 + c07d50c commit a61804a

6 files changed

+19
-17
lines changed

.pre-commit-config.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ repos:
2525
- id: trailing-whitespace
2626

2727
- repo: https://github.com/psf/black
28-
rev: "23.12.1"
28+
rev: "24.3.0"
2929
hooks:
3030
- id: black-jupyter
3131
args: ["--line-length", "99"]
3232

3333
- repo: https://github.com/astral-sh/ruff-pre-commit
34-
rev: "v0.1.9"
34+
rev: "v0.3.4"
3535
hooks:
3636
- id: ruff
3737
args: ["--fix", "--show-fixes"]
@@ -42,14 +42,14 @@ repos:
4242
- id: setup-cfg-fmt
4343

4444
- repo: https://github.com/pre-commit/mirrors-mypy
45-
rev: "v1.8.0"
45+
rev: "v1.9.0"
4646
hooks:
4747
- id: mypy
4848
files: src
4949
stages: [manual]
5050

5151
- repo: https://github.com/kynan/nbstripout
52-
rev: "0.6.1"
52+
rev: "0.7.1"
5353
hooks:
5454
- id: nbstripout
5555
args: ["--drop-empty-cells",
@@ -68,7 +68,7 @@ repos:
6868
args: ["-L", "nd,unparseable,compiletime,livetime,fom,puls"]
6969

7070
- repo: https://github.com/shellcheck-py/shellcheck-py
71-
rev: "v0.9.0.6"
71+
rev: "v0.10.0.1"
7272
hooks:
7373
- id: shellcheck
7474

@@ -86,7 +86,7 @@ repos:
8686
types_or: [json]
8787

8888
- repo: https://github.com/snakemake/snakefmt
89-
rev: v0.8.5
89+
rev: v0.10.0
9090
hooks:
9191
- id: snakefmt
9292
files: Snakefile*|\.smk

rules/common.smk

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Helper functions for running data production
33
"""
4+
45
import pathlib, os
56
from scripts.util.patterns import (
67
par_overwrite_path,

rules/dsp.smk

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Snakemake rules for processing dsp tier. This is done in 4 steps:
55
- combining of all channels into single pars files with associated plot and results files
66
- running dsp over all channels using par file
77
"""
8+
89
from scripts.util.pars_loading import pars_catalog
910
from scripts.util.patterns import (
1011
get_pattern_pars_tmp_channel,

scripts/pars_hit_aoe.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def eres_func(x):
221221
pkl.dump(out_plot_dict, w, protocol=pkl.HIGHEST_PROTOCOL)
222222

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

232232
pathlib.Path(os.path.dirname(args.aoe_results)).mkdir(parents=True, exist_ok=True)
233233
final_object_dict = dict(
234-
**object_dict,
235-
aoe=obj,
236-
)
234+
**object_dict,
235+
aoe=obj,
236+
)
237237
with open(args.aoe_results, "wb") as w:
238238
pkl.dump(final_object_dict, w, protocol=pkl.HIGHEST_PROTOCOL)

scripts/pars_hit_ecal.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -283,19 +283,19 @@ def energy_cal_th(
283283
if plot in item:
284284
param_dict.update({plot: item[plot]})
285285
common_dict.update({key: param_dict})
286-
plot_dict = {"ecal":plot_dict}
286+
plot_dict = {"ecal": plot_dict}
287287
plot_dict["common"] = common_dict
288288

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

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

298298
# save calibration objects
299299
with open(args.results_path, "wb") as fp:
300300
pathlib.Path(os.path.dirname(args.results_path)).mkdir(parents=True, exist_ok=True)
301-
pkl.dump({"ecal":ecal_object}, fp, protocol=pkl.HIGHEST_PROTOCOL)
301+
pkl.dump({"ecal": ecal_object}, fp, protocol=pkl.HIGHEST_PROTOCOL)

scripts/pars_hit_lq.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def eres_func(x):
220220
pkl.dump(out_plot_dict, w, protocol=pkl.HIGHEST_PROTOCOL)
221221

222222

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

232232
pathlib.Path(os.path.dirname(args.lq_results)).mkdir(parents=True, exist_ok=True)
233233
final_object_dict = dict(
234-
**object_dict,
235-
lq=obj,
236-
)
234+
**object_dict,
235+
lq=obj,
236+
)
237237
with open(args.lq_results, "wb") as w:
238238
pkl.dump(final_object_dict, w, protocol=pkl.HIGHEST_PROTOCOL)

0 commit comments

Comments
 (0)