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
The development process is currently private (though most fruits are available here!), largely due to this being my first public project with the potential for other users than myself, and so the potential for more public gaffes is far greater
Please refer to CONTRIBUTING.md and LICENSE.txt and feel free to provide feedback, bug reports, etc. via Issues, subject to the former
additional future intentions for contributing
- improve internal development history as time, popularity, and practicality allows
- move to parallel/multi-version/grid CI over all-in-1, single-version dev+test container
- greatly relax dependency version requirements to improve compatibility
version history
v1.2.1
- add more detail to contributing block
- switch array dimensions checking from
.shape
to.ndim
- switch tests from
numpy.array(range())
tonumpy.arange()
v1.2.0
- enable autobuilding (skip explicit
.build()
call) - basic display support for
Expressive
instances
v1.1.1
- add version history block
v1.1.0
- fixed bug: signature ordering could be unaligned with symbols, resulting in bad types
- added support for non-vector data arguments
v1.0.0
- completely new code tree under Apache 2 license
- basic support for indexed offsets
v0.2.0 (unreleased)
v0.1.0
- very early version with support for python 3.5
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.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53292c6d802c07b4fcab577fcc22a47041c1720f9d7b40d380f8ef7ead678862 |
|
MD5 | ab354bc8b28b73da1d8b21c92ffbf6fc |
|
BLAKE2b-256 | 3f370641c9b14072c3db780df934d14abd427f81f1fdc71ce829da90a3a01625 |