https://github.com/limix/ncephes
Python interface for the Cephes library.
https://github.com/limix/ncephes
Last synced: 6 months ago
JSON representation
Python interface for the Cephes library.
- Host: GitHub
- URL: https://github.com/limix/ncephes
- Owner: limix
- License: mit
- Created: 2016-04-21T15:54:34.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-13T21:59:59.000Z (about 6 years ago)
- Last Synced: 2024-11-06T00:09:12.559Z (7 months ago)
- Language: Python
- Homepage:
- Size: 7.82 MB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NCephes
[](https://travis-ci.com/limix/ncephes)
[](https://ci.appveyor.com/project/Horta/ncephes)
[](https://ncephes.readthedocs.io/)This package provides a python interface for the
[Cephes](http://www.netlib.org/cephes/) library. It also supports
[Numba](http://numba.pydata.org) and its `nopython` mode.## Usage
```python
>>> from ncephes import incbet
>>> print("{:.3f}".format(incbet(1., 3., 0.3)))
0.657
```You can also call them inside a numba function
```python
>>> from ncephes import incbet
>>> from numba import jit
>>>
>>> @jit
... def numba_incbet(a, b, x):
... return incbet(a, b, x)
>>>
>>> print("{:.3f}".format(numba_incbet(1., 3., 0.3)))
0.657
```and with nopython mode and nogil enabled
```python
>>> from ncephes import incbet
>>> from numba import jit
>>>
>>> @jit(nogil=True, nopython=True)
... def numba_incbet(a, b, x):
... return incbet(a, b, x)
>>>
>>> print("{:.3f}".format(numba_incbet(1., 3., 0.3)))
0.657
```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](http://conda.pydata.org/docs/index.html)```bash
conda install -c conda-forge ncephes
```An alternative way would be via pip
```bash
pip install ncephes
```## Running the tests
After installation, you can test it
```bash
python -c "import ncephes; ncephes.test()"
```as long as you have [pytest](http://docs.pytest.org/en/latest/).
## Authors
- **Danilo Horta** -
## License
This project is licensed under the MIT License - see the
[LICENSE](LICENSE) file for details