Skip to main content

Unified wrapper over symbolic manipulation libraries in Python.

Project description

Build status PyPI version Python version License airspeedvelocity coverage

sym provides a unified wrapper to some symbolic manipulation libraries in Python. It makes it easy for library authors to test their packages against several symbolic manipulation libraries.

Currently the following Python pacakges are available as “backends”:

The capabilities exposed here are those needed by

and include:

  • Differentiation

  • Numerical evaluation (including “lambdify” support)

see tests for examples. Note that pyodesys and pyneqsys also act as test suits for this package.

Documentation

Autogenerated API documentation is found here: https://pythonhosted.org/sym (and dev docs are here: http://hera.physchem.kth.se/~sym/branches/master/html).

Installation

Simplest way to install sym and its (optional) dependencies is to use pip:

$ pip install --user sym pytest
$ python -m pytest --pyargs sym

or the conda package manager:

$ conda install -c bjodah sym pytest
$ python -m pytest --pyargs sym

Source distribution is available here: https://pypi.python.org/pypi/sym

Example

Differentiation

>>> from sym import Backend
>>> be = Backend('pysym')  # just an example, use SymPy rather than pysym
>>> x, y = map(be.Symbol, 'x y'.split())
>>> expr = x*y**2 - be.tan(2*x)
>>> print(expr.diff(x))
((y**2) - ((1 + (tan((2*x))**2))*2))

for more examples, see examples/, and rendered jupyter notebooks here: http://hera.physchem.kth.se/~sym/master/examples

License

The source code is Open Source and is released under the simplified 2-clause BSD license. See LICENSE for further details. Contributors are welcome to suggest improvements at https://github.com/bjodah/sym

Author

Björn I. Dahlgren, contact:

  • gmail address: bjodah

  • kth.se address: bda

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

sym-0.1.7.tar.gz (12.1 kB view details)

Uploaded Source

File details

Details for the file sym-0.1.7.tar.gz.

File metadata

  • Download URL: sym-0.1.7.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sym-0.1.7.tar.gz
Algorithm Hash digest
SHA256 d9ac7b052d675df670f3e530f381a85d62d34834d7e11005653261d79835cdb6
MD5 a0673db398c09d770d250eb55b0b81f2
BLAKE2b-256 cf9f5887d0afd7182d856046a468af7d2f8ff1ee7ab943ca97fceb07e66c9d38

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