Skip to main content

A language for synthesizing randomized experimental designs

Project description

SweetPea

Build Status
typecheck
acceptance (fast)
acceptance (slow)
package

SweetPea is a domain-specific language for specifying factorial experimental designs and synthesizing trial sequences from those design specifications. An explanation of factorial experimental designs and how to build and manipulate them in SweetPea can be found in the SweetPea Guide.

SweetPea includes a synthesizer to generate unbiased sequences of trials that satisfy the design's constraints. In the most general case, SweetPea compiles an experimental design into a boolean satisfiability formula that is passed to a SAT sampler.

Currently, SweetPea uses the Unigen SAT sampler. Unigen provides statistical guarantees that the solutions it finds are approximately uniformly probable in the space of all valid solutions. Unfortunately, sampling this way is not tractable for all designs that can be expressed with SweetPea, and improving sampling strategies is a primary direction for ongoing work.

Disclaimer

SweetPea is still under active development, and therefore the interface and API may change. Please use with caution!

Dependencies

SweetPea requires Python 3.7.9 or later.

Installation

There are two ways to install SweetPea: from the Python Package Index (PyPI), or from source.

Installing from PyPI

SweetPea can be installed from PyPI via pip:

$ pip install sweetpea

This version may lag behind the current development version.

Installing from Source

To get the most up-to-date version of SweetPea, clone this repository, install SweetPea's dependencies, and install SweetPea itself:

$ git clone https://github.com/sweetpea-org/sweetpea-py.git
$ cd sweetpea-py
$ pip install -r requirements.txt
$ pip install .

:exclamation: Important!

The pip install . command installs SweetPea locally, but it will not automatically check for updates. If you intend to manually update your local copy of SweetPea, you should instead do pip install -e . to tell pip to use the source dynamically.


Examples

There are example programs in the example_programs directory, and there is a detailed explanation of how to use SweetPea in the SweetPea Guide.

API Documentation

The SweetPea API is documented in the API section of the SweetPea Guide.

Contributing

Information on how to contribute to SweetPea's development can be found in the Contributing section of the SweetPea Guide.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sweetpea-0.1.0.tar.gz (91.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sweetpea-0.1.0-py3-none-any.whl (123.2 kB view details)

Uploaded Python 3

File details

Details for the file sweetpea-0.1.0.tar.gz.

File metadata

  • Download URL: sweetpea-0.1.0.tar.gz
  • Upload date:
  • Size: 91.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.10

File hashes

Hashes for sweetpea-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2adab5f5b3230e0562809e71245b180d842a53b0ff9637105a5dbca85f34ecdd
MD5 7a312513916fd11baae4aa023175a6e5
BLAKE2b-256 176cd1592167598d9285d90d5feb79dbc0d9550e1f60310fd77767d9b1fd0dcd

See more details on using hashes here.

File details

Details for the file sweetpea-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sweetpea-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 123.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.10

File hashes

Hashes for sweetpea-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a801744ba0d643faf82e7c5f0f5428a21665ebd03e8b7a00ec59cc174a5c0e30
MD5 614dbbfc879de81d55f98109ad3a42a1
BLAKE2b-256 7473befc8d378e75e74b71197c03e73d61bd4c48d6dd3802f22b6fe3f23ded23

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page