示例#1
0
文件: job_cmd.py 项目: cchall/sirepo
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())
示例#2
0
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,
            ), ), )
示例#3
0
def api_simulationFrame(frame_id):
    return template_common.sim_frame(
        frame_id,
        lambda a: template_common.sim_frame_dispatch(a),
    )
示例#4
0
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')
示例#5
0
def _do_get_simulation_frame(msg, template):
    return template_common.sim_frame_dispatch(
        msg.data.copy().pkupdate(run_dir=msg.runDir), )