def _do_get_simulation_frame(msg, template): try: return template_common.sim_frame_dispatch( msg.data.copy().pkupdate(run_dir=msg.runDir), ) except Exception as e: r = 'report not generated' if isinstance(e, sirepo.util.UserAlert): r = e.sr_args.error return PKDict(state=job.ERROR, error=r, stack=pkdexc())
def run(cfg_dir): """Run Hellweg in ``cfg_dir`` Args: cfg_dir (str): directory to run hellweg in """ _run_hellweg(cfg_dir) sim_in = simulation_db.read_json(template_common.INPUT_BASE_NAME) r = sim_in.report.replace simulation_db.write_result( template_common.sim_frame_dispatch( copy.deepcopy(sim_in.models[r]).pkupdate( frameReport=r.replace('Report', 'Animation'), run_dir=pkio.py_path(cfg_dir), sim_in=sim_in, ), ), )
def api_simulationFrame(frame_id): return template_common.sim_frame( frame_id, lambda a: template_common.sim_frame_dispatch(a), )
def _do_get_simulation_frame(msg, template): try: return template_common.sim_frame_dispatch( msg.data.copy().pkupdate(run_dir=msg.runDir), ) except Exception as e: return _maybe_parse_user_alert(e, error='report not generated')
def _do_get_simulation_frame(msg, template): return template_common.sim_frame_dispatch( msg.data.copy().pkupdate(run_dir=msg.runDir), )