spectre.file_io.toml_io ======================= .. py:module:: spectre.file_io.toml_io .. autoapi-nested-parse:: Utilities for reading and writing SPEC input parameters in TOML format. Module Contents --------------- .. py:function:: input_parameters_to_dict(params: spectre.file_io.input_parameters.InputParameters) -> dict[str, Any] Convert an :class:`InputParameters` instance into a TOML-friendly mapping. The returned dictionary contains only plain Python types (``dict``, ``list``, ``int``/``float``/``bool``/``str``). Numpy containers are converted to lists to ensure compatibility with :mod:`tomli_w`. .. py:function:: input_parameters_from_dict(data: Mapping[str, Any]) -> spectre.file_io.input_parameters.InputParameters Create an :class:`InputParameters` instance from a mapping. .. py:function:: write_input_parameters_to_toml(params: spectre.file_io.input_parameters.InputParameters, destination: PathLike) -> None Serialise *params* to TOML and write them to *destination*. Parameters ---------- params: The :class:`InputParameters` instance to write. destination: Filesystem path that will be opened in binary write mode. .. py:function:: read_input_parameters_from_toml(source: PathLike) -> spectre.file_io.input_parameters.InputParameters Read *source* and return an :class:`InputParameters` instance.