pyretis.bin

Here, the PyRETIS executables can be found. These are:

pyretis.bin.pyretisrun module

pyretisrun - An application for running PyRETIS simulations.

This script is a part of the PyRETIS library and can be used for running simulations from an input script.

usage: pyretisrun.py [-h] -i INPUT [-V] [-f LOG_FILE] [-l LOG_LEVEL] [-p]

PyRETIS

optional arguments:
-h, --help show this help message and exit
-i INPUT, --input INPUT
 Location of PyRETIS input file
-V, --version show program’s version number and exit
-f LOG_FILE, --log_file LOG_FILE
 Specify log file to write
-l LOG_LEVEL, --log_level LOG_LEVEL
 Specify log level for log file
-p, --progress Display a progress meter instead of text output for the simulation

More information about running PyRETIS can be found at: www.pyretis.org

pyretis.bin.pyretisrun.bye_bye_world()[source]

Print out the goodbye message for PyRETIS.

pyretis.bin.pyretisrun.entry_point()[source]

entry_point - The entry point for the pip install of pyretisrun.

pyretis.bin.pyretisrun.hello_world(infile, rundir, logfile)[source]

Print out a standard greeting for PyRETIS.

Parameters:
  • infile (string) – String showing the location of the input file.
  • rundir (string) – String showing the location we are running in.
  • logfile (string) – The output log file
pyretis.bin.pyretisrun.main(infile, indir, exe_dir, progress, log_level)[source]

Execute PyRETIS.

Parameters:
  • infile (string) – The input file to open with settings for PyRETIS.
  • indir (string) – The folder containing the settings file.
  • exe_dir (string) – The directory we are working from.
  • progress (boolean) – Determines if we should use a progress bar or not.
  • log_level (integer) – Determines if we should display the error traceback or not.
pyretis.bin.pyretisrun.run_generic_simulation(sim, sim_settings, progress=False)[source]

Run a generic PyRETIS simulation.

These are simulations that are just going to complete a given number of steps. Other simulation may consist of several simulations tied together and these are NOT handled here.

Parameters:
  • sim (object like Simulation) – This is the simulation to run.
  • sim_settings (dict) – The simulation settings.
  • progress (boolean, optional) – If True, we will display a progress bar, otherwise, we print results to the screen.
pyretis.bin.pyretisrun.run_md_flux_simulation(sim, sim_settings, progress=False)[source]

Run a MD-FLUX simulation.

Parameters:
  • sim (object like Simulation) – This is the simulation to run.
  • sim_settings (dict) – The simulation settings.
  • progress (boolean, optional) – If True, we will display a progress bar, otherwise, we print results to the screen.
pyretis.bin.pyretisrun.run_md_simulation(sim, sim_settings, progress=False)[source]

Run a MD simulation.

Parameters:
  • sim (object like Simulation) – This is the simulation to run.
  • sim_settings (dict) – The simulation settings.
  • progress (boolean, optional) – If True, we will display a progress bar, otherwise, we print results to the screen.
pyretis.bin.pyretisrun.run_retis_simulation(sim, sim_settings, progress=False)[source]

Run a RETIS simulation with PyRETIS.

Parameters:
  • sim (object like Simulation) – This is the simulation to run.
  • sim_settings (dict) – The simulation settings.
  • progress (boolean, optional) – If True, we will display a progress bar, otherwise, we print results to the screen.
pyretis.bin.pyretisrun.run_tis_simulation(settings_sim, settings_tis, progress=False)[source]

Run TIS simulations with PyRETIS.

Here, we have the possibility of doing 2 things:

  1. Just write out input files for single TIS simulations and exit without running a simulation.
  2. Run a single TIS simulation.
Parameters:
  • settings_sim (list of dicts or Simulation objects) – The settings for the simulations or the actual simulation to run.
  • settings_tis (dict) – The simulation settings for the TIS simulation.
  • progress (boolean, optional) – If True, we will display a progress bar, otherwise, we print results to the screen.
pyretis.bin.pyretisrun.run_tis_single_simulation(sim, sim_settings, progress=False)[source]

Run a single TIS simulation with PyRETIS.

