spectre.file_io.specfile_to_toml ================================ .. py:module:: spectre.file_io.specfile_to_toml .. autoapi-nested-parse:: Convert SPEC namelist files (``.sp``) into TOML input files. This module exposes :func:`specfile_to_toml`, a convenience wrapper that reads an existing SPEC namelist, validates the content against the high-level :class:`~spectre.file_io.input_parameters.InputParameters` model, and writes an adjacent TOML representation that fits the Python tooling in this repository. Module Contents --------------- .. py:function:: specfile_to_toml(source: _PathLike, destination: _PathLike | None = None) -> tuple[pathlib.Path, spectre.file_io.input_parameters.InputParameters] | list[tuple[pathlib.Path, spectre.file_io.input_parameters.InputParameters]] Translate a SPEC ``.sp`` namelist into a TOML input file. Parameters ---------- source: Path to either a single ``.sp`` file or a directory containing such files. destination: Optional target file or directory. When omitted, the TOML file will be placed next to the source namelist. When *source* is a directory, *destination* should also refer to a directory. Raises ------ FileNotFoundError If *source* does not exist. ValueError When *source* is a directory but *destination* resolves to a file.