Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
5219 commits
Select commit Hold shift + click to select a range
782057f
Update submodules rabbit and wremnant-sdata
davidwalter2 Jan 27, 2026
6d32ed2
Fix extended dataset option for lowPU
davidwalter2 Jan 27, 2026
a04e38f
Merge pull request #653 from kdlong/rabbitFileMetadata
davidwalter2 Jan 27, 2026
798d145
Change CI back to previous logic for externalPostfit
davidwalter2 Jan 28, 2026
a94b163
Fix lowPU
davidwalter2 Jan 28, 2026
9b07326
Fix low PU in CI and also fix plotting low PU unfolded distributions
davidwalter2 Jan 28, 2026
ce1a03b
Merge pull request #650 from davidwalter2/260116_updBinning
lucalavezzo Jan 28, 2026
32e3fea
updates for tests
cippy Jan 30, 2026
5e5e6d9
updates for width and uT
cippy Feb 2, 2026
9b17700
Merge branch 'main_mergeUpstream_testRuben' into main_mergeUpstream_c…
cippy Feb 2, 2026
82e762b
Merge branch 'main' of github.com:WMass/WRemnants into main_mergeUpst…
cippy Feb 2, 2026
f4f9d8d
update narf (histogram and quantile histogram helpers)
bendavid Feb 3, 2026
9a5d8d8
fix a few array accesses out of bounds (off by one errors)
bendavid Feb 6, 2026
ab83879
migrate to new ai_edge_litert package for python access to tflite mod…
bendavid Feb 6, 2026
d82d24e
add additional include path for pip-installed root for linting
bendavid Feb 6, 2026
6af724c
update singularity image to v45
bendavid Feb 6, 2026
13ee82d
style changes to comply with updated black version
bendavid Feb 6, 2026
973b3a1
fix root include path for CI
bendavid Feb 6, 2026
427a8df
escape commands for run_with_singularity
bendavid Feb 6, 2026
8ddda44
further fix to ROOT includes for CI
bendavid Feb 6, 2026
16fffda
add missing includes (needed to pass clang checks in ci)
bendavid Feb 6, 2026
f85ed92
Define flag for auxiliary processes that are excluded by default
davidwalter2 Feb 6, 2026
e49cd5e
update axis renaming for newer hist/boost-histogram versions
bendavid Feb 7, 2026
804dfce
update wums (for compatibility with newer hist/boost-histogram versions)
bendavid Feb 7, 2026
5a3b1c9
update wums (adapt to updated plotting libraries)
bendavid Feb 7, 2026
79008f5
update to singularity v46 (small fix for ssh permissions issue)
bendavid Feb 10, 2026
9047a0d
use new storage type function
davidwalter2 Feb 12, 2026
df84bf2
Merge branch 'singularity_v45' of github.com:bendavid/WRemnants
davidwalter2 Feb 12, 2026
441c5e9
Merge pull request #655 from bendavid/singularity_v45
davidwalter2 Feb 12, 2026
9478cc8
Merge pull request #656 from davidwalter2/260206_auxProcs
davidwalter2 Feb 12, 2026
ed717a8
Merge pull request #654 from bendavid/narf_quantilehists
davidwalter2 Feb 12, 2026
eeee7fa
Merge branch 'main' of github.com:WMass/WRemnants
davidwalter2 Feb 12, 2026
b8b32ad
Small fixes
davidwalter2 Feb 12, 2026
d3aea76
Update wums
davidwalter2 Feb 12, 2026
8bbe427
Revert try expect logic
davidwalter2 Feb 12, 2026
82c6061
Merge pull request #658 from davidwalter2/260212_adapt
bendavid Feb 12, 2026
5664f89
update narf (fixes/improvements to histogram and quantile helpers)
bendavid Feb 12, 2026
1321cd7
migrate to generic HistHelper
bendavid Feb 12, 2026
d2f7534
small fix
cippy Feb 17, 2026
bfd4437
Merge branch 'main_mergeUpstream_testRuben' into main_mergeUpstream_c…
cippy Feb 17, 2026
3aac876
Merge branch 'main' of github.com:WMass/WRemnants into main_mergeUpst…
cippy Feb 17, 2026
d0d76ea
pylint
cippy Feb 17, 2026
048935e
trying to fix pylint
cippy Feb 17, 2026
790480d
Implementing NP variations not constrained by lattice
reimersa Feb 20, 2026
85dbb47
lint
reimersa Feb 20, 2026
f9ab4e2
Merge pull request #660 from reimersa/latticenp_noconstraint
davidwalter2 Feb 20, 2026
c880719
Fix previously broken filterProcs argument; use 'is' instead of '==' …
davidwalter2 Feb 19, 2026
37915b3
Fix filtering procs for datasets
davidwalter2 Feb 20, 2026
4cba34a
Changing suffix of merged samples to a string that is a 'supported er…
reimersa Feb 20, 2026
c975617
Replace MiNNLO -> 13TeVGen
reimersa Feb 20, 2026
79a71ba
Merge pull request #663 from reimersa/fixthcorr
davidwalter2 Feb 20, 2026
d47ec93
Merge branch 'main' of github.com:WMass/WRemnants into 260220_fixProc…
davidwalter2 Feb 20, 2026
dc36e92
Update submodules
davidwalter2 Feb 20, 2026
0befed4
Reduce BSM mixing to stabalize CI
davidwalter2 Feb 20, 2026
e92fb00
Merge pull request #659 from bendavid/histhelpers
davidwalter2 Feb 20, 2026
e971099
Merge branch 'main' of github.com:WMass/WRemnants into 260220_fixProc…
davidwalter2 Feb 20, 2026
5779d4c
Update wums
davidwalter2 Feb 20, 2026
985ca73
Add extended dataset dict also for 2017 and 2018
davidwalter2 Feb 20, 2026
b83aa04
Fix CI
davidwalter2 Feb 20, 2026
26452d2
Update corrs_by_helicity scripts
davidwalter2 Feb 21, 2026
df532b5
update scripts to make theory corrs by hels
lucalavezzo Feb 22, 2026
303007b
Merge pull request #662 from davidwalter2/260220_fixProcFilters
lucalavezzo Feb 23, 2026
5e19cdc
merge
lucalavezzo Feb 23, 2026
14259f2
add new corrs
lucalavezzo Feb 23, 2026
2dc7efe
Start refactoring
davidwalter2 Feb 24, 2026
229faac
Fixes to initial refactoring
davidwalter2 Feb 24, 2026
e5f06bf
nnpdf31 corrs
lucalavezzo Feb 24, 2026
dee70d4
add nnpdf31
lucalavezzo Feb 24, 2026
1a0dd2e
stage systematics file
davidwalter2 Feb 24, 2026
76549ab
Update submodules
davidwalter2 Feb 24, 2026
e0f4efe
add new theory corrs to weight map; update wremnants-data
lucalavezzo Feb 24, 2026
b733e9c
lint
lucalavezzo Feb 24, 2026
6127c87
sync wremnants-data
lucalavezzo Feb 24, 2026
7094cd5
Fix CI
davidwalter2 Feb 24, 2026
38e98e6
Merge pull request #665 from lucalavezzo/lattice-corrs-by-hel
davidwalter2 Feb 24, 2026
15d30c3
Merge branch 'main' of github.com:WMass/WRemnants into 260223_refacto…
davidwalter2 Feb 24, 2026
013f42f
Update narf
davidwalter2 Feb 24, 2026
3939e9d
Break down common into binning, samples; rename utilities to inspect
davidwalter2 Feb 25, 2026
bd69102
Fix CI
davidwalter2 Feb 25, 2026
fa8a118
Rename binning functions for unfolding
davidwalter2 Feb 25, 2026
fce223b
Fix CI
davidwalter2 Feb 25, 2026
30e0ca5
Address first bunch of Lucas comments
davidwalter2 Feb 26, 2026
fbaf151
Fix CI
davidwalter2 Feb 26, 2026
153216e
Update README and add some docstrings at the top of files to give a s…
davidwalter2 Feb 27, 2026
21e9481
Merge pull request #664 from davidwalter2/260223_refactoring
lucalavezzo Feb 27, 2026
a101317
minor fixes
lucalavezzo Mar 2, 2026
b463cc6
b quark mass systematic for Z
lucalavezzo Mar 2, 2026
322edfe
add Zbb sample to datasets
lucalavezzo Mar 2, 2026
5e1b063
add script to generate b quark mass correction for Z
lucalavezzo Mar 2, 2026
25ccb8e
CI be damned
lucalavezzo Mar 2, 2026
18c843f
update b quark mass corr
lucalavezzo Mar 3, 2026
de23597
add b quark mass uncertainty to the fit
lucalavezzo Mar 3, 2026
6c12284
udpated inflation factors for alphaS
lucalavezzo Mar 3, 2026
80dd79c
lint
lucalavezzo Mar 3, 2026
21bb938
update wremnants-data
lucalavezzo Mar 3, 2026
593f098
update wremnants-data commit
lucalavezzo Mar 3, 2026
c67796e
Merge pull request #669 from lucalavezzo/lattice-corrs-by-hel
davidwalter2 Mar 4, 2026
b53dc5d
merge main
lucalavezzo Mar 4, 2026
ed6bf2a
Add complete set of nuisance groups for alphaS Z fit
reimersa Mar 11, 2026
32a95b8
lint
reimersa Mar 11, 2026
0970f09
Merge branch 'main' of github.com:WMass/WRemnants into main_mergeUpst…
cippy Mar 11, 2026
6c68dd1
fix linting, maybe
cippy Mar 11, 2026
732cb46
black to reformat
cippy Mar 11, 2026
64a607f
bump wums, rabbit
reimersa Mar 11, 2026
05c0aa1
Adapt path of open_narf_h5py.py to new structure
reimersa Mar 12, 2026
be4d33b
lint
reimersa Mar 12, 2026
bf516b6
Try to fix w-bsm CI
reimersa Mar 12, 2026
6d718fa
Merge pull request #670 from reimersa/as_nuisance_groups
lucalavezzo Mar 12, 2026
84791af
fix wrong sample name for BSM studies
cippy Mar 12, 2026
a9f232a
Merge branch 'main' of github.com:WMass/WRemnants into main_mergeUpst…
cippy Mar 12, 2026
8c52607
update paths
lucalavezzo Mar 12, 2026
15687d6
Merge branch 'main' of github.com:WMass/WRemnants into luca-dev
lucalavezzo Mar 12, 2026
fd1d4cd
patch setupRabbit order of operations
lucalavezzo Mar 12, 2026
8121b16
histmaking for 2018 Charmonium data and BToJpsiK MC initial infrastru…
pmlugato Oct 17, 2025
b3569df
signal, other updates, bug fixes, pre-cleanup
pmlugato Nov 6, 2025
d1ba60b
styling
pmlugato Mar 11, 2026
4a73d61
updates to test custom recoil syst
cippy Mar 14, 2026
b9d6729
mb/mc variations from scetlib+dyturbo with new NP model
reimersa Mar 16, 2026
59128c6
David's comments
lucalavezzo Mar 16, 2026
aea0906
conform to WRemnants refactoring
pmlugato Mar 16, 2026
db56802
Merge pull request #668 from lucalavezzo/b-quark-mass
davidwalter2 Mar 16, 2026
fc76ea0
Lookup for renorm info now using theory_corrections.theory_corr_weigh…
reimersa Mar 16, 2026
7ee7f92
Lookup for renorm info now using theory_corrections.theory_corr_weigh…
reimersa Mar 16, 2026
f8764b4
Support for HERAPDF20 VAR variations via scetlib+dyturbo theory corre…
reimersa Mar 16, 2026
5289c8d
update wums
lucalavezzo Mar 17, 2026
45ddd71
marco's comments
lucalavezzo Mar 17, 2026
480edfb
change denominator for all PDF variation corrections for which renorm…
reimersa Mar 17, 2026
5523d02
bump wremnants-data
reimersa Mar 17, 2026
a644d5f
Merge remote-tracking branch 'origin/main' into mbmc_corr_fix_pr
reimersa Mar 17, 2026
0836eb5
Merge pull request #672 from reimersa/mbmc_corr_fix_pr
davidwalter2 Mar 17, 2026
a1de413
generalize scale helpers
pmlugato Mar 17, 2026
2e79724
small changes/comments for histmaking
pmlugato Mar 17, 2026
6153f9a
oops
pmlugato Mar 17, 2026
3aff06f
bug fixes, clean up, start on comments
pmlugato Mar 17, 2026
e415f53
addressing all minor + formatting comments
pmlugato Mar 17, 2026
8a7c145
Merge branch 'main' of github.com:WMass/WRemnants into luca-dev
lucalavezzo Mar 18, 2026
a7af08e
address marco's comment
lucalavezzo Mar 18, 2026
6323edf
Merge branch 'merging-upstream-refactoring' of github.com:pmlugato/WR…
davidwalter2 Mar 18, 2026
c99406c
stronger regex
lucalavezzo Mar 18, 2026
6ba30ad
Merge branch 'main' of github.com:WMass/WRemnants
lucalavezzo Mar 18, 2026
c49ac1a
First work on Upsilon selection
davidwalter2 Mar 19, 2026
50e28c8
Allow partial axlim specifications in set_rebin_action
lucalavezzo Mar 19, 2026
3fa7196
Normalize negative imaginary setupRabbit bounds
lucalavezzo Mar 19, 2026
5582f33
Updates on the dimuon resonance histmaker
davidwalter2 Mar 19, 2026
d57436b
add recipies for new alphaS CI
lucalavezzo Mar 20, 2026
5843272
update alphaS CI
lucalavezzo Mar 20, 2026
e50fe88
Fix alphaS CI workflow follow-ups
lucalavezzo Mar 20, 2026
8ad7a1d
Split alphaS CI into separate jobs
lucalavezzo Mar 20, 2026
960eada
Restore dilepton CI outputs for plotting
lucalavezzo Mar 20, 2026
ba90ca6
Merge pull request #1 from davidwalter2/260318_mz
pmlugato Mar 20, 2026
bb2dc1b
refactor response maps to proper script
pmlugato Mar 20, 2026
0d1e588
update wums and rabbit submodules
pmlugato Mar 20, 2026
f4a489b
updated directly theory sigmaUL fit
lucalavezzo Mar 20, 2026
b404d5d
clean up
lucalavezzo Mar 23, 2026
57b63db
clean up CI
lucalavezzo Mar 23, 2026
f9565f1
increase number of files in CI
lucalavezzo Mar 24, 2026
05f41c9
patch
lucalavezzo Mar 24, 2026
aea4865
patch
lucalavezzo Mar 24, 2026
624b270
remove recipies, rebin in unfolding fit
lucalavezzo Mar 24, 2026
89fe864
patch alphaS CI
lucalavezzo Mar 24, 2026
6b99b71
fix alphas CI
lucalavezzo Mar 24, 2026
0711639
merge
lucalavezzo Mar 24, 2026
01c650f
address comments
lucalavezzo Mar 24, 2026
3d836ad
update wums
lucalavezzo Mar 24, 2026
e447782
Merge branch 'luca-dev' of github.com:lucalavezzo/WRemnants
lucalavezzo Mar 24, 2026
95e93e5
Merge branch 'luca-dev-feed-rabbit-sigmaul' of github.com:lucalavezzo…
lucalavezzo Mar 24, 2026
ef210b7
move to direct sigmaUL fit in CI
lucalavezzo Mar 24, 2026
b31ead9
updates
cippy Mar 25, 2026
be9cac5
Merge branch 'main' of github.com:WMass/WRemnants into main_mergeUpst…
cippy Mar 25, 2026
0d56995
fix alphaS gen fit in CI
lucalavezzo Mar 25, 2026
2098c00
Merge pull request #671 from lucalavezzo/luca-dev
davidwalter2 Mar 25, 2026
7c9daa9
david's comments
lucalavezzo Mar 25, 2026
9ea17e5
Merge branch 'main' of github.com:WMass/WRemnants into luca-dev-feed-…
lucalavezzo Mar 25, 2026
9335877
david's comments
lucalavezzo Mar 25, 2026
cd68f19
fix outputs dirs in CI
lucalavezzo Mar 25, 2026
329778f
Merge pull request #677 from lucalavezzo/luca-dev-feed-rabbit-sigmaul
davidwalter2 Mar 25, 2026
0c3336c
Merge branch 'main' of github.com:WMass/WRemnants
lucalavezzo Mar 25, 2026
6453cf1
Merge pull request #676 from lucalavezzo/main
davidwalter2 Mar 25, 2026
aed50a9
moving definition of mass and width systs to rabbit_helpers
cippy Mar 26, 2026
6b05c45
david comments
pmlugato Mar 26, 2026
3f50a31
Merge branch 'main' of github.com:WMass/WRemnants into main_mergeUpst…
cippy Mar 26, 2026
642e8f1
fixing scripts/rabbit/setupRabbit.py
cippy Mar 26, 2026
724118f
Merge pull request #675 from pmlugato/merging-upstream-refactoring
davidwalter2 Mar 26, 2026
5a4f773
fixing bugs and augment --presel option of setupRabbit.py
cippy Mar 26, 2026
c2a1062
fix
cippy Mar 26, 2026
3e74025
fixing usage of hist.sum for non categorical axes
cippy Mar 26, 2026
5d7d9de
fix
cippy Mar 27, 2026
9a407e3
define function on top, and small fix
cippy Mar 27, 2026
b425570
Merge branch 'main' of github.com:WMass/WRemnants into main_mergeUpst…
cippy Mar 27, 2026
0c62ddb
couple of fixes
cippy Mar 27, 2026
6cd601b
improve help message of --presel
cippy Mar 27, 2026
c410b2a
implement comments from PR
cippy Mar 27, 2026
11ca61a
Merge pull request #679 from cippy/fixPresel
davidwalter2 Mar 28, 2026
fd8be87
make some utility histograms optional
cippy Mar 28, 2026
25c14b4
Merge branch 'main' of github.com:WMass/WRemnants into main_mergeUpst…
cippy Mar 28, 2026
fe7c6a9
Merge pull request #678 from cippy/main_mergeUpstream_devel_150326
davidwalter2 Mar 31, 2026
2ee1e12
SCETlib NP parameter DeltaLambda2 variation now around 0, add FO stat…
reimersa Apr 1, 2026
5bb76ef
bump wremnants-data with new corrs
reimersa Apr 1, 2026
00c20fc
New DeltaLambda2 variations in gen fit
reimersa Apr 2, 2026
5511b74
Merge remote-tracking branch 'origin/main' into dlambda0
reimersa Apr 2, 2026
abe4683
New DeltaLambda2 variations in gen fit
reimersa Apr 2, 2026
60a3f5d
update HEPData entry for final publication
cippy Apr 2, 2026
a0358c2
polish HEPData script
cippy Apr 2, 2026
69cfc73
Merge branch 'main' of github.com:WMass/WRemnants into hepdata_final
cippy Apr 2, 2026
03fa997
Merge pull request #681 from cippy/hepdata_final
davidwalter2 Apr 7, 2026
d55d510
temporarily supppress W from the alphaS CI
lucalavezzo Apr 9, 2026
7fb761b
temporarily supppress W from the alphaS CI
lucalavezzo Apr 9, 2026
5aa691f
add MiNNLO_Zbb and restrict range to 44 GeV for alphaS CI
lucalavezzo Apr 9, 2026
5a86bd6
fix b quark mass unc
lucalavezzo Apr 9, 2026
5feafd0
Merge pull request #680 from reimersa/dlambda0
davidwalter2 Apr 9, 2026
052b8c2
add ISR uncertainty to theory fit
lucalavezzo Apr 10, 2026
b43c22c
Merge branch 'main' of github.com:WMass/WRemnants into luca-dev
lucalavezzo Apr 10, 2026
4b99640
bump wremnants-data
lucalavezzo Apr 10, 2026
7f4c410
t commit -m "remove
lucalavezzo Apr 10, 2026
aff9675
Merge pull request #682 from lucalavezzo/luca-dev
davidwalter2 Apr 10, 2026
e56a7dd
bug fixes
cippy Apr 10, 2026
b8dd970
udpates
lucalavezzo Apr 13, 2026
a28ea45
fix mb FO
lucalavezzo Apr 13, 2026
ba52cdb
fix alphaS CI
lucalavezzo Apr 13, 2026
673debe
Merge branch 'main' of github.com:lucalavezzo/WRemnants into luca-dev
lucalavezzo Apr 14, 2026
316d6d1
add support for other PDFs in the direct theory fit
lucalavezzo Apr 14, 2026
84b9314
fix CI
lucalavezzo Apr 14, 2026
51da3c4
bump wremnants-data
lucalavezzo Apr 14, 2026
c9fc3a5
Merge pull request #685 from lucalavezzo/main
davidwalter2 Apr 14, 2026
274ebb7
Merge branch 'main' of github.com:WMass/WRemnants into luca-dev
lucalavezzo Apr 14, 2026
ec59d29
Command line option to scale variation of NP parameter lambda4, now t…
reimersa Apr 14, 2026
0d30683
david's comments
lucalavezzo Apr 14, 2026
354dbce
Add N3LO corrections with new NP in coarse NNLOjet-like binning to li…
reimersa Apr 14, 2026
7ab7233
flexible parsing of number decimal points and histnames
reimersa Apr 17, 2026
1cec3ac
more fixes
cippy Apr 20, 2026
2ef637e
Adding N3LO corrections with MSHT20aN3LO, including necessary rebinni…
reimersa Apr 20, 2026
17a09ac
Adding N3LO corrections with MSHT20aN3LO, including necessary rebinni…
reimersa Apr 20, 2026
c8eedff
Merge pull request #687 from reimersa/scale_lambda4
davidwalter2 Apr 22, 2026
bb5f252
bump wums to b56a7db
cippy Apr 22, 2026
1e66f2b
Merge pull request #683 from cippy/main_mergeUpstream_devel_150326
davidwalter2 Apr 22, 2026
72f2cde
Merge pull request #686 from lucalavezzo/luca-dev
davidwalter2 Apr 23, 2026
a1de3f9
support force asymmetrization of nuisances
lucalavezzo Apr 28, 2026
360a56a
add generic parameter scaling utility
lucalavezzo Apr 29, 2026
ab0aba9
Merge pull request #688 from lucalavezzo/main
davidwalter2 Apr 29, 2026
a9951ac
enhancements for dxybs
cippy May 7, 2026
545b059
dummy commit to trigger CI again
cippy May 8, 2026
e59fe59
foo
cippy May 8, 2026
1a1d97f
missing option definition
cippy May 8, 2026
c9a5e18
fix usage of std::abs wth RVec
cippy May 8, 2026
0185407
fix bug
cippy May 9, 2026
ffde2aa
Merge pull request #690 from cippy/dxybs
davidwalter2 May 11, 2026
22aacce
narf: bump to calibrationdev (TBB task-arena index for ONNX session p…
bendavid May 21, 2026
eac642a
scripts/ci: bump container wmassdevrolling v46 -> v53
bendavid May 21, 2026
a1b763f
Merge pull request #691 from bendavid/muon_reweight_ci_narf
davidwalter2 May 22, 2026
8a5097e
scripts/ci: bump container wmassdevrolling v53 -> v57
bendavid Jun 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[core]
hooksPath = .githooks
116 changes: 116 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#!/bin/bash
# This pre-commit hook fixes whitespace issues and formats Python files

# Exit if any command fails
set -e

# Trap the EXIT signal to print the last executed command when the script exits
trap 'echo "Error on line $LINENO: $BASH_COMMAND" >&2' ERR

ROOTINCLUDEPATH=`python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])'`/ROOT/include

# Find all staged c++ files
STAGED_FILES_CPP=$(git diff --cached --name-only --diff-filter=d | grep -E '\.(c|cpp|h|hpp)$' || true)

for FILE in $STAGED_FILES_CPP; do
clang++ -I./narf/narf/include/ -I./wremnants/include/ -I ${ROOTINCLUDEPATH} -std=c++20 -fsyntax-only $FILE
if [ $? -ne 0 ]; then
echo "Syntax error in $FILE. Commit aborted."
exit 1
fi
done


# Find all staged json files
STAGED_FILES_JSON=$(git diff --cached --name-only --diff-filter=d | grep -E '\.json$' || true)

# Check syntax of each json file
for FILE in $STAGED_FILES_JSON; do
python -m json.tool $FILE > /dev/null
if [ $? -ne 0 ]; then
echo "Syntax error in $FILE. Commit aborted."
exit 1
fi
done


# Find all staged Python files
STAGED_FILES_PY=$(git diff --cached --name-only --diff-filter=d | grep -E '\.py$' || true)

# Check for syntax errors in each staged Python file
for FILE in $STAGED_FILES_PY; do
# Use python's compile command to check for syntax errors
python -m py_compile "$FILE"

# Check the exit status of the previous command
if [ $? -ne 0 ]; then
echo "Syntax error in $FILE. Commit aborted."
exit 1
fi
done


# apply style modifications on staged files
unset MODIFIED_FILES

# Loop through each staged c/c++ files and fix style issues
for FILE in $STAGED_FILES_CPP; do
# apply LLVM style
clang-format -i "$FILE"

# Check if the file was modified compared to the staged version
if ! git diff --quiet "$FILE"; then
# Track the modified files
MODIFIED_FILES+=("$FILE")
fi

done


# Loop through each staged Python file and fix style issues
for FILE in $STAGED_FILES_PY; do

# Remove unused imports
autoflake --in-place --expand-star-imports --remove-all-unused-imports "$FILE" --exclude=narf,wremnants-data

# Run isort to organize imports
isort "$FILE" --skip narf --skip wremnants-data --profile black --line-length 88

# PEP 8 formatting
black "$FILE"

# Check if the file was modified compared to the staged version
if ! git diff --quiet "$FILE"; then
# Track the modified files
MODIFIED_FILES+=("$FILE")
fi

flake8 $FILE --select=F401,F402,F403,F404,F405,F406,F407,F601,F602,F621,F622,F631,F632,F633,F634,F701,F702,F704,F706,F707,F721,F722,F723,F821,F822,F823,F831,F901 --max-line-length 88

done


# Check the exit status of flake8
if [ $? -ne 0 ]; then
echo "flake8 found issues. Commit aborted."
exit 1 # Abort the commit
fi


if [ -n "$STAGED_FILES_PY" ]; then
# give a code rating of python files
pylint $STAGED_FILES_PY | grep 'Your code has been rated at'
fi


# Notify the user if any files were modified
if [ ${#MODIFIED_FILES[@]} -gt 0 ]; then
echo "The following files were modified and need to be re-staged:"
for FILE in "${MODIFIED_FILES[@]}"; do
echo " $FILE"
done
echo "Please review the changes and manually add the modified files to the staging area."
exit 1
fi

exit 0
35 changes: 35 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: EOS Cleanup
on:
schedule:
- cron: '0 3 * * 0' # Run on Sunday morning at 3h00 UTC
workflow_dispatch:

env:
EOS_DIR: /eos/user/c/cmsmwbot/

jobs:
cleanup:
runs-on: [self-hosted, linux, x64]

# delete old folders, keep the 5 newest ones
steps:
- name: delete old kerberos credentials
run: |
FILE_PATH="/tmp/krb5cc_158524"
if [ -f "$FILE_PATH" ]; then
echo "Delete $FILE_PATH and create new one"
rm "$FILE_PATH"
else
echo "File $FILE_PATH does not yet exist, create it."
fi

- name: setup kerberos
run: |
kinit -kt ~/private/.keytab cmsmwbot@CERN.CH
klist -k -t -e ~/private/.keytab
klist
echo "xrdfs root://eosuser.cern.ch// ls $EOS_DIR"
xrdfs root://eosuser.cern.ch// ls $EOS_DIR

- name: cleanup main
run: scripts/ci/cleanup_directory.sh $EOS_DIR/ScheduledBuilds/ 5
Loading