Parameters:
  • sim (object like Simulation) – This is the simulation to run.
  • sim_settings (dict) – The simulation settings.
  • progress (boolean, optional) – If True, we will display a progress bar, otherwise, we print results to the screen.
pyretis.bin.pyretisrun.set_up_simulation(inputfile, runpath)[source]

Run all the needed generic set-up.

Parameters:
  • inputfile (string) – The input file which defines the simulation.
  • runpath (string) – The base path we are running the simulation from.
Returns:

  • runner (method) – A method which can be used to execute the simulation.
  • sim (object like Simulation) – The simulation defined by the input file.
  • syst (object like System) – The system created.
  • sim_settings (dict) – The input settings read from the input file.

pyretis.bin.pyretisrun.soft_exit_ignore(turn_keyboard_interruption_off=True)[source]

Manage the KeyboardInterrupt exception.

Parameters:turn_keyboard_interruption_off (boolean) – If True, instead of regular exiting from the program, the file ‘EXIT’ is created to stop the PyRETIS.
pyretis.bin.pyretisrun.store_simulation_settings(settings, indir, backup)[source]

Store the parsed input settings.

Parameters:
  • settings (dict) – The simulation settings.
  • indir (string) – The directory which contains the input script.
  • backup (boolean) – If True, an existing settings file will be backed up.
pyretis.bin.pyretisrun.use_tqdm(progress)[source]

Return a progress bar if we want one.

Parameters:progress (boolean) – If True, we should use a progress bar, otherwise not.
Returns:out (object like tqdm.tqdm) – The progress bar, if requested. Otherwise, just a dummy iterator.

pyretis.bin.pyretisanalyse module

pyretisanalyse - An application for analysing PyRETIS simulations.

This script is a part of the PyRETIS library and can be used for analysing the result from simulations.

usage: pyretisanalyse.py [-h] -i INPUT [-V]

PyRETIS

optional arguments:
-h, --help show this help message and exit
-i INPUT, --input INPUT
 Location of PyRETIS input file
-V, --version show program’s version number and exit
pyretis.bin.pyretisanalyse.bye_bye_world()[source]

Print out the goodbye message for PyRETIS.

pyretis.bin.pyretisanalyse.create_reports(settings, analysis_results, report_path)[source]

Create some reports to display the output.

Parameters:
  • settings (dict) – Settings for analysis (and the simulation).
  • analysis_results (dict) – Results from the analysis.
  • report_path (string) – The path to the directory where the reports should be saved.
Yields:

out (string) – The report files created.

pyretis.bin.pyretisanalyse.entry_point()[source]

entry_point - The entry point for the pip install of pyretisanalyse.

pyretis.bin.pyretisanalyse.get_report_name(report_type, ext, prefix=None, path=None)[source]

Generate file name for a report.

Parameters:
  • report_type (string) – Identifier for the report we are writing.
  • ext (string) – Extension for the file to write.
  • prefix (string, optional) – A prefix to add to the file name. Usually just used to mark reports with ensemble number for report_type equal to ‘tis-single’
  • path (string) – A directory to use for saving the report to.
Returns:

out (string) – The name of the file written.

pyretis.bin.pyretisanalyse.hello_world(infile, run_dir, report_dir)[source]

Output a standard greeting for PyRETIS analysis.

Parameters:
  • infile (string) – String showing the location of the input file.
  • run_dir (string) – The location where we are executing the analysis.
  • report_dir (string) – String showing the location of where we write the output.
pyretis.bin.pyretisanalyse.main(input_file, run_path, report_dir)[source]

Run the analysis.

Parameters:
  • input_file (string) – The input file with settings for the analysis.
  • run_path (string) – The location from which we are running the analysis.
  • report_dir (string) – The location where we will write the report.
pyretis.bin.pyretisanalyse.write_file(outname, report_txt)[source]

Write a generated report to a given file.

Parameters:
  • outname (string) – The name of the file to write/create.
  • report_txt (string) – This is the generated report as a string.
Returns:

out (string) – The name of the file written.

pyretis.bin.pyretisanalyse.write_traceback(filename)[source]

Write the error traceback to the given file.