Skip to main content

Python binding to Donuts

Project description

PyPI version Test Documentation Status

Python binding to the Donuts wrapper for the Rings library by Stanislav Poslavsky.

Requirements

  • Python 3.7 or later

  • Java 8 or later

Installation

pip install 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

git submodule update --init
poetry install
poetry run invoke prepare

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
DONUTS_PYTHON_BACKEND=jpype   poetry run invoke test

poetry run invoke build --sdist --wheel

Acknowledgements

This software was developed as part of the project supported by JSPS KAKENHI Grant Number 19K03831.

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.5.tar.gz (95.4 kB view hashes)

Uploaded Source

Built Distribution

donuts_python-0.0.5-py3-none-any.whl (1.4 MB view hashes)

Uploaded Python 3

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