Example #1
0
def get_ensemble(*, res: LibresFacade = Depends(get_res),
                 ensemble_id: UUID) -> js.EnsembleOut:
    return js.EnsembleOut(
        id=ensemble_id,
        children=[],
        parent=None,
        experiment_id=get_id("experiment", "default"),
        userdata={"name": get_name("ensemble", ensemble_id)},
        size=get_size(get_name("ensemble", ensemble_id)),
        parameter_names=ensemble_parameter_names(
            get_name("ensemble", ensemble_id)),
        response_names=get_response_names(),
        child_ensemble_ids=[],
    )
Example #2
0
def get_experiment_ensembles(*,
                             res: LibresFacade = Depends(get_res),
                             experiment_id: UUID) -> List[js.EnsembleOut]:
    return [
        js.EnsembleOut(
            id=get_id("ensemble", case),
            children=[],
            parent=None,
            experiment_id=get_id("experiment", "default"),
            userdata={"name": case},
            size=get_size(res),
            parameter_names=[],
            response_names=[],
            child_ensemble_ids=[],
        ) for case in res.cases()
    ]
Example #3
0
 def resolve_size(root: Any, info: "ResolveInfo") -> int:
     return get_size(get_res_from_info(info))
Example #4
0
 def resolve_size(root: Any, info: "ResolveInfo") -> int:
     return get_size(root)