yasfpy.benchmark.mstm4 ====================== .. py:module:: yasfpy.benchmark.mstm4 .. autoapi-nested-parse:: Convenience wrapper around the MSTM4 binary. Provides a manager object that prepares inputs, launches MSTM4, and parses outputs for comparison with YASF. Attributes ---------- .. autoapisummary:: yasfpy.benchmark.mstm4.project_root yasfpy.benchmark.mstm4.workdir_tmp Classes ------- .. autoapisummary:: yasfpy.benchmark.mstm4.MSTM4Manager Module Contents --------------- .. py:data:: project_root .. py:class:: MSTM4Manager(/, **data) Bases: :py:obj:`pydantic.BaseModel` Manage MSTM4 benchmark runs. The manager constructs an MSTM4 input file from a YASF configuration, runs the external MSTM4 binary, and parses the output into a structured dict. .. rubric:: Notes This class is designed for benchmarking/comparisons with YASF. It does not aim to expose the full MSTM4 input space. .. py:attribute:: path_config :type: str :value: None .. py:attribute:: path_cluster :type: str :value: None .. py:attribute:: cluster_scale :type: float :value: None .. py:attribute:: cluster_dimensional_scale :type: float :value: None .. py:attribute:: binary :type: str :value: None .. py:attribute:: input_file :type: str :value: None .. py:attribute:: output_file :type: str :value: None .. py:attribute:: workdir :type: pathlib.Path | None :value: None .. py:attribute:: parallel :type: int :value: None .. py:attribute:: nix :type: bool :value: None .. py:attribute:: quiet :type: bool :value: None .. py:attribute:: print_sphere_data :type: bool :value: None .. py:attribute:: random_orientation :type: bool :value: None .. py:attribute:: incidence_average :type: bool :value: None .. py:attribute:: number_incident_directions :type: int :value: None .. py:attribute:: scattering_map_model :type: bool :value: None .. py:attribute:: azimuthal_average :type: bool :value: None .. py:attribute:: log :type: logging.Logger | None :value: None .. py:attribute:: config :type: yasfpy.config.Config | None :value: None .. py:attribute:: output :type: dict .. py:attribute:: model_config :type: ClassVar[pydantic.ConfigDict] Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:method:: model_post_init(__context) Finalize configuration after Pydantic initialization. .. rubric:: Notes This resolves ``workdir`` and constructs :class:`yasfpy.config.Config` from the configured paths and scaling factors. .. py:method:: clean() Delete generated MSTM4 input/output files. .. py:method:: run(runner = None, cleanup = True, *, silent = False, parse = True) Run MSTM4 and optionally parse output. :param runner: Optional :class:`pyperf.Runner` to benchmark execution. :param cleanup: If True, delete generated files after the run. :param silent: If True, suppress subprocess output. :param parse: If True, parse the output file into ``self.output``. .. py:method:: read_output() Parse the MSTM4 output file into ``output``. .. py:method:: export(cleanup = False) Export MSTM4 results to a YASF :class:`yasfpy.export.Export` bundle. :param cleanup: If True, remove generated MSTM4 files after exporting. .. py:data:: workdir_tmp