Skip to content

capabilities

tit.server.routes.capabilities

Cheap capability probes for the scientific server runtime.

probe_capabilities

probe_capabilities() -> Capabilities

Probe server dependencies; native viewer availability belongs to the host.

Source code in tit/server/routes/capabilities.py
def probe_capabilities() -> Capabilities:
    """Probe server dependencies; native viewer availability belongs to the host."""
    return Capabilities(
        docker_socket=os.path.exists(DOCKER_SOCKET),
        bpy=_module_available("bpy"),
        # `jupyter` (the meta-package) importable in this same interpreter --
        # the container's `NOTEBOOK` alias runs `simnibs_python -m jupyter
        # lab`, and the server itself runs under `simnibs_python`, so
        # `find_spec` here answers the same question that alias depends on
        # (ra_13 finding 3e; there is no in-app start control yet, see
        # `pages/settings/index.tsx`'s Jupyter card).
        jupyter=_module_available("jupyter"),
        fastsurfer=_fastsurfer_home() is not None,
    )