Skip to content

Commit

Permalink
Merge pull request #8 from PlasmaFAIR/ci/linting
Browse files Browse the repository at this point in the history
Add linting workflow
  • Loading branch information
LiamPattinson authored Nov 7, 2023
2 parents 536aa60 + 53f01ab commit d777387
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Linting

on:
push:
paths:
- '**.py'
pull_request:
paths:
- '**.py'

jobs:
Linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install Project
run: |
python -m pip install --upgrade pip
python -m pip install .[lint]
- name: Run Black
if: always()
run: |
black --check --verbose src tests
- name: Run Ruff
if: always()
run: |
ruff src
- name: Run MyPy
if: always()
run: |
mypy src
4 changes: 2 additions & 2 deletions src/pyloidal/cocos.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

@dataclass(frozen=True)
class Sigma:
"""Collection of signs of various quantities"""
"""Collection of signs of various quantities."""

B_poloidal: int
r_phi_z: int
Expand Down Expand Up @@ -167,7 +167,7 @@ def identify_cocos(
sigma_rpz = -1 if clockwise_phi else 1
sigma_rtp = sign_q * sign_plasma_current * sign_b_toroidal

# identify 2*pi term in poloidal_flux definition based on safety_factor estimate
# identify 2*pi term in poloidal_flux definition based on safety_factor estimate.
if minor_radii is None:
# Return both variants if not provided with minor radii
return tuple(
Expand Down

0 comments on commit d777387

Please sign in to comment.