Skip to content

Commit de50e86

Browse files
authored
Merge pull request #845 from RasmusOrsoe/fix_code_quality_workflow
Code Quality Fix
2 parents 018b247 + 08954f6 commit de50e86

File tree

24 files changed

+111
-82
lines changed

24 files changed

+111
-82
lines changed

.github/actions/install/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,5 @@ runs:
6868
echo "Installing graphnet with flags: ${{ steps.flags.outputs.user_flag }} ${{ steps.flags.outputs.editable_flag }}"
6969
echo "pip install ${{ steps.flags.outputs.user_flag }} ${{ steps.flags.outputs.editable_flag }} .[torch-${{ steps.flags.outputs.torch_flag }},${{ inputs.extras }}] -f https://data.pyg.org/whl/torch-${{ inputs.torch_version }}+${{ inputs.hardware }}.html"
7070
pip install ${{ steps.flags.outputs.user_flag }} ${{ steps.flags.outputs.editable_flag }} .[torch-${{ steps.flags.outputs.torch_flag }},${{ inputs.extras }}] -f https://data.pyg.org/whl/torch-${{ inputs.torch_version }}+${{ inputs.hardware }}.html
71-
71+
7272
pip install git+https://github.com/thoglu/jammy_flows.git

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
fi
3333
3434
build-icetray:
35-
name: Unit tests - IceTray (v1.13.0 - 3.10)
35+
name: Unit tests - IceTray (v1.13.0 - 3.10)
3636
needs: [ check-Qlty-credentials ]
3737
runs-on: ubuntu-22.04
3838
strategy:
@@ -43,7 +43,7 @@ jobs:
4343
# GitHub Actions overwrite the docker container entrypoint
4444
# inspect <image> --format '{{.Config.Entrypoint}}'
4545
image: icecube/icetray:icetray-devel-v1.13.0-ubuntu22.04-2025-02-12
46-
46+
4747
steps:
4848
- name: Mimmick Docker Entrypoint
4949
# The entrypoint of the container sets python paths
@@ -62,7 +62,7 @@ jobs:
6262
- name: Verify IceCube is importable
6363
run: python3 -c "import icecube; print('Import Successful')"
6464
- name: Show python version
65-
run: |
65+
run: |
6666
python3 --version
6767
pip --version
6868
pip3 list
@@ -122,9 +122,9 @@ jobs:
122122
shell: bash
123123
run: |
124124
source ~/venv/bin/activate
125-
coverage run --source=graphnet -m pytest tests/ --ignore=tests/examples/04_training --ignore=tests/utilities
125+
coverage run --source=graphnet -m pytest tests/ --ignore=tests/examples/04_training --ignore=tests/utilities
126126
coverage run -a --source=graphnet -m pytest tests/examples/04_training
127-
coverage run -a --source=graphnet -m pytest tests/utilities
127+
coverage run -a --source=graphnet -m pytest tests/utilities
128128
coverage xml -o coverage.xml
129129
coverage report -m
130130
- name: Work around permission issue
@@ -136,7 +136,7 @@ jobs:
136136
with:
137137
token: ${{secrets.QLTY_TOKEN}}
138138
files: coverage.xml
139-
139+
140140

141141
build-matrix-examples:
142142
name: Examples - Ubuntu 22.04

.github/workflows/code-quality.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ jobs:
2323
hook: ["black", "flake8", "docformatter", "pydocstyle", "mypy"]
2424
steps:
2525
- uses: actions/checkout@v4
26-
- name: Set up Python 3.10
27-
uses: actions/setup-python@v3
26+
- name: Set up Python 3.11
27+
uses: actions/setup-python@v5
2828
with:
29-
python-version: "3.10"
29+
python-version: "3.11"
3030
- name: Install package
3131
uses: ./.github/actions/install
32-
with:
33-
32+
3433
- name: Run ${{ matrix.hook }}
3534
run: |
3635
pip show ${{ matrix.hook }}

