Skip to main content

the cython-based fractions system used for td2inner(an internal part of timediffz)

Project description

fractionalstd2inner

A high-performance Cython + GMP, very basic and custom implementation of Python’s built-in fractions library.
It is ~1.5× to 4× faster than the standard Python implementation and was made to be used internally by
td2inner.

⚠️ This package must be compiled locally.
No prebuilt wheels are provided.


⚠️ Important Notice (Read This First)

fractionalstd2inner contains a native Cython extension that depends on
GMP (GNU Multiple Precision Arithmetic Library).

Because of this:

  • No prebuilt wheels
  • Development tools are required
  • Compilation occurs during pip install

This is intentional.


🧩 Requirements

General

  • Python ≥ 3.10
  • C / C++ compiler
  • Cython ≥ 3.2
  • GMP development headers

INSTALLMENT STEPS

1 INSTALL DEPENDENCIES ASSUMING YOU ALREADY HAVE PYTHON AND PIP

Arch Linux

sudo pacman -S gmp base-devel cython

Ubuntu/Debian/Mint

sudo apt update
sudo apt install -y libgmp-dev build-essential python3-dev cython3

Fedora

sudo dnf install -y gcc gcc-c++ make automake gmp-devel python3-devel cython

CentOS/ RHEL

sudo yum groupinstall "Development Tools" -y
sudo yum install -y gmp-devel python3-devel cython

openSUSE

sudo zypper install -y gcc gcc-c++ make gmp-devel python3-devel cython

Windows(YOU NEED TO DOWNLOAD MSYS2) THEN

pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-gmp mingw-w64-x86_64-python3-cython

MacOS(YOU NEED TO DOWNLOAD Homebrew(brew)) THEN

xcode-select --install
brew install gmp cython python

2 INSTALL THE LIBRARY ITSELF VIA PIP

python3 -m pip install fractionalstd2inner

3 VERIFY INSTALLATION VIA

python3 -c "import fractionalstd2inner; print(fractionalstd2inner.__version__)"

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

fractionalstd2inner-1.0.6.tar.gz (102.6 kB view details)

Uploaded Source

File details

Details for the file fractionalstd2inner-1.0.6.tar.gz.

File metadata

  • Download URL: fractionalstd2inner-1.0.6.tar.gz
  • Upload date:
  • Size: 102.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for fractionalstd2inner-1.0.6.tar.gz
Algorithm Hash digest
SHA256 56e9d94d6edb7a67c40faa081567506d91daba9cc56e2a4dcd3b1acf91cf7691
MD5 3cdef41fcf3d6970f560c35ff10cfe4a
BLAKE2b-256 f86843d26ebfbaed70ed40a8adcf34c3d35dba9b648496ce516571227027072d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page