Plexora

requirement

Build one requirement descriptor from its key alone.

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

Also available as plexora.api.plugin.requirement.

requirement(key: str, optional: bool = False) -> Requirement

Used to ask for an input no plugin declared up front -- the Cells control's "Add Data" button, or code that names a key directly rather than going through Requires. The wording of the resulting question is always core's; this only says which input is being asked for.

Parameters

keystrrequired

Which input to ask for: "table", "segmentation", "markers", "features", "coordinates", or "role:<name>" for a column role.

optionalbooldefault False

Whether the tool can open without this input. Defaults to False.

Returns

Requirement

The descriptor, ready to show in the requirements modal.

Raises

KeyError

If key does not name a recognized input.