pySimBlocks.tools.blocks_registry

pySimBlocks.tools.blocks_registry.load_block_registry(metadata_root: Path | str | None = None) Dict[str, Dict[str, BlockMeta]][source]

Load all BlockMeta subclasses from the GUI blocks directory.

Recursively scans metadata_root for Python files and registers every BlockMeta subclass found. Defaults to pySimBlocks/gui/blocks/.

Parameters:

metadata_root – Root directory to scan. Defaults to the package’s gui/blocks/ directory.

Returns:

Registry mapping category names to dicts of block_type -> BlockMeta.

Raises:
  • FileNotFoundError – If metadata_root does not exist.

  • ValueError – If two files define a BlockMeta with the same type within the same category.