sweetpea.core.generate.tools.unigen module

This module provides functionality for calling the third-party Unigen tool.

Unigen is a state-of-the-art, almost-uniform SAT sampler that uses CryptoMiniSAT to solve SAT problems. SweetPea uses Unigen for a few processes.

exception sweetpea.core.generate.tools.unigen.UnigenError(returncode, stdout, stderr)

Bases: sweetpea.core.generate.tools.tool_error.ToolError

An error raised when Unigen fails.

Parameters
  • returncode (int) –

  • stdout (str) –

  • stderr (str) –

sweetpea.core.generate.tools.unigen.call_unigen(sample_count, input_file, docker_mode=False, download_if_missing=True)

Calls Unigen with the given file as input.

If docker_mode is True, this will use a Docker container to run Unigen. If it’s False, a command-line executable will be used.

If docker_mode is False and no local Unigen executable can be found, and if download_if_missing is True, the needed executable will be automatically downloaded if it’s missing.

Parameters
Return type

str