Library#
from pyxel_config_core import (
validate_config, autofix, list_models, find_tutorial, model_parameters,
)
result = validate_config(open("my_config.yaml").read())
print(result.valid, "judged by Pyxel", result.pyxel_version)
for d in result.diagnostics:
print(d.severity, d.path, d.message)
# The same checks with a sentence on top and an instruction on each finding
from pyxel_config_core import explain_config
explanation = explain_config(open("my_config.yaml").read(), deep=True)
print(explanation.summary) # "This CCD exposure config has 2 problems in the charge_generation stage."
for d in explanation.diagnostics:
print(d.path, d.next_step) # "/pipeline/charge_generation/0/func Rename func to '...dark_current'."
# Discover what models exist before building a config
for m in list_models("charge_generation").models:
print(m.func)
# Repair typo'd names and misplaced models in one call
fix = autofix(open("my_config.yaml").read())
for change in fix.changes:
print(change.action, change.path, change.before, "->", change.after)
tut = find_tutorial("charge_generation", "dark_current")
params = model_parameters("load_image")
A HoloViz/Panel assistant (or any Python app) can import this directly — no
server, no network, no access to anything private.
Every function and result type used here is documented in the API reference.