pySimBlocks.project.generate_run_script¶
- pySimBlocks.project.generate_run_script.generate_python_content(project_yaml_path: str, enable_plots: bool = True) str[source]¶
Render the run script template for a given project YAML path.
- Parameters:
project_yaml_path – Path string to the project YAML file, embedded verbatim into the generated script.
enable_plots – Whether to include the plotting call in the script.
- Returns:
The rendered run script as a string.
- pySimBlocks.project.generate_run_script.generate_run_script(*, project_dir: Path | None = None, project_yaml: Path | None = None, output: Path | None = None) None[source]¶
Generate a canonical
run.pyscript for a pySimBlocks project.Exactly one of
project_dirorproject_yamlmust be provided.- Parameters:
project_dir – Path to a project folder containing
project.yaml. The output script defaults to<project_dir>/run.py.project_yaml – Explicit path to a
project.yamlfile.output – Output path for the generated script. Defaults to
<project_dir>/run.pyinproject_dirmode orrun.pyin the current directory inproject_yamlmode.
- Raises:
ValueError – If both
project_dirandproject_yamlare given, or if neither is given.FileNotFoundError – If the resolved project YAML file does not exist.