Skip to content

Commit 8e54c61

Browse files
committed
refactor: split test in two
1 parent b9b307f commit 8e54c61

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

tests/test_io.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ def case_trajectory_3D(self):
5555
)
5656
@parametrize("gmax", [0.1, DEFAULT_GMAX])
5757
@parametrize("smax", [0.7, DEFAULT_SMAX])
58-
def test_trajectory_state_changer(kspace_loc, shape, gamma, raster_time, gmax, smax):
58+
def test_trajectory_state_changer_start(
59+
kspace_loc, shape, gamma, raster_time, gmax, smax
60+
):
5961
"""Test the trajectory state changer."""
6062
dimension = len(shape)
6163
resolution = dimension * (0.23 / 256,)
@@ -86,6 +88,25 @@ def test_trajectory_state_changer(kspace_loc, shape, gamma, raster_time, gmax, s
8688
# Check that gradients match.
8789
np.testing.assert_allclose(GS[:, 0], 0, atol=1e-5)
8890

91+
92+
@parametrize("gamma,raster_time", [(Gammas.Hydrogen, DEFAULT_RASTER_TIME)])
93+
@parametrize_with_cases(
94+
"kspace_loc, shape",
95+
cases=[
96+
CasesTrajectories.case_radial2D,
97+
CasesTrajectories.case_radial3D,
98+
CasesTrajectories.case_in_out_radial2D,
99+
],
100+
)
101+
@parametrize("gmax", [0.1, DEFAULT_GMAX])
102+
@parametrize("smax", [0.7, DEFAULT_SMAX])
103+
def test_trajectory_state_changer_end(
104+
kspace_loc, shape, gamma, raster_time, gmax, smax
105+
):
106+
dimension = len(shape)
107+
resolution = dimension * (0.23 / 256,)
108+
trajectory = kspace_loc / resolution
109+
gradients = np.diff(trajectory, axis=1) / gamma / raster_time
89110
GE = get_gradient_amplitudes_to_travel_for_set_time(
90111
kspace_start_loc=trajectory[:, -1],
91112
kspace_end_loc=np.zeros_like(trajectory[:, -1]),

0 commit comments

Comments
 (0)