Skip to main content

PyExperimentSuite is an open source software tool written in Python, that supports scientists, engineers and others to conduct automated software experiments on a larger scale with numerous different parameters

Project description

Python Experiment Suite

PyExperimentSuite is an open source software tool written in Python, that supports scientists, engineers and others to conduct automated software experiments on a large scale with numerous different parameters.

It reads parameters (or ranges of parameters) from a configuration file, runs the experiments using multiple cores if desired and logs the results in files. Parameter combinations can be evaluated as a grid (each combination of parameters) or in a list (try several defined parameter combinations in row). PyExperimentSuite also supports continuing any experiments where left off when the execution was interrupted (e.g. power failure, process was killed, etc.). The experiment results can be obtained in different ways by a built-in Python interface.

For more information, see the documentation for instructions.

Installation

Install the expsuite package via pip:

pip install expsuite

Basic Usage Example

Create a new Python file (e.g. suite.py) and define a class that inherits from PyExperimentSuite. Within the class, implement the two methods reset() and iterate(). Also add the main script execution code at the bottom (last 3 lines below).

from expsuite import PyExperimentSuite

class MySuite(PyExperimentSuite):
    def reset(self, params, rep):
        """for this basic example, nothing needs to be loaded or initialized."""
        pass

    def iterate(self, params, rep, n):
        """this function does nothing but access the two parameters alpha and
        beta from the config file experiments.cfg and returns them for the
        log files, together with the current repetition and iteration number.
        """
        # access the two config file parameters alpha and beta
        alpha = params["alpha"]
        beta = params["beta"]

        # return current repetition and iteration number and the 2 parameters
        ret = {"rep": rep, "iter": n, "alpha": alpha, "beta": beta}
        return ret


if __name__ == "__main__":
    mysuite = MySuite()
    mysuite.start()

You also need an experiment config file. Create a second file experiments.cfg and add the following content:

[DEFAULT]
repetitions = 5
iterations = 10
path = results

[myexperiment]
alpha = 1
beta = 0.1

Now call the script with python suite.py.

It will have generated a local ./results directory with one subdirectory myexperiment (the only experiment we defined in the config file). In this directory, you find 5 log files (#.log where # goes from 0 to 4) and another experiments.cfg file specific to this experiment.

For more examples, see the examples folder.

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

expsuite-0.1.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

expsuite-0.1.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file expsuite-0.1.1.tar.gz.

File metadata

  • Download URL: expsuite-0.1.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.1 importlib-metadata/4.10.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9

File hashes

Hashes for expsuite-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8d5cef3ad2873581fd89a7b07efd0eae904df8e6e337c70f821f501676b746f9
MD5 e0cc6e5561738fb7e7cddd5e7875241f
BLAKE2b-256 0e91dfc10979905b3f5ea76fb5ef5555e5fb640989f70b5b5702de2f45b6f7a9

See more details on using hashes here.

File details

Details for the file expsuite-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: expsuite-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.1 importlib-metadata/4.10.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9

File hashes

Hashes for expsuite-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a45c5021288a5f8dbc819465bae7e80c8870c3359f914c89a2677662ed091994
MD5 f4debb4a85472217b0c538f8e470899f
BLAKE2b-256 4ebffc846c7e864ba70bf95b82a7deb9ecfb9d3446a7ca618985c5888f6e7a55

See more details on using hashes here.

Supported by

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