.github/workflows/docker_action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ on:
44
workflow_call:
55
inputs:
66
DOCKERHUB_NAME: { type: string, required: true }
7-
DOCKERFILE_PATH: { type: string, required: true}
7+
DOCKERFILE_PATH: { type: string, required: true}
88
GRAPHNET_VERSION: { type: string, default: "main" }
99
BASE_IMAGE: { type: string, default: "ubuntu:22.04" }
1010
TORCH_CHOICE: { type: string, default: "torch-2.6.0" } # torch-2.7.0|2.6.0|2.5.1|no_torch
1111
HARDWARE: { type: string, default: "cpu" } # cpu|cu118|cu121|cu124|cu126|cu128
1212
PYTHON_VERSION: { type: string, default: "3.11" }
1313
PLATFORMS: { type: string, default: "linux/amd64" }
14-
CONTEXT_PATH: { type: string, default: "." }
14+
CONTEXT_PATH: { type: string, default: "." }
1515
secrets:
1616
DOCKERHUB_USERNAME:
1717
required: true
@@ -102,7 +102,7 @@ jobs:
102102
uses: docker/build-push-action@v6
103103
with:
104104
context: ${{ inputs.CONTEXT_PATH }}
105-
file: ${{ inputs.DOCKERFILE_PATH }}
105+
file: ${{ inputs.DOCKERFILE_PATH }}
106106
platforms: ${{ env.PLATFORMS }}
107107
push: true
108108
tags: ${{ steps.tag.outputs.full }}

.github/workflows/paper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ jobs:
2828
# This is the output path where Pandoc will write the compiled
2929
# PDF. Note, this should be the same directory as the input
3030
# paper.md
31-
path: paper/paper.pdf
31+
path: paper/paper.pdf

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ data/examples/output/
150150
**.pth
151151
**.db
152152
**.parquet
153-
# Exception to pre-trained folders; here we want all .pth files
153+
# Exception to pre-trained folders; here we want all .pth files
154154
!/graphnet/src/graphnet/models/pretrained/**/**/**/**/**.pth
155-
# Exception to geometry tables
155+
# Exception to geometry tables
156156
!/data/geometry_tables/**/**.parquet
157157
!/data/tests/sqlite/upgrade_genie_step4_140028_000998_first_5_frames/upgrade_genie_step4_140028_000998_first_5_frames.db
158158
!/data/tests/parquet/oscNext_genie_level7_v02/merged/**

.pre-commit-config.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ repos:
99
- repo: https://github.com/pycqa/flake8
1010
rev: 7.1.1
1111
hooks:
12-
- id: flake8
13-
language_version: python3
12+
- id: flake8
13+
args: ["--config=.flake8", "--show-source", "--statistics"]
1414
- repo: https://github.com/pycqa/docformatter
1515
rev: v1.7.7
1616
hooks:
@@ -26,4 +26,9 @@ repos:
2626
hooks:
2727
- id: mypy
2828
args: [--follow-imports=silent, --disallow-untyped-defs, --disallow-incomplete-defs, --disallow-untyped-calls]
29-
language_version: python3
29+
language_version: python3
30+
- repo: https://github.com/pre-commit/pre-commit-hooks
31+
rev: v4.6.0
32+
hooks:
33+
- id: trailing-whitespace
34+
- id: end-of-file-fixer

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ version: 1.0.0
5454
date-released: 2023-05-12
5555
url: "https://github.com/graphnet-team/graphnet"
5656
license: Apache-2.0
57-
type: software
57+
type: software

black.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ extend-exclude = '''
77
versioneer.py
88
| src/graphnet/_version.py
99
)
10-
'''
10+
'''

configs/datasets/training_classification_example_data_sqlite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ selection:
6767
train_nu_e: 60 random events ~ event_no % 5 > 1 & (dummy_pid == 12 | dummy_pid == -12)
6868
train_nu_mu: 60 random events ~ event_no % 5 > 1 & (dummy_pid == 14 | dummy_pid == -14)
6969
train_nu_tau: 60 random events ~ event_no % 5 > 1 & (dummy_pid == 16 | dummy_pid == -16)
70-
train_mu: 60 random events ~ event_no % 5 > 1 & (dummy_pid == 13 | dummy_pid == -13)
70+
train_mu: 60 random events ~ event_no % 5 > 1 & (dummy_pid == 13 | dummy_pid == -13)

0 commit comments

Comments
 (0)