Skip to main content

General Equation Parser and Evaluator

Project description

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

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.zip (25.5 kB view details)

Uploaded Source

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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

Equation-1.2.win32.exe (228.3 kB view details)

Uploaded Source

Equation-1.2-py2.7.egg (70.0 kB view details)

Uploaded Egg

File details

Details for the file Equation-1.2.zip.

File metadata

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

File hashes

Hashes for Equation-1.2.zip
Algorithm Hash digest
SHA256 ccd41aa85f3a2f6226ec2db8e255fed92eca91c3fe2a736cdf732abae4c91619
MD5 dc2f137af06459aa6972aae3d5378a92
BLAKE2b-256 df927a7d9af5f416d8dd78408ccb21d74f88dc9686146d1c1f9b85ae835e5774

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for Equation-1.2.tar.gz
Algorithm Hash digest
SHA256 40c5b76a9163672a7e86fa1a477d1a00d305f19199a9a49af40bdc243bd1effa
MD5 40ef34c1ca4caa6e8509c9f3cc895dae
BLAKE2b-256 9d7017c0cad06831c1c75863591af8550b3c0600f17785d7ba577dc0f82baa4f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Equation-1.2.win32.exe
  • Upload date:
  • Size: 228.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Equation-1.2.win32.exe
Algorithm Hash digest
SHA256 d61c78826acf4fd65b389dbac3b76671b5248ce9200e8ca9cc8d5b9f40e4671e
MD5 8a21484606c911860f81451c3db9dfbe
BLAKE2b-256 1d2c8701fd233485fdda377ce7a41f7feb33a42ae657fe27783a77137024716e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Equation-1.2-py2.7.egg
  • Upload date:
  • Size: 70.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Equation-1.2-py2.7.egg
Algorithm Hash digest
SHA256 ec56a5a025785e694a49d74f14b518781277413bde30c874bfbff3c520a9aba9
MD5 d1d82fff701e8027396c35a632c47d3e
BLAKE2b-256 30a330b1b42432ba36d112b2fb35fe4d66ca10bc5653504430b102b9ecc88cba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page