openfactcheck.lib.SolversConfig#
- class openfactcheck.lib.SolversConfig(filename_or_path_s)[source][source]#
A class to load solver configurations from one or more JSON or YAML files.
This class reads solver configurations from specified files, merges them, and provides access to the combined configuration as a dictionary.
- Parameters:
filename_or_paths (str | Path | list[str | Path]) – The path or list of paths to the solver configuration files.
filename_or_path_s (str | Path | list[str] | list[Path])
- solvers#
Dictionary containing the merged solver configurations.
- Type:
dict[Any, Any]
Examples
Load solver configurations from a single file:
>>> solvers = SolversConfig("solvers.yaml") >>> config = solvers()
Load solver configurations from multiple files:
>>> solvers = SolversConfig(["solvers1.json", "solvers2.yaml"]) >>> config = solvers()
Access the solvers dictionary:
>>> config = solvers()
- __init__(filename_or_path_s)[source][source]#
Initialize the SolversConfig class.
- Parameters:
filename_or_path_s (str or path object or list of str or path objects) – The path to the solvers configuration or a list of paths to multiple solvers configurations.
- Return type:
None
Methods
__init__
(filename_or_path_s)Initialize the SolversConfig class.