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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file donuts_python-0.0.5.tar.gz.

File metadata

  • Download URL: donuts_python-0.0.5.tar.gz
  • Upload date:
  • Size: 95.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1019-azure

File hashes

Hashes for donuts_python-0.0.5.tar.gz
Algorithm Hash digest
SHA256 8756dbead2a46b2eb544281644d0777ce4df19a9888165a9b5d94cdf43794611
MD5 b4b6655354ab5b9e046816f0410ceda6
BLAKE2b-256 3559207c872960bb6144c949592e873f29be7f7d1d073451f8c10faf37062d81

See more details on using hashes here.

File details

Details for the file donuts_python-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: donuts_python-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1019-azure

File hashes

Hashes for donuts_python-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 034af989c3b6b9f37dc1af5a4db84156f80bb4b84e4f6b9ac2986fee671268f7
MD5 175dc68bb94e8ee5b467d424beb054c3
BLAKE2b-256 8644b0f48588b64f9ae285e871025dd4253b9b405572131f54bb7d48e8016c7d

See more details on using hashes here.

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