pymchelper.executor.runner module

class pymchelper.executor.runner.OutputDataType[source]

Bases: enum.IntEnum

Output type requested by user plots (i.e .png) or text data

plot = 1
txt = 2
class pymchelper.executor.runner.Runner(jobs=None, keep_workspace_after_run=False, output_directory='.')[source]

Bases: object

Main class responsible for configuring and starting multiple parallel MC simulation processes It can be used to access combined averaged results of the simulation.

clean()[source]

Removes all working directories (if exists)

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

run(settings)[source]

Execute parallel simulation processes, creating workspace (and working directories) in the output_directory In case of successful execution return True, otherwise return False

class pymchelper.executor.runner.SingleSimulationExecutor[source]

Bases: object

Callable class responsible for execution of the single MC simulation process.

class pymchelper.executor.runner.WorkspaceManager(output_directory='.', keep_workspace_after_run=False)[source]

Bases: object

A workspace consists of multiple working directories (i.e. run_1, run_2), each per one of the parallel simulation run.

clean()[source]

clean the workspace by removing all working directories (only if requested by keep_workspace_after_run flag)

create_working_directories(simulation_input_path, rng_seeds=())[source]

Create working directories and fill self.working_directories_abs_paths