Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Redesign python API to make this package more extensible and numpy/scipy friendly #22

Merged
merged 2 commits into from
Jan 18, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
MAINT: Bump version and prep for v1.0.0 release
  • Loading branch information
zoj613 committed Jan 18, 2021
commit 556833c046cae1b3a22289a5f582c39a5ea9a396
25 changes: 15 additions & 10 deletions build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,32 @@ bin_arr=(
/opt/python/cp36-cp36m/bin
/opt/python/cp37-cp37m/bin
/opt/python/cp38-cp38/bin
/opt/python/cp39-cp39/bin
)

# add python to image's path
export PATH=/opt/python/cp38-cp38/bin/:$PATH
# download && install poetry
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

# download install script
curl -#sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py > get-poetry.py
# install using local archive
python get-poetry.py -y --file poetry-1.1.4-linux.tar.gz
# install openblas
yum install -y openblas-devel

function build_poetry_wheels
{
# build wheels for 3.6-3.8 with poetry
# build wheels for 3.6-3.9 with poetry
for BIN in "${bin_arr[@]}"; do
rm -Rf build/*
# install build deps
"${BIN}/python" ${HOME}/.poetry/bin/poetry run pip install numpy
BUILD_WHEELS=1 "${BIN}/python" ${HOME}/.poetry/bin/poetry build -f wheel
done

# add C libraries to wheels
for whl in dist/*.whl; do
auditwheel repair "$whl" --plat $1
rm "$whl"
auditwheel repair dist/*.whl --plat $1
whl="$(basename dist/*.whl)"
"${BIN}/python" -m pip install wheelhouse/"$whl"
# test if installed wheel imports correctly
"${BIN}/python" -c "from pyhtnorm import *"
rm dist/*.whl
done
}

Expand Down
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

extensions = [
Extension(
"pyhtnorm._htnorm",
"_htnorm",
source_files,
include_dirs=[np.get_include(), './include'],
library_dirs=library_dirs,
Expand Down
138 changes: 69 additions & 69 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyhtnorm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from ._htnorm import hyperplane_truncated_mvnorm, structured_precision_mvnorm
from _htnorm import hyperplane_truncated_mvnorm, structured_precision_mvnorm

__version__ = '0.2.0'
__version__ = '1.0.0'
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyhtnorm"
version = "0.2.0"
version = "1.0.0"
description = "Fast Simulation of Hyperplane-Truncated Multivatiate Normal Distributions"
authors = ["Zolisa Bleki"]
license = "BSD-3-Clause"
Expand Down