Plexora

layer_requirement

Build a requirement descriptor for a spatial layer.

Generated from Plexora 0.0.55View source
from plexora.api import layer_requirement

Also available as plexora.api.plugin.layer_requirement.

layer_requirement(wanted: str, layer=None) -> Requirement

Used for the entries in Requires.layers and Requires.optional_layers: kind="layer" so the requirements modal renders an "Add layer..." row rather than a file field, since a layer is not a path to type but a thing to import.

Parameters

wantedstrrequired

A modality ("transcripts"), a kind ("kind:points"), or several joined with | ("visium_spots|kind:points"), the same vocabulary as Requires.layers.

layerdefault None

The project's matching layer, if it already has one. Used to say whether it failed to prepare or is still being prepared.

Returns

Requirement

The descriptor, labelled from wanted (and from layer's state, when given).