JuliaPy / JuliaPy/PyCall.jl

gmpy2 support

Offen
#104 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Julia
Sterne
1.5k
Forks
186
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Currently, PyCall uses strings as the interchange mechanism for `BigFloat` and `BigInt`. This is suboptimal from a performance perspective and also potentially lossy in the case of `BigFloat`.

However, the `gmpy2` module for Python provides a Python interface to GNU MP/MPFR numbers (the same as Julia), and it should be possible (with suitable digging) to pass Julia bignums to Python in binary form (and potentially without making a copy). (Furthermore, when the `gmpy2` module is available in Python, the `mpmath` module automatically uses it anyway, so we might as well take advantage of it for `BigFloat` conversions if it is present.)

I'm not sure if anyone actually cares about better bignum interoperability with Python, though?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

No files, tests, or entry points are named. Investigate PyCall's existing BigFloat and BigInt string-conversion paths, then determine whether gmpy2 can provide binary or zero-copy interoperability without loss; done means the supported conversions are implemented and covered by relevant tests.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
julia, python
Bereich
backend-api-design, tooling
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
20/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.