cellmap_flow.dashboard.routes.model_resolve

POST /api/models/resolve: a model entry from whatever reference the user pasted; POST /api/models/add: run such an entry.

The body is {"ref": ..., "name": ..., "voxel_size": ...} (only ref is required; voxel_size is one number, one per axis, or “8,8,8”). The answer is models.resolve’s Resolved:

{"success": true, "type": "fly", "params": {"checkpoint_path": ...},
 "name": "run07_432000", "env": "fly", "how": "a fly_organelles training checkpoint",
 "needs": [], "notes": [...]}

type, params and name are the model entry, which the model form submits once the user has given what needs lists. Nothing is built or launched here. A reference that resolves to nothing, or to a model cellmap-flow cannot serve, is a 400 with {"success": false, "error": ...}.

Attributes

logger

model_resolve_bp

Classes

ResolveModel

What the user pasted, and optionally the model's name and voxel size.

AddModel

A model entry to run: type, its parameters and name, as resolve

Functions

resolve_model()

add_model()

Build the entry and start its server, in its environment.

Module Contents

cellmap_flow.dashboard.routes.model_resolve.logger
cellmap_flow.dashboard.routes.model_resolve.model_resolve_bp
class cellmap_flow.dashboard.routes.model_resolve.ResolveModel(/, **data: Any)

What the user pasted, and optionally the model’s name and voxel size.

ref: Annotated[str, _required('ref', strip=True)] = None
name: str | None = None
voxel_size: Any = None
cellmap_flow.dashboard.routes.model_resolve.resolve_model()
class cellmap_flow.dashboard.routes.model_resolve.AddModel(/, **data: Any)

A model entry to run: type, its parameters and name, as resolve answers them with what needs asked filled in.

entry: dict
cellmap_flow.dashboard.routes.model_resolve.add_model()

Build the entry and start its server, in its environment.

The model joins the session’s models and jobs like one Submit started, so it stays running while it is ticked on the Models tab (the page adds a ticked box for it) and is stopped when unticked. A 400 names what is wrong with the entry; a 409, a model of that name already running.