How to use the qcfractal.dashboard.connection.get_socket function in qcfractal

To help you get started, we’ve selected a few qcfractal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MolSSI / QCFractal / qcfractal / dashboard / dash_queue.py View on Github external
def queue_counts(status):
    socket = get_socket()

    data = socket.get_queue(status=status, limit=1)
    return data["meta"]["n_found"]
github MolSSI / QCFractal / qcfractal / dashboard / dash_managers.py View on Github external
def managers_table(status):
    socket = get_socket()

    managers = socket.get_managers(status=status)
    df = pd.DataFrame(managers["data"])

    df["uuid"] = [x[:6] for x in df["uuid"]]
    cols = ["cluster", "username", "uuid", "submitted", "completed", "failures"]

    table = dash_table.DataTable(
        id='table',
        columns=[{
            "name": i.title(),
            "id": i
        } for i in cols],
        data=df[cols].to_dict('records'),
        filtering=True,
        sorting=True,
github MolSSI / QCFractal / qcfractal / dashboard / dash_models.py View on Github external
def list_managers(status=None, modified_after=None):
    socket = get_socket()

    managers = socket.get_managers(status=status, modified_after=modified_after)
    cols = [
        "cluster",
        "username",
        "tag",
        "completed",
        "submitted",
        "failures",
        "returned",
        "created_on",
        "modified_on",
        "programs",
        "procedures",
        # "name"
    ]
github MolSSI / QCFractal / qcfractal / dashboard / dash_service.py View on Github external
def service_counts(status):
    socket = get_socket()

    data = socket.get_services(status=status, limit=1)
    return data["meta"]["n_found"]
github MolSSI / QCFractal / qcfractal / dashboard / dash_models.py View on Github external
def task_graph():

    socket = get_socket()

    cnts = socket.custom_query("task", "counts")
    df = pd.DataFrame(cnts["data"])

    df.loc[df["tag"].isna(), "tag"] = "None"
    order = df.groupby("tag")["count"].sum().sort_values(ascending=False).index

    bar_iter = [
        ("waiting", DEFAULT_PLOTLY_COLORS[0]),
        ("running", DEFAULT_PLOTLY_COLORS[2]),
        ("error", DEFAULT_PLOTLY_COLORS[3]),
    ]

    bars = []
    for status, color in bar_iter:
        bar_data = []
github MolSSI / QCFractal / qcfractal / dashboard / dash_managers.py View on Github external
def overview_graph(status):
    socket = get_socket()

    managers = socket.get_managers(status=status)
    df = pd.DataFrame(managers["data"])

    data = df.groupby("cluster")["completed"].sum().sort_values(ascending=False)
    return {"data": [{"x": data.index, "y": data.values}]}
github MolSSI / QCFractal / qcfractal / dashboard / dash_models.py View on Github external
def manager_graph(status=None, modified_after=None):
    socket = get_socket()

    managers = socket.get_managers(status=status, modified_after=modified_after)
    df = pd.DataFrame(managers["data"])

    bars = []
    if df.shape[0] > 0:
        data = df.groupby("cluster")[["completed", "submitted", "failures"]].sum()
        data["error"] = data["failures"]
        data["running"] = data["submitted"] - data["completed"]

        bar_iter = [
            ("error", DEFAULT_PLOTLY_COLORS[3]),
            ("running", DEFAULT_PLOTLY_COLORS[2]),
            ("completed", DEFAULT_PLOTLY_COLORS[0]),
        ]