Skip to content

Commit

Permalink
fix: flake8 gha
Browse files Browse the repository at this point in the history
  • Loading branch information
oesteban committed Nov 30, 2023
1 parent e06e636 commit 53cef45
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3
- run: pipx run flake8 sdcflows/
- run: pipx run flake8-pyproject sdcflows/

# codespell:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: codespell-project/actions-codespell@v2
23 changes: 11 additions & 12 deletions sdcflows/interfaces/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ def test_ConvertWarp(tmpdir, shape):
"""Exercise the interface."""
tmpdir.chdir()

nb.Nifti1Image(np.zeros(shape, dtype="uint8"), np.eye(4), None).to_filename(
"3dQwarp.nii.gz"
)
nb.Nifti1Image(np.zeros(shape, dtype="uint8"), np.eye(4), None).to_filename("3dQwarp.nii.gz")

out = ConvertWarp(in_file="3dQwarp.nii.gz").run()

Expand All @@ -80,9 +78,7 @@ def test_Xeoblique(tmpdir, angles, oblique):
tmpdir.chdir()

affine = nb.affines.from_matvec(nb.eulerangles.euler2mat(*angles))
nb.Nifti1Image(np.zeros((10, 10, 10), dtype="uint8"), affine, None).to_filename(
"epi.nii.gz"
)
nb.Nifti1Image(np.zeros((10, 10, 10), dtype="uint8"), affine, None).to_filename("epi.nii.gz")

result = (
Deoblique(
Expand All @@ -108,12 +104,15 @@ def test_Xeoblique(tmpdir, angles, oblique):
assert np.allclose(nb.load(reoblique.out_epi).affine, affine)


@pytest.mark.parametrize("in_shape,expected_shape,padded", [
((2,2,2), (2,2,2), False),
((2,2,3), (2,2,4), True),
((3,3,2,2), (3,3,2,2), False),
((3,3,3,2), (3,3,4,2), True),
])
@pytest.mark.parametrize(
"in_shape,expected_shape,padded",
[
((2, 2, 2), (2, 2, 2), False),
((2, 2, 3), (2, 2, 4), True),
((3, 3, 2, 2), (3, 3, 2, 2), False),
((3, 3, 3, 2), (3, 3, 4, 2), True),
],
)
def test_pad_slices(tmpdir, in_shape, expected_shape, padded):
tmpdir.chdir()

Expand Down

0 comments on commit 53cef45

Please sign in to comment.