mythos.input.toml

Utilities for parsing TOML files.

Attributes

ERR_MISSING_TOML_ENTRY

SYMPY_EVAL_N

Functions

parse_str(→ str | float)

Parses a string value to a float if possible.

parse_value(→ str | float | numpy.ndarray)

Parses a value to a float or array if possible.

parse_toml(→ dict[str, Any])

Parses a TOML file and returns a dictionary representation of the file.

Module Contents

mythos.input.toml.ERR_MISSING_TOML_ENTRY = 'Missing entry {entry} in TOML file'
mythos.input.toml.SYMPY_EVAL_N: int = 32
mythos.input.toml.parse_str(value: str) str | float[source]

Parses a string value to a float if possible.

mythos.input.toml.parse_value(value: str | float | list[str] | list[float]) str | float | numpy.ndarray[source]

Parses a value to a float or array if possible.

mythos.input.toml.parse_toml(file_path: pathlib.Path | str, key: str | None = None) dict[str, Any][source]

Parses a TOML file and returns a dictionary representation of the file.