Skip to main content

A library for quickly applying symbolic expressions to NumPy arrays

Project description

expressive

A library for quickly applying symbolic expressions to NumPy arrays

Inspired in part by this Stack Overflow Question Using numba.autojit on a lambdify'd sympy expression

installation

via pip https://pypi.org/project/expressive/

pip install expressive

usage

refer to tests for examples for now

generally follow a workflow like

  • create instance expr = Expressive("a + log(b)")
  • build instance expr.build(sample_data)
  • instance is now callable expr(real_data)

The data should be provided as dict of NumPy arrays

data = {
    "a": numpy.array(range(1_000_000), dtype="int64"),
    "b": numpy.array(range(1_000_000), dtype="int64"),
}

testing

install dependencies

Only docker and compose (v2?) are required (used to generate the test environment)

sudo apt install docker.io docker-compose-v2

run tests

Just directly run the test script from the root of the repository, it will build the docker test environment and run itself inside it automatically

./test/runtests.sh

contributing

Please refer to CONTRIBUTING.md and LICENSE.txt

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

expressive-1.1.0.tar.gz (13.5 kB view hashes)

Uploaded Source

Built Distribution

expressive-1.1.0-py3-none-any.whl (12.1 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