Skip to content

Commit

Permalink
fix: shot_time_ms is an attribute now.
Browse files Browse the repository at this point in the history
  • Loading branch information
paquiteau committed Sep 29, 2023
1 parent 3bab75e commit 4cf6211
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/simfmri/simulator/handlers/acquisition/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,9 @@ def __init__(
constant: bool = False,
smaps: bool = True,
backend: str = "finufft",
shot_time_ms: int = 50,
):
super().__init__(constant, smaps)
super().__init__(constant=constant, smaps=smaps, shot_time_ms=shot_time_ms)
self._backend = backend


Expand Down Expand Up @@ -404,7 +405,6 @@ def __init__(
acsz: float | int,
accelz: int,
directionz: Literal["center-out", "random"],
shot_time_ms: int = 50,
n_samples: int = 3000,
nb_revolutions: int = 10,
in_out: bool = True,
Expand All @@ -417,7 +417,6 @@ def __init__(
"accelz": accelz,
"directionz": directionz,
"pdfz": pdfz,
"shot_time_ms": shot_time_ms,
"n_samples": n_samples,
"nb_revolutions": nb_revolutions,
"in_out": in_out,
Expand All @@ -436,11 +435,10 @@ def _handle(self, sim: SimDataType) -> SimDataType:
)

tobs = DEFAULT_RASTER_TIME_MS * self._traj_params["n_samples"]
shot_time = self._traj_params["shot_time_ms"]
if tobs > shot_time - 20:
if tobs > self.shot_time_ms - 20:
self.log.warning(
f"The simulated trajectory takes {tobs}ms to run, "
f" in a {shot_time}ms shot."
f" in a {self.shot_time_ms}ms shot."
)

test_traj = stack_spiral_factory(**self._traj_params)
Expand Down

0 comments on commit 4cf6211

Please sign in to comment.