Skip to main content

Donuts-Python

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:

Metadata

Release files for donuts-python 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for donuts-python 0.0.5
File Size Uploaded
donuts_python-0.0.5.tar.gz 95.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for donuts-python 0.0.5
File Interpreter ABI Platform
donuts_python-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 1.5 MB

Release files / donuts_python-0.0.5.tar.gz

Download URL donuts_python-0.0.5.tar.gz
Size 95.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8756dbead2a46b2eb544281644d0777ce4df19a9888165a9b5d94cdf43794611
BLAKE2b-256 checksum
How to use checksums
3559207c872960bb6144c949592e873f29be7f7d1d073451f8c10faf37062d81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1019-azure

Release files / donuts_python-0.0.5-py3-none-any.whl

Download URL donuts_python-0.0.5-py3-none-any.whl
Size 1.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
034af989c3b6b9f37dc1af5a4db84156f80bb4b84e4f6b9ac2986fee671268f7
BLAKE2b-256 checksum
How to use checksums
8644b0f48588b64f9ae285e871025dd4253b9b405572131f54bb7d48e8016c7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1019-azure

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page