load_panel#

Import

from scenet import load_panel

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_panel(path)[source]#

Read and validate a single-panel document from disk.

Parameters:

path (Path) – A *.panel.yaml file.

Return type:

PanelIR

Returns:

The validated scene graph. No coordinates yet – that is the solver’s job.

Raises:

Note

Only the document is read; files it names are read when it is compiled.

Example

>>> from pathlib import Path
>>> from tempfile import TemporaryDirectory
>>> from scenet import load_panel
>>> with TemporaryDirectory() as folder:
...     path = Path(folder) / "hello.panel.yaml"
...     _ = path.write_text("cast: {a: {reference: alice}}", encoding="utf-8")
...     panel = load_panel(path)
>>> list(panel.cast)
['a']

See also

parse_panel, for text. compile_file, to compile the file.