Python binding to Donuts
Project description
Python binding to the Donuts wrapper for the Rings library by Stanislav Poslavsky.
Requirements
Python 3.7 or later
JDK 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
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:
Donuts (MIT)
Rings (Apache 2.0)
libdivide4j (Apache 2.0)
Combinatorics for Java (Apache 2.0)
Apache Commons Math (Apache 2.0)
GNU Trove (LGPL 2.1)
Project details
Release history Release notifications | RSS feed
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.1rc2.tar.gz
(102.8 kB
view hashes)