MCPcopy Create free account
hub / github.com/NanoComp/meep / _disp

Function _disp

python/simulation.py:5522–5537  ·  view source on GitHub ↗
(sim)

Source from the content-addressed store, hash-verified

5520 closure = {"tlast": mp.wall_time()}
5521
5522 def _disp(sim):
5523 t1 = mp.wall_time()
5524 if t1 - closure["tlast"] >= dt:
5525 msg_fmt = "Meep progress: {}/{} = {:.1f}% done in {:.1f}s, {:.1f}s to go"
5526 val1 = sim.meep_time() - t0
5527 val2 = val1 / (0.01 * t)
5528 val3 = t1 - t_0
5529 val4 = (val3 * (t / val1) - val3) if val1 != 0 else 0
5530
5531 if do_progress:
5532 sim.progress.value = val1
5533 sim.progress.description = f"{int(val2)}% done "
5534
5535 if verbosity.meep > 0:
5536 print(msg_fmt.format(val1, t, val2, val3, val4))
5537 closure["tlast"] = t1
5538
5539 return _disp
5540

Callers

nothing calls this directly

Calls 1

meep_timeMethod · 0.80

Tested by

no test coverage detected