Skip to content

Commit 6f4e1bc

Browse files
committed
refactor: split test in two
1 parent b9b307f commit 6f4e1bc

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

tests/test_io.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ 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(kspace_loc, shape, gamma, raster_time, gmax, smax):
5959
"""Test the trajectory state changer."""
6060
dimension = len(shape)
6161
resolution = dimension * (0.23 / 256,)
@@ -86,6 +86,23 @@ def test_trajectory_state_changer(kspace_loc, shape, gamma, raster_time, gmax, s
8686
# Check that gradients match.
8787
np.testing.assert_allclose(GS[:, 0], 0, atol=1e-5)
8888

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

0 commit comments

Comments
 (0)