pestifer.scripters.packmol module

class pestifer.scripters.packmol.PackmolScripter(*args, **kwargs)[source]

Bases: GenericScripter

This class extends the GenericScripter class to provide functionality for creating and managing Packmol scripts.

log_error_patterns = (re.compile('\\bERROR\\b'), re.compile('Could not open file'), re.compile('Could not find'))
newscript(basename=None)[source]

Create a new Packmol input script.

Parameters:

basename (str, optional) – The base name for the script file (without extension). If not provided, a default name will be used.

runscript(*args, **options)[source]

Run the Packmol script using the specified shell command. This method constructs a command to execute Packmol with the specified script and options. After packmol exits, the log is scanned for error markers; if any are found a non-zero code is returned so callers raise.

writescript()[source]

Write the Packmol input script to the file specified in the scriptname attribute.

pestifer.scripters.packmol.check_packmol_version(executable, min_version=(20, 15, 1))[source]

Raise RuntimeError if executable’s reported version is below min_version. Returns the detected version tuple on success.

pestifer.scripters.packmol.get_packmol_version(executable)[source]

Probe executable by sending it an empty stdin and parse the version banner. Returns a (major, minor, patch) tuple, or None if the banner cannot be parsed.