Skip to main content

Python binding to Donuts

Project description

Python binding to the Donuts wrapper for Rings.

Requirements

  • Python 3.7 or later

  • JDK 8 or later

Installation

pip install git+https://github.com/tueda/donuts-python

Example

>>> from donuts import *
>>> a = Polynomial('1 + x + y')
>>> b = Polynomial('1 + y + z')
>>> g = a + b
>>> g
Polynomial('2+z+2*y+x')
>>> ag = a * g
>>> bg = b * g
>>> ag.gcd(bg)  # must be equal to g
Polynomial('2+z+2*y+x')
>>> ag / bg  # same as RationalFunction(ag, bg)
RationalFunction('(1+y+x)/(1+z+y)')
>>> Polynomial('2*x^2 - 2*x^3 + 2*x^2*y - 2*x^3*y').factors
(Polynomial('-2'), Polynomial('x'), Polynomial('x'), Polynomial('-1+x'), Polynomial('1+y'))

Development

poetry install
poetry run pre-commit install
poetry run pre-commit install --hook-type commit-msg

git submodule update --init
poetry run invoke build

poetry run invoke fmt
poetry run invoke lint
poetry run invoke test
poetry run invoke bench
poetry run invoke doc

DONUTS_PYTHON_BACKEND=pyjnius poetry run invoke test
DONUTS_PYTHON_BACKEND=py4j    poetry run invoke test

poetry run pip install wheel
poetry run invoke build --sdist --wheel

License

Donuts-Python is distributed under the MIT license.

The wheel contains a fat JAR file generated from the following dependencies:

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

donuts-python-0.0.1rc1.tar.gz (174.7 kB view hashes)

Uploaded Source

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