yasfpy.benchmark.mstm4#

Convenience wrapper around the MSTM4 binary.

Provides a manager object that prepares inputs, launches MSTM4, and parses outputs for comparison with YASF.

Attributes#

Classes#

MSTM4Manager

Manage MSTM4 benchmark runs.

Module Contents#

yasfpy.benchmark.mstm4.project_root#
class yasfpy.benchmark.mstm4.MSTM4Manager(/, **data)#

Bases: 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.

Notes

This class is designed for benchmarking/comparisons with YASF. It does not aim to expose the full MSTM4 input space.

path_config: str = None#
path_cluster: str = None#
cluster_scale: float = None#
cluster_dimensional_scale: float = None#
binary: str = None#
input_file: str = None#
output_file: str = None#
workdir: pathlib.Path | None = None#
parallel: int = None#
nix: bool = None#
quiet: bool = None#
print_sphere_data: bool = None#
random_orientation: bool = None#
incidence_average: bool = None#
number_incident_directions: int = None#
scattering_map_model: bool = None#
azimuthal_average: bool = None#
log: logging.Logger | None = None#
config: yasfpy.config.Config | None = None#
output: dict#
model_config: ClassVar[pydantic.ConfigDict]#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(__context)#

Finalize configuration after Pydantic initialization.

Notes

This resolves workdir and constructs yasfpy.config.Config from the configured paths and scaling factors.

clean()#

Delete generated MSTM4 input/output files.

run(runner=None, cleanup=True, *, silent=False, parse=True)#

Run MSTM4 and optionally parse output.

Parameters:
  • runner – Optional pyperf.Runner to benchmark execution.

  • cleanup – If True, delete generated files after the run.

  • silent – If True, suppress subprocess output.

  • parse – If True, parse the output file into self.output.

read_output()#

Parse the MSTM4 output file into output.

export(cleanup=False)#

Export MSTM4 results to a YASF yasfpy.export.Export bundle.

Parameters:

cleanup – If True, remove generated MSTM4 files after exporting.

yasfpy.benchmark.mstm4.workdir_tmp#