pymchelper.executor package#
Submodules#
pymchelper.executor.options module#
- class pymchelper.executor.options.FlukaEnvironment[source]#
Bases:
MCEnvironmentFLUKA Environment
- executable_filename = 'rfluka'#
- simulator_type = 3#
- class pymchelper.executor.options.MCEnvironment[source]#
Bases:
objectMCEnvironment subclasses are helpful to discover which MC engine (i.e. FLUKA or SHIELD-HIT12A) is being used they provide information about expected executable filename, by inspecting the path to executable filename (i.e. checking if it ends with rfluka) we can find corresponding code type
- executable_filename = None#
- class pymchelper.executor.options.SH12AEnvironmentLinux[source]#
Bases:
MCEnvironmentSHIELD-HIT12A Environment for Linux
- executable_filename = 'shieldhit'#
- simulator_type = 1#
- class pymchelper.executor.options.SH12AEnvironmentWindows[source]#
Bases:
MCEnvironmentSHIELD-HIT12A Environment for Windows
- executable_filename = 'shieldhit.exe'#
- simulator_type = 1#
- class pymchelper.executor.options.SH12ASettings(input_path: str, simulator_type: SimulatorType | None = None, simulator_exec_path: str = None, cmdline_opts: str = None)[source]#
Bases:
SimulationSettingsTODO
- class pymchelper.executor.options.SimulationSettings(input_path: str, simulator_type: SimulatorType | None = None, simulator_exec_path: str = None, cmdline_opts: str = None)[source]#
Bases:
objectThis class is responsible for keeping track of options for MC simulation:
location of the MC simulator executable
additional options provided by the user
location of the input files or directories
Moreover this class performs automatic discovery of the MC input (i.e. whether this is SHIELD-HIT12A, Fluka or TOPAS input)
- set_no_of_primaries(number_of_primaries)[source]#
This methods modifies command line options of the MC engine by setting (or overriding) the number of primaries to be simulated by each of the parallel jobs TODO this method is specific to SH12A, more general should be added TODO add support for no of primaries provided as –nstat, instead of -n
- class pymchelper.executor.options.TopasEnvironment[source]#
Bases:
MCEnvironmentTOPAS Environment
- executable_filename = 'topas'#
- simulator_type = 2#
pymchelper.executor.runner module#
- class pymchelper.executor.runner.OutputDataType(*values)[source]#
Bases:
IntEnumOutput type requested by user plots (i.e .png) or text data
- plot = 1#
- txt = 2#
- class pymchelper.executor.runner.Runner(settings: SimulationSettings, jobs: int = None, keep_workspace_after_run: bool = False, output_directory: str = '.')[source]#
Bases:
objectMain class responsible for configuring and starting multiple parallel MC simulation processes It can be used to access combined averaged results of the simulation.
- get_data()[source]#
Scans the output directory for location of the working directories (like run_1, run_2). Takes all files from all working directories in output_dir, merges their content to form pymchelper Estimator objects. For each of the output file a single Estimator objects is created, which holds numpy arrays with results. Return dictionary with keys being output filenames, and values being Estimator objects
- class pymchelper.executor.runner.SingleSimulationExecutor[source]#
Bases:
objectCallable class responsible for execution of the single MC simulation process.
- class pymchelper.executor.runner.WorkspaceManager(output_directory='.', keep_workspace_after_run=False)[source]#
Bases:
objectA workspace consists of multiple working directories (i.e. run_1, run_2), each per one of the parallel simulation run.