Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linting to GitHub Actions #142

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/Flake8_PR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Flake8

on: [pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install -r requirements.txt
- name: Setup flake8 annotations
uses: rbialon/flake8-annotations@v1
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=80 --statistics
18 changes: 0 additions & 18 deletions .pep8speaks.yml

This file was deleted.

5 changes: 3 additions & 2 deletions ukat/mapping/t1.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ class T1:
The number of TI used to calculate the map
"""


def __init__(self, pixel_array, inversion_list, affine, tss=0, tss_axis=-2,
mask=None, parameters=2, multithread=True):
mask=None, parameters = 2, multithread=True):
"""Initialise a T1 class instance.

Parameters
Expand Down Expand Up @@ -86,7 +87,7 @@ def __init__(self, pixel_array, inversion_list, affine, tss=0, tss_axis=-2,
if mask is None:
self.mask = np.ones(self.shape, dtype=bool)
else:
self.mask = mask
self.mask=mask
# Don't process any nan values
self.mask[np.isnan(np.sum(pixel_array, axis=-1))] = False
self.inversion_list = inversion_list
Expand Down