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

Function convert_h5

python/simulation.py:5559–5577  ·  view source on GitHub ↗
(rm_h5, convert_cmd, *step_funcs)

Source from the content-addressed store, hash-verified

5557
5558
5559def convert_h5(rm_h5, convert_cmd, *step_funcs):
5560 def convert(fname):
5561 if mp.my_rank() == 0:
5562 cmd = convert_cmd.split()
5563 cmd.append(fname)
5564 ret = subprocess.call(cmd)
5565 if ret == 0 and rm_h5:
5566 os.remove(fname)
5567
5568 def _convert_h5(sim, todo):
5569 hooksave = sim.output_h5_hook
5570 sim.output_h5_hook = convert
5571
5572 for f in step_funcs:
5573 _eval_step_func(sim, f, todo)
5574
5575 sim.output_h5_hook = hooksave
5576
5577 return _convert_h5
5578
5579
5580def output_png(compnt, options, rm_h5=True):

Callers 1

h5topngMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected