Giter VIP home page Giter VIP logo

donuts-python's People

Contributors

tueda avatar

Stargazers

 avatar

Watchers

 avatar  avatar

donuts-python's Issues

ValueError in int <-> str conversions

In complicated systems, it is often the case that fixing your bug causes a new bug for others. The latest CPython bugfix releases have introduced a breaking change in conversions between large integers and strings. So far, no alternate API has been provided except for changing global settings (which is not appropriate for libraries).

There are at least 3 places in this library affected by this change.

self._raw = _RawPolynomial(str(value))

python -c 'import donuts; donuts.Polynomial(10**4300)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.10/site-packages/donuts/poly.py", line 74, in __init__
    self._raw = _RawPolynomial(str(value))
ValueError: Exceeds the limit (4300) for integer string conversion

return int(str(self))

python -c 'import donuts; (donuts.Polynomial(10)**4300).as_integer'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.10/site-packages/donuts/poly.py", line 266, in as_integer
    return int(str(self))
ValueError: Exceeds the limit (4300) for integer string conversion: value has 4301 digits

self._raw = _RawRationalFunction(str(numerator))

python -c 'import donuts; donuts.RationalFunction(10**4300)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.10/site-packages/donuts/rat.py", line 64, in __init__
    self._raw = _RawRationalFunction(str(numerator))
ValueError: Exceeds the limit (4300) for integer string conversion

Support for JDK 21

As far as I can see, upgrading donuts to 0.0.5 (which uses Gradle 8.5) must do the job, but the CI somehow failed: https://github.com/tueda/donuts-python/actions/runs/7355273433.

      * What went wrong:
      Execution failed for task ':donuts-python:compileJava'.
      > java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid'

The error looks like the already-fixed Lombok bug:

but donuts 0.0.5 uses Lombok 1.18.30, so it must not occur...

Support for Python 3.12

Locally it seems to work (except lint due to csachs/pyproject-flake8#30), but the CI failed: https://github.com/tueda/donuts-python/actions/runs/7347713849.

py312: commands[0]> pytest --benchmark-disable
  ImportError while loading conftest '/home/runner/work/donuts-python/donuts-python/tests/conftest.py'.
  tests/conftest.py:8: in <module>
      from donuts import Polynomial, RationalFunction
  .tox/py312/lib/python3.12/site-packages/donuts/__init__.py:5: in <module>
      from .poly import Polynomial, gcd, lcm, product
  .tox/py312/lib/python3.12/site-packages/donuts/poly.py:20: in <module>
      from .array import _create_raw_int_array, _create_raw_poly_array, _create_raw_var_array
  .tox/py312/lib/python3.12/site-packages/donuts/array.py:7: in <module>
      from .jvm import jvm
  .tox/py312/lib/python3.12/site-packages/donuts/jvm.py:6: in <module>
      import pkg_resources
  E   ModuleNotFoundError: No module named 'pkg_resources'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.