From 42b22c1deb6d1dc12a75c71bbaddf79cf1827a33 Mon Sep 17 00:00:00 2001 From: esavary Date: Mon, 8 Apr 2024 15:24:39 +0200 Subject: [PATCH 1/3] sty: fix style errors --- src/eddymotion/data/splitting.py | 3 ++- test/test_model.py | 2 +- test/test_splitting.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/eddymotion/data/splitting.py b/src/eddymotion/data/splitting.py index 7d7ff8b4..4118cf55 100644 --- a/src/eddymotion/data/splitting.py +++ b/src/eddymotion/data/splitting.py @@ -22,8 +22,9 @@ # """Data splitting helpers.""" from pathlib import Path -import numpy as np + import h5py +import numpy as np def lovo_split(dataset, index, with_b0=False): diff --git a/test/test_model.py b/test/test_model.py index 6ade1d3a..5f7fa4b1 100644 --- a/test/test_model.py +++ b/test/test_model.py @@ -26,8 +26,8 @@ import pytest from eddymotion import model -from eddymotion.data.splitting import lovo_split from eddymotion.data.dmri import DWI +from eddymotion.data.splitting import lovo_split def test_trivial_model(): diff --git a/test/test_splitting.py b/test/test_splitting.py index 155a8794..6d7376cd 100644 --- a/test/test_splitting.py +++ b/test/test_splitting.py @@ -22,6 +22,7 @@ # """Unit test testing the lovo_split function.""" import numpy as np + from eddymotion.data.dmri import DWI from eddymotion.data.splitting import lovo_split From 841af3ddefee5453dae9a43cfec5292719f6d75f Mon Sep 17 00:00:00 2001 From: esavary Date: Mon, 8 Apr 2024 15:31:07 +0200 Subject: [PATCH 2/3] sty: fix style errors --- src/eddymotion/data/splitting.py | 1 + test/test_splitting.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/eddymotion/data/splitting.py b/src/eddymotion/data/splitting.py index 4118cf55..66c03699 100644 --- a/src/eddymotion/data/splitting.py +++ b/src/eddymotion/data/splitting.py @@ -21,6 +21,7 @@ # https://www.nipreps.org/community/licensing/ # """Data splitting helpers.""" + from pathlib import Path import h5py diff --git a/test/test_splitting.py b/test/test_splitting.py index 6d7376cd..d3a47e7f 100644 --- a/test/test_splitting.py +++ b/test/test_splitting.py @@ -21,6 +21,7 @@ # https://www.nipreps.org/community/licensing/ # """Unit test testing the lovo_split function.""" + import numpy as np from eddymotion.data.dmri import DWI @@ -51,8 +52,7 @@ def test_lovo_split(datadir): data.gradients[..., index] = 1 # Apply the lovo_split function at the specified index - (train_data, train_gradients), \ - (test_data, test_gradients) = lovo_split(data, index) + (train_data, train_gradients), (test_data, test_gradients) = lovo_split(data, index) # Check if the test data contains only 1s # and the train data contains only 0s after the split From 0c362756343ea02ecc379a076b28aeab83c2377e Mon Sep 17 00:00:00 2001 From: esavary Date: Mon, 8 Apr 2024 15:32:28 +0200 Subject: [PATCH 3/3] sty: remove white line --- test/test_splitting.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_splitting.py b/test/test_splitting.py index d3a47e7f..f88f8e86 100644 --- a/test/test_splitting.py +++ b/test/test_splitting.py @@ -60,4 +60,3 @@ def test_lovo_split(datadir): assert np.all(train_data == 0) assert np.all(test_gradients == 1) assert np.all(train_gradients == 0) -