Skip to content

Commit 48744d4

Browse files
committed
update pre-commit config, add black-compatible flake8 linting
1 parent 5467c5b commit 48744d4

File tree

4 files changed

+45
-24
lines changed

4 files changed

+45
-24
lines changed

.pre-commit-config.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,26 @@ repos:
2020
- repo: https://github.com/pre-commit/pre-commit-hooks
2121
rev: v6.0.0
2222
hooks:
23+
- id: trailing-whitespace
24+
- id: check-added-large-files
25+
- id: check-ast
2326
- id: check-json
27+
- id: check-merge-conflict
28+
- id: check-xml
2429
- id: check-yaml
25-
- id: trailing-whitespace
30+
- id: debug-statements
2631
- id: end-of-file-fixer
32+
- id: requirements-txt-fixer
33+
- id: mixed-line-ending
34+
args: ['--fix=no']
35+
36+
- repo: https://github.com/PyCQA/flake8
37+
rev: 6.0.0
38+
hooks:
39+
- id: flake8
40+
# black-compatible flake-8 config
41+
42+
# E203 is not PEP8 compliant
43+
# E402 due to logging.basicConfig in pipeline.py
44+
args: ['--max-line-length=150',
45+
'--extend-ignore=E203,E402,W605']

requirements.txt

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
numpy
2-
scipy
3-
matplotlib
4-
plotly
5-
pandas
6-
scikit-learn
1+
--extra-index-url https://download.pytorch.org/whl/cu121
2+
awkward
3+
fastjet
74
h5py
8-
tqdm
5+
hydra-colorlog
6+
hydra-core
97
ipykernel
10-
uproot
11-
awkward
12-
vector
8+
jupyterlab
139
kaleido
10+
lightning
11+
matplotlib
12+
nbdev
1413
nbformat
15-
jupyterlab
16-
fastjet
17-
pyarrow
14+
numpy
15+
omegaconf
16+
pandas
17+
plotly
1818
pre-commit
19-
--extra-index-url https://download.pytorch.org/whl/cu121
19+
pyarrow
20+
scikit-learn
21+
scipy
22+
tensorboardX
2023
torch==2.5.1
21-
torchvision==0.20.1
2224
torchaudio==2.5.1
23-
nbdev
24-
lightning
25-
tensorboardX
26-
hydra-core
27-
hydra-colorlog
28-
omegaconf
25+
torchvision==0.20.1
26+
tqdm
27+
uproot
28+
vector

src/datasets/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import numpy as np
21
import torch
32

43

src/utils/arrays.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
import torch
44
import vector
55

6+
from src.utils.pylogger import get_pylogger
7+
68
vector.register_awkward()
9+
logger = pylogger = get_pylogger(__name__)
710

811

912
def p4s_from_ptetaphimass(
@@ -578,7 +581,7 @@ def calc_additional_kinematic_features(ak_particles):
578581
"part_pz": p4s.pz,
579582
"part_ptrel": ak_particles.part_pt / p4s_jet.pt,
580583
"part_energy": p4s.energy,
581-
"part_energy_raw": p4s.energy, # this is a workaround to be able to use the energy twice (once for lorentz vectors, once as particle feature)
584+
"part_energy_raw": p4s.energy, # this is a workaround to use the energy twice (once for lorentz vectors, once as particle feature)
582585
"part_erel": p4s.energy / p4s_jet.energy,
583586
"part_deltaR": p4s.deltaR(p4s_jet),
584587
}

0 commit comments

Comments
 (0)