load_scene#

Import

from scenet import load_scene

Defined in

scenet.frontends.yaml_front (source)

Install

pip install scenet

Since

0.1

Stability

Public: follows semantic versioning. Below 1.0, a minor release may change it, and the CHANGELOG says how.

scenet.frontends.yaml_front.load_scene(path)[source]#

Read and validate a multi-panel document from disk.

Parameters:

path (Path) – A *.scene.yaml file. A single-panel document also works and comes back as one entry named panel.

Return type:

dict[str, PanelIR]

Returns:

Panel name to scene graph, in declaration order – which is reading order.

Raises:

Note

Pages are not read: load_scene_document keeps them.

Example

>>> from pathlib import Path
>>> from tempfile import TemporaryDirectory
>>> from scenet import load_scene
>>> with TemporaryDirectory() as folder:
...     path = Path(folder) / "two.scene.yaml"
...     _ = path.write_text(
...         "cast: {a: {reference: alice}}\npanels: {one: {}, two: {}}", encoding="utf-8"
...     )
...     panels = load_scene(path)
>>> list(panels)
['one', 'two']

See also

parse_scene, for text.