Skip to main content

A reference implementation of box least squares in Python

Project description

An efficient reference implementation of the box least squares algorithm for transiting exoplanet search in Python. This will eventually be submitted as a pull request to the core AstroPy package, but we’re making it available here for now to make it easy to use right away.


To install and run this package, you will need to have NumPy, Cython, and AstroPy installed. The recommended installation method is:

conda install numpy cython astropy


To install, clone this repository and build the extension as follows:

git clone
python install

or, install using pip:

pip install

OpenMP support: This algorithm can optionally be parallelized using OpenMP. To enable this feature, you must compile with a compiler that supports OpenMP and the relevant flags. On macOS, this can be achieved by installing a recent llvm:

brew install llvm

and then building using the following flags:

CC=/usr/local/opt/llvm/bin/clang \
 LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -liomp5" \
 CFLAGS="-I/usr/local/opt/llvm/include -fopenmp" \
 python install

On other platforms, a command like the following might be sufficient:

CFLAGS="-lgomp -fopenmp" python install


See tutorial.ipynb for a demonstration of how to use the code.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date (14.3 kB) Copy SHA256 hash SHA256 Source None Apr 23, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page