Skip to main content

General Equation Parser and Evaluator

Project description

https://travis-ci.org/alphaomega-technology/Equation.svg?branch=v1.2.01

Equation Interpeter

The Equation Package provide an extentable Equation Parser and Evaluation System.

It will take a string such as “sin(x+y^2)” and convert it to a python object that can be called this allow the safe evaluation of equations stored in configuration files or enterned from the keyboard. This Package never calls a python evaluation command hence their is no risk of executing any unexpected python code.

The Generated Expression Object is desgined to behave like a python function, and can be used any where a python funcion is expected, it may be called with either positional or keyword arguments to set the Equations Variables, by default the order of the variables is as they appear in the equation, however an explicit order may be set when the Expression object is created.

Example

>>> from Equation import Expression
>>> fn = Expression("sin(x+y^2)",["y","x"])
>>> fn
sin((x + (y ^ (2+0j))))
>>> print fn
\sin\left(\left(x + y^{(2+0j)}\right)\right)
>>> fn(3,4)
(0.42016703682664092+0j)

Numpy Arrays Supported

The default function maping used by this package map the operators and functions to Numpy Functions, hence the generated object may be called with numpy arrays.

Latex Support

The display string format i.e. str() is set to use Latex syntax allowing high quality equations to be rendered in output this syntax is supported by the grqaphing package matplotlib

Future Versions

Goals for future versions are:

  • Reduce repr() type respresentation to use only required brackets

  • Allow the use of function variable, rather than just predefined functions

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

Equation-1.2.01.zip (25.6 kB view details)

Uploaded Source

Equation-1.2.01.tar.gz (17.7 kB view details)

Uploaded Source

Built Distributions

Equation-1.2.01.win32.exe (255.8 kB view details)

Uploaded Source

Equation-1.2.01-py2.7.egg (139.5 kB view details)

Uploaded Source

File details

Details for the file Equation-1.2.01.zip.

File metadata

  • Download URL: Equation-1.2.01.zip
  • Upload date:
  • Size: 25.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Equation-1.2.01.zip
Algorithm Hash digest
SHA256 1e8d55e771ac18f33fcef5bdb126e4079fd42ce744ae915cd03760aab158260c
MD5 c3ce52393e287f67edc91c07954de151
BLAKE2b-256 2ecc115fb1722051f99b9699864586e7f96ca0080645387698af922fade4f7b2

See more details on using hashes here.

File details

Details for the file Equation-1.2.01.tar.gz.

File metadata

  • Download URL: Equation-1.2.01.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Equation-1.2.01.tar.gz
Algorithm Hash digest
SHA256 c8a21dc47d6c748fd19b6485978cf8c42fe31c43db7f44789d95fb5e9752b81c
MD5 5285f149d0de4e3f033acdb91421f348
BLAKE2b-256 fd0dede829e7c0c457b651de2792cd19a739e4885477f59832da54d2cc7a1982

See more details on using hashes here.

File details

Details for the file Equation-1.2.01.win32.exe.

File metadata

File hashes

Hashes for Equation-1.2.01.win32.exe
Algorithm Hash digest
SHA256 e066d131244e612e760ee0227a57e57285a55c35ae896fecc4e8cb847935ec61
MD5 e4c96f5071266e071666a6cf34614f58
BLAKE2b-256 d75d650fdf8b75d01638a1fe5761669d321a83ee42dd5503bdc6b9c7cfb42169

See more details on using hashes here.

File details

Details for the file Equation-1.2.01-py2.7.egg.

File metadata

File hashes

Hashes for Equation-1.2.01-py2.7.egg
Algorithm Hash digest
SHA256 8903160860fbef8b313a9d89ffff2cb4048a341f369b1c48086c4505eee7eb4d
MD5 05f5fe02b63bc4f49d6e485e3cf1fba5
BLAKE2b-256 87551f695ef18a0f8192a92ba1555a583ca66defb3894354def95bfa24c4dfb9

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