mythos.simulators.base ====================== .. py:module:: mythos.simulators.base .. autoapi-nested-parse:: Base class for a simulation. Classes ------- .. autoapisummary:: mythos.simulators.base.SimulatorOutput mythos.simulators.base.Simulator mythos.simulators.base.InputDirSimulator Module Contents --------------- .. py:class:: SimulatorOutput Output container for simlators. .. py:attribute:: observables :type: list[Any] .. py:attribute:: state :type: dict[str, Any] .. py:class:: Simulator Base class for a simulation. .. py:attribute:: name :type: str .. py:attribute:: exposed_observables :type: ClassVar[list[str]] :value: ['trajectory'] .. py:method:: run(*_args, opt_params: dict[str, Any], **_kwargs) -> SimulatorOutput Run the simulation. .. py:method:: exposes() -> list[str] Get the list of exposed observables. .. py:method:: create_n(n: int, name: str | None = None, **kwargs) -> list[Simulator] :classmethod: Create N simulators with unique names. .. py:class:: InputDirSimulator Bases: :py:obj:`Simulator`, :py:obj:`abc.ABC` A base class for simulators that run based on an input directory. This class handles copying the input directory to a temporary location unless overwrite_input is set to True. Subclasses must implement the run_simulation method, which runs the simulation logic given the provided input directory. :param input_dir: Path to the input directory. :param overwrite_input: Whether to overwrite the input directory or copy it. If this is False (default), the contents of the input_dir will be copied to a temporary directory for running the simulation to avoid overwriting input. .. py:attribute:: input_dir :type: str .. py:attribute:: overwrite_input :type: bool :value: False .. py:method:: run(*args, **kwargs) -> SimulatorOutput Run the simulation. .. py:method:: copy_inputs(temp_dir: str) -> None Copy input files to temporary directory. .. py:method:: run_simulation(input_dir: pathlib.Path, *args, **kwargs) -> SimulatorOutput :abstractmethod: Run the simulation in the given input directory.