Skip to content

Commit 957ae9f

Browse files
authored
Merge pull request #23 from wli51/dev-move-trainer-methods
Move ~60 lines of code from subclass to parent abstract class, configure GH actions and backtrack linting
2 parents 59c92c1 + 21ef0df commit 957ae9f

24 files changed

+2146
-2054
lines changed

.github/workflows/pre-commit.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
jobs:
8+
pre-commit:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.11"
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install pre-commit
24+
25+
- name: Run pre-commit
26+
uses: pre-commit/[email protected]
27+
28+
- name: pre-commit-ci-lite
29+
uses: pre-commit-ci/[email protected]
30+
if: always()

.pre-commit-config.yaml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,30 @@ repos:
33
rev: v6.0.0
44
hooks:
55
- id: end-of-file-fixer
6+
exclude: |
7+
(?x)^(
8+
examples/nbconverted/.*|
9+
examples/nbconvert/.*|
10+
.*\.ipynb$
11+
)
612
7-
- repo: https://github.com/astral-sh/ruff-pre-commit
8-
rev: v0.14.0
9-
hooks:
10-
- id: ruff
11-
args: ["--line-length=100"]
12-
# linter.
13-
- id: ruff-check
14-
types_or: [ python, pyi ]
15-
args: [ --fix ]
13+
- repo: https://github.com/astral-sh/ruff-pre-commit
14+
rev: v0.14.0
15+
hooks:
16+
- id: ruff
17+
types_or: [python, pyi]
18+
args: [--fix, --line-length=100]
19+
# Only lint src/ and tests/
20+
files: |
21+
(?x)^(
22+
src/|
23+
tests/
24+
)
25+
# and ignore ipynb-generated Python files if needed:
26+
exclude: |
27+
(?x)^(
28+
examples/.*|
29+
.*nbconvert.*|
30+
.*nbconverted.*|
31+
.*\.ipynb$
32+
)

src/virtual_stain_flow/callbacks/IntermediatePlot.py

Lines changed: 0 additions & 117 deletions
This file was deleted.

src/virtual_stain_flow/callbacks/MlflowLogger.py

Lines changed: 0 additions & 115 deletions
This file was deleted.

0 commit comments

Comments
 (0)