pyretis.bin¶
Here, the PyRETIS executables can be found. These are:
pyretis.bin.cli module¶
pyretis - The unified PyRETIS command-line interface.
This is the single entry point for PyRETIS. It dispatches a sub-command to the matching tool:
pyretis run -i input.toml # run a simulation (was pyretisrun)
pyretis analyse -i analysis.txt # analyse output (was pyretisanalyse)
pyretis tools init -i input.toml # auto-place interfaces (infinit driver)
pyretis tools clean # remove run artifacts in a directory
Run with no command (or pyretis -h) it prints the logo and this usage;
pyretis -v / --version prints the version.
The run and analyse sub-commands take exactly the same options as
the standalone command they replace; pyretis <command> -h shows them.
The standalone pyretisrun and pyretisanalyse commands still work
but are deprecated: from PyRETIS 5 only pyretis run and
pyretis analyse will be supported. pyretis clean is likewise kept
as a deprecated alias of pyretis tools clean.
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._reject_untranslated_scheduler_input(inputfile)[source]¶
Fail with an actionable error on a canonical-shaped scheduler input.
Every legitimate input to
run_infinite_swapping()is in the coordinator’s own config shape and therefore carries a[simulation.tis_set]table: the translatedoutput.toml/infswap.toml(written byrun_pyretis_path_sampling()/run_legacy_runner_config()viato_scheduler_config, which always setstis_set), a legacyrestart.toml, and a raw legacy-runner config. A NATIVE-shaped config that still carriestask = "infinite_swapping"(e.g. one produced by a converter version that preserved the dialect’s routing marker instead of rewriting it to the canonical task) has NOtis_setand would otherwise crash deep inapply_config_defaultswith a bareKeyError('tis_set'). Detect that here and say how to fix it.- Parameters:
inputfile (string) – Path to the input TOML handed to the scheduler.
- pyretis.bin.pyretisrun._report_execution_error(error, log_level)[source]¶
Log a stopped execution and write its traceback to the log only.
Shared by both CLI flows (the in-process simulation and the infinite-swapping scheduler) so a failure is reported the same way regardless of which path ran. The friendly one-line message goes to the screen; the full traceback goes to the log file only.
- Parameters:
error (Exception) – The exception currently being handled.
log_level (integer) – The active log level. At
DEBUGor below the caller should re-raise so the traceback also reaches the screen.
- Returns:
reraise (boolean) –
Truewhen the caller should re-raise (debug mode), so the error is never silently swallowed.
- pyretis.bin.pyretisrun._scheduler_worker_count(inputfile)[source]¶
Return the worker count the scheduler will use for
inputfile.Resolved exactly like
pyretis.inout.config_adapter. to_scheduler_config(): the environment override wins, then a[runner]section (legal canonical syntax), then the default of 1. Used to report the effective count when routing a path-sampling config, so the progress line matches the run.- Parameters:
inputfile (string) – Path to the input TOML (already validated by
is_path_sampling_config()).- Returns:
integer – The number of scheduler workers the run will start.
- pyretis.bin.pyretisrun._stage_continuation(resume_file, restart_file, config)[source]¶
Merge the new settings with the persisted scheduler state.
A restart continuation takes its SETTINGS from the new config (already translated by the caller into
config) and only the running[current]state – cstep, RNG state, frac weights, the active path numbers and their birth-ensemble map – from the previous run’s state file. This restores the classic restart contract (settings from the input file, state from the restart file): resuming the previous run file verbatim would silently discard every setting change the continuation config makes (a new step target, a different engine or output options – e.g. the engine change the gromacs1-vs-gromacs2 example suite exercises).- Parameters:
resume_file (string) – Path to the previous run’s state file (
output.toml, or a legacyrestart.toml).restart_file (string) – Path to the run file to write the merged config to (the run directory’s
output.toml).config (dict) – The translated scheduler config (defaults already applied), WITHOUT a
[current]section. Mutated in place: the persisted[current]state is grafted onto it.
- pyretis.bin.pyretisrun._warn_legacy_dialect_deprecated(inputfile)[source]¶
Emit a single
DeprecationWarningfor legacy-runner input.Mirrors
pyretis.inout.settings._warn_rst_deprecated()’s rst precedent: the legacy dialect keeps running (via the same normalize/translate pipeline every canonical config already goes through, seerun_legacy_runner_config()), this only warns.
- pyretis.bin.pyretisrun.entry_point()[source]¶
entry_point - The entry point for the pip install of pyretisrun.
- pyretis.bin.pyretisrun.entry_point_deprecated()[source]¶
Legacy
pyretisrunentry point: warn, then runpyretis run.The standalone
pyretisruncommand is kept working for now but is deprecated in favour ofpyretis run; from PyRETIS 5 only the unified command will be supported. This wrapper emits that warning and then delegates toentry_point()unchanged.
- pyretis.bin.pyretisrun.hello_world(infile, rundir, logfile)[source]¶
Print out a politically correct 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.is_infinite_swapping_config(inputfile)[source]¶
Return True if the input selects the infinite-swapping sampler.
The infinite-swapping (replica-exchange) sampler is selected explicitly via
[simulation] task = "infinite_swapping"(orinfswap/infretis). A recognised path-sampling task (_PATH_SAMPLING_TASKS: retis/tis/explore/pptis/repptis) is NEVER treated as infinite-swapping, even if its[runner]section is present –[runner](worker count / multi-engine pools) is legal canonical syntax too, translated bypyretis.inout.config_adapter.to_scheduler_config()just like every other canonical section. Only an input with NO recognisedtaskat all falls back to the[runner]-presence heuristic (the still-supported legacy runner dialect, which never setstask). Only.tomlinputs are considered; the in-process simulation flow handles everything else.- Parameters:
inputfile (string) – Path to the input file.
- Returns:
boolean – True if the infinite-swapping scheduler should run this input.
- pyretis.bin.pyretisrun.is_legacy_runner_config(inputfile)[source]¶
Return True if
inputfileneeds the legacy-runner pipeline.The structural marker is
[simulation.tis_set]– the legacy runner dialect’s own placement of its path-sampling knobs (vs. the canonical[tis]) – checked directly rather than inferred fromtask: real configs in the validation suite carry an explicittask = "infinite_swapping"for unambiguous routing while still using[simulation.tis_set]throughout, sotaskpresence alone does not distinguish the two dialects here (see MERGE_TODO.md S5.6).A restart continuation is excluded: it is always invoked by pointing
-idirectly at the scheduler’s ownrestart.toml(never the original config), which is already in the coordinator’s own shape (its[current]section is state, not input) and must not be re-normalized. Both the conventional filename and[current]’s presence are checked, since the restart-continuation convention inpyretis.simulation.setup.setup_config()already depends on the exactrestart.tomlname, not just this function.- Parameters:
inputfile (string) – Path to the input file.
- Returns:
boolean – True if this is a fresh legacy-runner config that should be routed through
run_legacy_runner_config().
- pyretis.bin.pyretisrun.is_path_sampling_config(inputfile)[source]¶
Return True if a canonical path-sampling TOML routes to the scheduler.
As of the Stage C collapse, canonical
task = "retis".tomlinputs are run through the infinite-swapping scheduler atn_workers = 1(their config is translated bypyretis.inout.config_adapter.to_scheduler_config()). The canonicaltis,explore,pptis, andrepptistasks all route through the scheduler too (validated by VALIDITY, not byte-identity – the coordinator RNG differs from the in-process loop’s). Inputs that already select the infinite-swapping sampler are excluded. A canonical path-sampling config that hits a scheduler PORT GAP (seescheduler_port_gap()) returnsFalsehere and is rejected with a clear error by the caller – it is NOT dispatched to the retired in-process loop. Only.tomlinputs are considered (a.rstinput is not a scheduler config).- Parameters:
inputfile (string) – Path to the input file.
- Returns:
boolean – True for a path-sampling
.tomlthe scheduler can run.
- pyretis.bin.pyretisrun.legacy_input_path_sampling_task(inputfile)[source]¶
Return the path-sampling task of a legacy (non-TOML) input, or None.
The scheduler routing predicates (
is_path_sampling_config(),is_infinite_swapping_config()) read.tomlinputs only, so a legacy.rstpath-sampling input skips them and would fall through to the retired in-process loop – crashing deep inPathSimulation.run()only after every ensemble output directory has already been created, with an error that names the very command the user just ran. The caller must instead translate such an input to its TOML twin (translate_legacy_input()) before routing, so the run proceeds through the scheduler like any canonical config.The settings are parsed exactly as
set_up_simulationparses them (defaults included: a no-defaults parse crashes in the shared_finalise_settingspost-processing for any input without asimulation/taskentry – the very task-less case this helper must survive), so a malformed input raises the same error from here that it would have raised there. The default task ismd, so a task-less legacy input keeps its in-process route.- Parameters:
inputfile (string) – Path to the input file.
- Returns:
string or None – The retired path-sampling task the legacy input selects, or
Nonewhen translation does not apply: a.tomlinput (the scheduler routing owns those), a missing file (set_up_simulationraises its own descriptive error), or a legacy input whose task still runs in-process (md/md-flux/make-tis-files/ …).
- 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.make_tis_files(_, settings, progress=False)[source]¶
Create TIS simulations input files PyRETIS.
- It just writes out input files for single TIS simulations and
exit without running a simulation.
- Parameters:
settings (list of dicts or Simulation objects) – The settings for the simulations.
- pyretis.bin.pyretisrun.remove_exit_file(exit_file)[source]¶
Remove the EXIT file after a completed soft exit.
- 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_infinite_swapping(inputfile)[source]¶
Run an infinite-swapping (replica-exchange) input via its scheduler.
This is the programmatic entry for the infinite-swapping sampler (the scheduler + config loader), run from the current working directory.
pyretisruncalls it for inputs that select infinite swapping, so it is the single way to drive that sampler.- Parameters:
inputfile (string) – Path to the infinite-swapping input TOML.
- pyretis.bin.pyretisrun.run_legacy_runner_config(inputfile, runpath)[source]¶
Run a legacy-runner config via the canonical-schema pipeline.
Reshapes the raw legacy-runner dict (
pyretis.inout.config_adapter.normalize_legacy_dialect()), parses the result through the same strict canonical-schema validator every hand-written canonical TOML goes through (pyretis.inout.settings.parse_settings_toml()), translates it (pyretis.inout.config_adapter.to_scheduler_config()), and hands the result to the unchanged scheduler viarun_infinite_swapping()– the same three-stage pipelinerun_pyretis_path_sampling()uses for canonical input, so both dialects now share one code path from this point on.A restart continuation is excluded from this: it is always invoked by pointing
-idirectly at the scheduler’s ownrestart.toml(never the original config –setup_configitself refuses a fresh input file alongside an existingrestart.toml), andrestart.tomlis already in the coordinator’s own shape, not a user-authored dialect needing translation.A config with an explicit
[simulation] ensemble_engines(a general multi-engine pool) is also excluded: it has no canonical-dialect equivalent, so it is handed straight torun_infinite_swapping(), which reads it untranslated viapyretis.simulation.setup.setup_config()(the only route that understands multi-engine pools).- Parameters:
inputfile (string) – Path to the legacy-runner input TOML.
runpath (string) – The directory the simulation runs from (where the intermediate canonical-shaped TOML and the final translated
infswap.tomlare written).
- 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_pyretis_path_sampling(inputfile, runpath)[source]¶
Run a canonical RETIS config through the infinite-swapping coordinator.
This is the opt-in compatibility route. It translates the canonical configuration to the coordinator’s config dictionary (
pyretis.inout.config_adapter.to_scheduler_config()) and generates the coordinator’sload_dirwhen requested. By default (method = "load", or"kick") this goes through the proven, sequential, single-process classic initiation (pyretis.inout.config_adapter.generate_load_dir()), unchanged. Opting into[initial-path] kick-parallel = true(withmethod = "kick"andkick-from = "initial", the default) instead routes through the parallel, engine-agnostic kick phase (pyretis.simulation.setup.run_kick_phase(), one job per ensemble across a worker pool) – proven so far only for engines that drive their kick search throughpropagate()/_propagate_from()(e.g. TurtleMD); internal engines’ ownkick_across_middleis not yet streaming-aware, sokick-parallelstays opt-in rather than the default until that gap is closed. It then writes the resolved config to the singleoutput.tomland hands it to the unchanged scheduler viarun_infinite_swapping().- Parameters:
inputfile (string) – Path to the canonical RETIS input TOML.
runpath (string) – The directory the simulation runs from (where
loadand the translatedoutput.tomlare written).
- pyretis.bin.pyretisrun.scheduler_port_gap(inputfile)[source]¶
Return the scheduler port-gap reason for a canonical path-sampling TOML.
A path-sampling task (tis/retis/explore/pptis/repptis) whose config the scheduler cannot yet run (see
scheduler_supported_features()) has NO execution path – the in-process loop is retired – so the caller must reject it with this reason rather than dispatch the retired loop. ReturnsNonefor inputs that are not path-sampling.tomltasks (md/md-flux/ a.rstinput / an infinite-swapping config), which run their normal route, andNonefor a canonical path-sampling config the scheduler does cover.- Parameters:
inputfile (string) – Path to the input file.
- Returns:
string or None – The first unsupported-feature reason, or
None.
- pyretis.bin.pyretisrun.scheduler_supported_features(config)[source]¶
Return
(supported, reason)for routing a canonical retis config.The infinite-swapping scheduler at
n_workers = 1faithfully reproduces the canonical RETIS loop for the kick- (or restart-) initialised internal-engine RETIS family with thesh/wt/wf/ssshooting moves (wf/ssvia the WHAMCxy/HAunweighting on the per-ensemble-output route). Several classic features are still scheduler PORT GAPS and must keep the in-process loop until they are ported, so this helper detects them and reports the first one found:shooting moves other than
sh/wt/wf/ss.the permeability
mirror(mirror_freq) andtargetswap (target_freq) moves route through the scheduler but only atn_workers = 1(both persist a global order-function mutation on accept).an
[initial-path] methodofloadfor non-explore tasks.a
[simulation] restartcontinuation.
- Parameters:
config (dict) – The parsed canonical TOML configuration.
- Returns:
(boolean, string) –
(True, '')when the scheduler faithfully covers the config;(False, reason)naming the first unsupported feature.
- 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, exe_dir=None)[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.
exe_dir (string, optional) – The path where EXIT file is expected.
- pyretis.bin.pyretisrun.store_simulation_settings(settings, indir, backup, ext='.rst')[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.
ext (string) – Extension for the regenerated settings dump. Matches the input file extension, so a
.tomlrun writesout.tomland a.rstrun writesout.rst. Defaults to.rstfor backwards compatibility.
- pyretis.bin.pyretisrun.translate_legacy_input(inputfile, task)[source]¶
Translate a legacy path-sampling input to its TOML twin and return it.
Path sampling runs only through the scheduler, which reads TOML, so a legacy
.rstinput is translated to<stem>.tomlwith the same round-trip-validated converter behindpython -m pyretis.tools.convert_settings. The legacy file is left untouched. If the twin already exists it is REUSED when it parses to the same raw settings as the legacy input (the run then behaves identically however it was invoked); a twin with DIFFERENT content is refused – two conflicting inputs for one run, and guessing which is the truth is exactly the kind of silent wrong answer this codebase forbids.- Parameters:
inputfile (string) – The legacy (non-TOML) input file.
task (string) – The path-sampling task it selects (for the log/error text).
- Returns:
string – The path of the TOML input to run instead.
pyretis.bin.pyretisclean module¶
pyretisclean - Remove the artifacts of a PyRETIS run.
This is the implementation behind pyretis tools clean. It deletes the
output a PyRETIS run leaves in a directory (logs, out.toml /
out.rst, restart files, the NNN ensemble directories, report,
byte-code caches, …), so an example or run directory can be reset to its
committed inputs. A per-directory clean.toml extends or overrides the
built-in defaults; see pyretis.inout.clean.
usage: pyretis tools clean [-h] [–dry-run] [directory]
The pieces are factored so both the canonical pyretis tools clean
sub-command (pyretis.bin.pyretistools) and the deprecated
pyretis clean alias share one argument definition and one runner.
- pyretis.bin.pyretisclean.add_clean_arguments(parser)[source]¶
Add the
cleanarguments to an argument parser.- Parameters:
parser (argparse.ArgumentParser) – The parser (or sub-parser) to extend with the
directorypositional and the--dry-runflag.- Returns:
argparse.ArgumentParser – The same parser, for convenience.
- pyretis.bin.pyretisclean.entry_point()[source]¶
Entry point for the deprecated
pyretis cleanalias.pyretis cleanstill works but is deprecated in favour ofpyretis tools clean; it prints a one-line notice and then runs.
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] [-f LOG_FILE] [-l LOG_LEVEL]
- 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
- pyretis.bin.pyretisanalyse._countered_report_name(reportfile, report_base, counter)[source]¶
Insert the archive counter before the cycle descriptor.
- pyretis.bin.pyretisanalyse._format_cycle_suffix(cycles)[source]¶
Return a file-name suffix for the number of analysed cycles.
- pyretis.bin.pyretisanalyse._latest_report_pattern(report_base, extension)[source]¶
Return a regexp matching uncountered latest report names.
- pyretis.bin.pyretisanalyse._next_report_counter(path, report_base, extension)[source]¶
Return the next free archive counter for a report family.
- pyretis.bin.pyretisanalyse._path_cycles(result)[source]¶
Return the cycle count from a path-ensemble analysis result.
- pyretis.bin.pyretisanalyse._report_base(report_type, prefix=None)[source]¶
Return the base name for a report without counter or cycles.
- pyretis.bin.pyretisanalyse._report_counter_pattern(report_base, extension)[source]¶
Return a regexp matching countered report archive names.
- pyretis.bin.pyretisanalyse._run_wham_analysis(run_dir, report_dir, nskip=0)[source]¶
Analyse infinite-swapping output (WHAM crossing probability).
- Parameters:
run_dir (string) – The run directory: either a literal
infswap_data.txtlives directly in it, or it holds the numbered per-ensemble output directories the matrix is reconstructed from – seepyretis.analysis.wham_analysis.get_path_data_matrix().report_dir (string) – Directory the
wham_analysis.txtreport is written to.nskip (int, optional) – Number of initial cycles (records) to discard as equilibration – the
skip_initial_cyclesanalysis setting. Defaults to 0.
- Returns:
int – 0 on success, 1 if the interfaces could not be read.
- pyretis.bin.pyretisanalyse.backup_latest_reports(reportfile, report_base)[source]¶
Back up uncountered reports from a report family.
- pyretis.bin.pyretisanalyse.completed_cycles(analysis_results)[source]¶
Return the number of cycles represented by an analysis result.
- pyretis.bin.pyretisanalyse.configure_file_logging(log_file, log_level)[source]¶
Add the analysis file logger and return the numeric log level.
- pyretis.bin.pyretisanalyse.create_pdf_report(texfile, pdflatex='pdflatex', report_base=None)[source]¶
Compile a LaTeX report to PDF if pdflatex is available.
- 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.entry_point_deprecated()[source]¶
Legacy
pyretisanalyseentry: warn, then runpyretis analyse.The standalone
pyretisanalysecommand is kept working for now but is deprecated in favour ofpyretis analyse; from PyRETIS 5 only the unified command will be supported. This wrapper emits that warning and then delegates toentry_point()unchanged.
- pyretis.bin.pyretisanalyse.get_report_name(report_type, ext, prefix=None, path=None, cycles=None, counter=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.
cycles (int, optional) – Number of completed cycles represented by the report.
counter (int, optional) – Archive counter to insert before the cycle descriptor.
- Returns:
out (string) – The name of the file written.
- pyretis.bin.pyretisanalyse.hello_world(infile, run_dir, report_dir, log_file=None)[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.
log_file (string, optional) – The output log file.
- 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, backup=True, report_base=None)[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.
backup (boolean, optional) – If True, back up an existing report before writing the new one.
report_base (string, optional) – Base report name used to back up the previous uncountered report.
- Returns:
out (string) – The name of the file written.
pyretis.bin.pyvisa module¶
pyvisa - 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:
pyvisa.py [-h] [-i INPUT] [-V] [-cmp] [-data DATA] [-recalculate]
[-oo] [-p] [-w N]
Optional arguments:
-cmp --pyvisa_compressor compress raw simulation output to a .hdf5 file.
-data --pyvisa-data select the data source (file or folder).
-h, --help show this help message and exit.
-i INPUT, --input INPUT location of PyRETIS input files
or PyVisA compressed file.
-oo --only_order use only data from order.txt files (faster).
-p, --progress show progress bars during recalculation.
-recalculate recalculate order parameter and cv data.
-V, --version show program's version number and exit.
-w N, --workers N number of parallel worker processes for
recalculation (default: all CPU cores).
Flags may be combined. Valid combinations include:
pyvisa -i out.rst -cmp # compress only
pyvisa -i out.rst -cmp -oo # compress, order files only
pyvisa -i out.rst -recalculate # recalculate only
pyvisa -i out.rst -recalculate -p # recalculate with progress
pyvisa -i out.rst -recalculate -w 4 # recalculate with 4 workers
pyvisa -i out.rst -recalculate -p -w 4 # recalculate, progress, 4 wk
pyvisa -i out.rst -recalculate -data 000 # recalculate one ensemble
pyvisa -i out.rst -recalculate -cmp # recalculate then compress
pyvisa -i out.rst -recalculate -cmp -oo # recalc then compress (oo)
pyvisa -i out.rst # open GUI
pyvisa -i out.rst -data 000 # open GUI with one ensemble
- pyretis.bin.pyvisa.entry_point()[source]¶
entry_point - The entry point for the pip install of pyretisanalyse.
- pyretis.bin.pyvisa.hello_pyvisa(run_dir, infile)[source]¶
Output a standard greeting for PyVISA.
- Parameters:
run_dir (string) – The location where we are executing the analysis.
infile (string) – String showing the location of the input file.
- pyretis.bin.pyvisa.main(basepath, input_file, pyvisa_dict=None)[source]¶
Run the analysis.
- Parameters:
basepath (string) – The execution folder where the input files are.
input_file (string) – The input file with settings for the analysis.
pyvisa_dict (dictionary, optional) –
It determines the section of pyvisa to use, it contains:
pyvisa_compressor, boolean If true, compress raw output to a .hdf5 file.
pyvisa_data, str If given, the file or folder containing the files that will be used to feed to PyVisA.
pyvisa_recalculate, boolean If true, use the recalculation tool to compute new op and cv values.
only_order, boolean If true, use only data from order.txt files when compressing.
Flags may be combined:
pyvisa_recalculateandpyvisa_compressorcan both be set to run recalculation followed by compression in a single invocation. If neither is set, the visualization GUI is launched.
- pyretis.bin.pyvisa.pyvisa_visual(basepath, input_file, pyvisa_dict)[source]¶
Load data to PyVisA.
- Parameters:
basepath (string) – The execution folder where the input files are.
input_file (string) – The input file with settings for the analysis.
pyvisa_dict (dictionary, optional) – It determines the section of pyvisa to use, it contains:
pyretis.bin.pyretistools module¶
pyretis tools - auxiliary PyRETIS tools.
Dispatches the pyretis tools <tool> sub-commands:
pyretis tools init -i input.toml # auto-place the interfaces
pyretis tools clean [directory] # remove a run's artifacts
pyretis tools init runs the iterative infinit driver to place the
TIS/RETIS interfaces automatically – it repeatedly runs a short
infinite-swapping simulation, re-estimates the crossing probability with
WHAM, and re-places the interfaces so every ensemble carries roughly the
same local crossing probability (see
pyretis.tools.interface_optimizer.run_infinit()).
pyretis tools clean removes the output a run leaves in a directory so
it can be reset to its committed inputs (see
pyretis.bin.pyretisclean / pyretis.inout.clean).
- pyretis.bin.pyretistools.build_parser()[source]¶
Build the argument parser for
pyretis tools.- Returns:
argparse.ArgumentParser – The parser with one sub-parser per available tool.