cellmap_flow.config.yaml
Reading a cellmap_flow yaml or blockwise YAML file.
load_config reads and checks the file’s top level, filling
charge_group and queue from the dashboard’s saved settings (then the
site’s default queues) when the file leaves them out, reading queue
as a list (one queue, queue: gpu_h200, is a list of one) and data_path
as pasted (portable/pasted.py: one copied from Neuroglancer without the
format it names); the model entries under
models are built by models.registry.build_models. Every problem is a ConfigError.
resolve_data_path is the one rule for a model’s data_path and
scale, used by every launcher. Every model’s input is resampled to its
voxel size when the data has no level at it (cellmap_flow yaml passes
--resample to each server; blockwise opens the raw with
io.raw.open_raw(..., resample=True)) unless the YAML says
resample: false.
Attributes
Exceptions
The YAML configuration is not usable; the message says why. |
Functions
|
The dataset a model reads: |
|
Load and validate the YAML configuration. |
Module Contents
- cellmap_flow.config.yaml.logger
- exception cellmap_flow.config.yaml.ConfigError
The YAML configuration is not usable; the message says why.
Raised rather than calling sys.exit: this code also runs inside the dashboard (the blockwise precheck, a finetuned model’s base config), where SystemExit slips past
except Exceptionand the request thread dies without sending a response. The CLIs catch it and exit non-zero.
- cellmap_flow.config.yaml.resolve_data_path(data_path: str, scale: str | None) str
The dataset a model reads:
data_path, withscaleapplied.The one rule every launcher uses (
cellmap_flow infer,yamlandblockwise), so the same YAML reads the same data in each:data_pathis an array: it is used as it is. Ascalenaming a different level is ignored, with a warning.otherwise (a multiscale group, or a path that cannot be inspected here, such as a URL):
scaleselects the level under it.
- cellmap_flow.config.yaml.load_config(path: str) Dict[str, Any]
Load and validate the YAML configuration.
- Parameters:
path – Path to YAML configuration file: a str, bytes or os.PathLike. Anything else is refused, because open() takes an int as a file descriptor: it would read through whatever the process has open under that number, and then close it.
- Returns:
Validated configuration dictionary
- Raises:
ConfigError –
pathis not a path, or a required field is missing or malformed