Skip to main content

Core library for Seldonian algorithms

Project description

Disclaimer: This repository is under active development and is not yet suitable for public use. We are currently working on an alpha release and will remove this disclaimer at the time of release.

Engine

This is the source code repository for a framework for creating and running Seldonian algorithms.

Installation

To run this code as a developer, create a virtual environment. Then install the package locally, e.g.

python setup.py develop

or

pip install -e .

If you want to view the parse tree graphs using the built-in tools this library provides, install graphviz onto your system. The Seldonian library uses a Python API for graphviz, and the API requires that graphviz be installed system-wide. This should resolve mysterious error messages like "dot" not found. "dot" is a command line program included with graphviz for rendering the graphs from code.

Interface

This library is in its infancy, but a lite command line interface exists for parsing string expressions into parse trees. To use this interface, edit the file: interface.py. Modify constraint_str and delta to values of interest. Then run (make sure you have activated the seldo conda environment first) from the command line:

python interface.py

As a quick test, if you use the following variables:

constraint_str = 'abs((Mean_Error | [M]) - (Mean_Error | [F])) - 0.1'
delta = 0.05

The resulting diagram should match this one, although the actual intervals may be different due to the random seeding of the base variable intervals.

Testing

To run the unit tests, from the command line do:

pytest

This will automatically run all tests in tests/. Currently, there is only one test file in this folder, called test_parse_tree.py. Pytest will find that file and run all tests within that file.

To get more introspection into the tests see the Pytest documentation.

Versioning

The naming of versions of this software adheres to semantic versioning. Pre-release versions use a major version of "0", e.g. "0.0.1" is the very first pre-release version.

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

test-engine-0.0.1.tar.gz (10.3 kB view hashes)

Uploaded Source

Built Distribution

test_engine-0.0.1-py3-none-any.whl (10.4 kB view hashes)

Uploaded Python 3

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