@@ -1085,9 +1085,6 @@ def execute(
1085
1085
raise ValueError ("Output interval should not have finer precision than 1e-6 s" )
1086
1086
outputdt = timedelta_to_float (output_file .outputdt ) if output_file else np .inf
1087
1087
1088
- if np .isfinite (outputdt ):
1089
- _warn_outputdt_release_desync (outputdt , self .particledata .data ["time_nextloop" ])
1090
-
1091
1088
if callbackdt is not None :
1092
1089
callbackdt = timedelta_to_float (callbackdt )
1093
1090
@@ -1124,6 +1121,9 @@ def execute(
1124
1121
"ParticleSet.execute() will not do anything."
1125
1122
)
1126
1123
1124
+ if np .isfinite (outputdt ):
1125
+ _warn_outputdt_release_desync (outputdt , starttime , self .particledata .data ["time_nextloop" ])
1126
+
1127
1127
self .particledata ._data ["dt" ][:] = dt
1128
1128
1129
1129
if callbackdt is None :
@@ -1240,12 +1240,13 @@ def execute(
1240
1240
pbar .close ()
1241
1241
1242
1242
1243
- def _warn_outputdt_release_desync (outputdt : float , release_times : Iterable [float ]):
1243
+ def _warn_outputdt_release_desync (outputdt : float , starttime : float , release_times : Iterable [float ]):
1244
1244
"""Gives the user a warning if the release time isn't a multiple of outputdt."""
1245
- if any ((np .isfinite (t ) and t % outputdt != 0 ) for t in release_times ):
1245
+ if any ((np .isfinite (t ) and ( t - starttime ) % outputdt != 0 ) for t in release_times ):
1246
1246
warnings .warn (
1247
- "Some of the particles have a start time that is not a multiple of outputdt. "
1248
- "This could cause the first output to be at a different time than expected." ,
1247
+ "Some of the particles have a start time difference that is not a multiple of outputdt. "
1248
+ "This could cause the first output of some of the particles that start later "
1249
+ "in the simulation to be at a different time than expected." ,
1249
1250
FileWarning ,
1250
1251
stacklevel = 2 ,
1251
1252
)
0 commit comments