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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for expressive-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad93ce4213678eb55b222fcffe70064cebc3ae102bebd8c2a2dfb14089f4986a |
|
MD5 | d45a7e7c8bb543e0111233eb3de8bd2c |
|
BLAKE2b-256 | c2bd7cab90d9b2ac5ae009f62af943b2ca6c8991b364edfe28ebe7bc7c5d4a18 |