Commit 3d2cea0
authored
Fix: prevent duplicate exports by popping matched time in is_it_time_to_export
This updates `is_it_time_to_export` so that when a timestep matches a desired export time (within the `np.isclose` tolerances), the corresponding entry in `times` is popped.
Previously, multiple consecutive timesteps within the tolerance window could all trigger `True`, leading to repeated exports for the same target time, especially at high simulation times where the relative tolerance (rtol) allows larger absolute differences.
With this change:
- only the first matching timestep triggers an export
- the matched time is removed, preventing any subsequent exports for it
This ensures a 1-to-1 mapping between requested and actual exports, provided the simulation reaches timesteps sufficiently close to the target times.1 parent d7d8372 commit 3d2cea0
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
328 | 332 | | |
329 | 333 | | |
330 | 334 | | |
| |||
337 | 341 | | |
338 | 342 | | |
339 | 343 | | |
340 | | - | |
341 | | - | |
| 344 | + | |
| 345 | + | |
342 | 346 | | |
| 347 | + | |
343 | 348 | | |
344 | 349 | | |
345 | 350 | | |
346 | 351 | | |
347 | 352 | | |
| 353 | + | |
348 | 354 | | |
349 | 355 | | |
350 | 356 | | |
| |||
0 commit comments