Skip to main content

Python interface for the Cephes library.

Project description

PyPIl PyPIv Anaconda-Server Badge Documentation Status

This package provides a python interface for the Cephes library. It also supports Numba and its nopython mode.

Usage

from ncephes import cprob
print(cprob.incbet(1., 3., 0.3))

prints 0.657.

You can also call them inside a numba function

from ncephes import cprob
from numba import jit

@jit
def numba_incbet(a, b, x):
    return cprob.incbet(a, b, x)

print(numba_incbet(1., 3., 0.3))

and with nopython mode and nogil enabled

from ncephes import cprob
from numba import jit

incbet = cprob.incbet

@jit(nogil=True, nopython=True)
def numba_incbet(a, b, x):
    return incbet(a, b, x)

print(numba_incbet(1., 3., 0.3))

One can also statically link the compiled Cephes libraries ncprob and ncellf. Please, have a peek at the examples/prj_name for a minimalistic example.

Install

The recommended way of installing it is via conda

conda install -c conda-forge ncephes

An alternative way would be via pip

pip install ncephes

Running the tests

After installation, you can test it

python -c "import ncephes; ncephes.test()"

as long as you have pytest.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

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

ncephes-1.0.15.tar.gz (181.7 kB view details)

Uploaded Source

File details

Details for the file ncephes-1.0.15.tar.gz.

File metadata

  • Download URL: ncephes-1.0.15.tar.gz
  • Upload date:
  • Size: 181.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ncephes-1.0.15.tar.gz
Algorithm Hash digest
SHA256 c75b05cabe71ca3e2283178d9ddc5159bd2fb3993bbcbcabb1c840433454f380
MD5 1145feacbbcae6b0b208f7be4fc6dfa3
BLAKE2b-256 54e029db6e3e80583a6d57e244cb1d7bd1648666e7298574dcf2bc9c8331d0c5

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