-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
99 changed files
with
6,352 additions
and
2,737 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: ci Docs | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
permissions: | ||
contents: write | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Configure Git Credentials | ||
run: | | ||
git config user.name github-actions[bot] | ||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
|
||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
key: mkdocs-material-${{ env.cache_id }} | ||
path: .cache | ||
restore-keys: | | ||
mkdocs-material- | ||
- run: python -m pip install -r requirements-docs.txt | ||
- run: mkdocs gh-deploy --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: magenpy Linux-CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up miniconda | ||
uses: conda-incubator/[email protected] | ||
with: | ||
channels: conda-forge | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Set up Conda environment | ||
shell: "bash -l {0}" | ||
run: > | ||
conda create --name "magenpy_ci" -c conda-forge -c anaconda | ||
python=${{matrix.python-version}} pip wheel compilers openblas -y | ||
- name: Install magenpy | ||
shell: "bash -l {0}" | ||
run: | | ||
conda activate magenpy_ci | ||
python -m pip install -v -e .[test] | ||
- name: Run tests | ||
shell: "bash -l {0}" | ||
run: | | ||
conda activate magenpy_ci | ||
pytest -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: magenpy OSX-CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up miniconda | ||
uses: conda-incubator/[email protected] | ||
with: | ||
channels: conda-forge | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Set up Conda environment | ||
shell: "bash -l {0}" | ||
run: > | ||
conda create --name "magenpy_ci" -c conda-forge -c anaconda | ||
python=${{matrix.python-version}} pip wheel compilers openblas -y | ||
- name: Install magenpy | ||
shell: "bash -l {0}" | ||
run: | | ||
conda activate magenpy_ci | ||
python -m pip install -v -e .[test] | ||
- name: Run tests | ||
shell: "bash -l {0}" | ||
run: | | ||
conda activate magenpy_ci | ||
pytest -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: magenpy OSX-CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up miniconda | ||
uses: conda-incubator/[email protected] | ||
with: | ||
channels: conda-forge | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Set up Conda environment | ||
shell: "bash -l {0}" | ||
run: > | ||
conda create --name "magenpy_ci" -c conda-forge -c anaconda | ||
python=${{matrix.python-version}} pip wheel compilers openblas -y | ||
- name: Install magenpy | ||
shell: "bash -l {0}" | ||
run: | | ||
conda activate magenpy_ci | ||
python -m pip install -v -e .[test] | ||
- name: Run tests | ||
shell: "bash -l {0}" | ||
run: | | ||
conda activate magenpy_ci | ||
pytest -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Build magenpy and upload to PyPI | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
# macos-13 is an intel runner, macos-14 is apple silicon | ||
os: [ubuntu-latest, windows-latest, macos-13, macos-14] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | ||
path: ./wheelhouse/*.whl | ||
|
||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build sdist | ||
run: pipx run build --sdist | ||
|
||
- name: test install | ||
run: pip install dist/magenpy*.tar.gz | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-sdist | ||
path: dist/*.tar.gz | ||
|
||
upload_pypi: | ||
needs: [build_wheels, build_sdist] | ||
runs-on: ubuntu-latest | ||
environment: pypi | ||
permissions: | ||
id-token: write | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this) | ||
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
# unpacks all CIBW artifacts into dist/ | ||
pattern: cibw-* | ||
path: dist | ||
merge-multiple: true | ||
|
||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
# To test: repository-url: https://test.pypi.org/legacy/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
If you use `magenpy` in your research, please cite the following paper(s): | ||
|
||
> Zabad, S., Gravel, S., & Li, Y. (2023). **Fast and accurate Bayesian polygenic risk modeling with variational inference.** | ||
The American Journal of Human Genetics, 110(5), 741–761. https://doi.org/10.1016/j.ajhg.2023.03.009 | ||
|
||
## BibTeX records | ||
|
||
```bibtex | ||
@article{ZABAD2023741, | ||
title = {Fast and accurate Bayesian polygenic risk modeling with variational inference}, | ||
journal = {The American Journal of Human Genetics}, | ||
volume = {110}, | ||
number = {5}, | ||
pages = {741-761}, | ||
year = {2023}, | ||
issn = {0002-9297}, | ||
doi = {https://doi.org/10.1016/j.ajhg.2023.03.009}, | ||
url = {https://www.sciencedirect.com/science/article/pii/S0002929723000939}, | ||
author = {Shadi Zabad and Simon Gravel and Yue Li} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,40 @@ | ||
.PHONY: build dist redist install install-from-source clean uninstall | ||
.PHONY: build build-inplace test test-inplace dist redist install install-from-source clean uninstall publish-test publish | ||
|
||
build: | ||
python3 setup.py build | ||
|
||
build-inplace: | ||
python3 setup.py build_ext --inplace | ||
|
||
test-inplace: | ||
PYTHONPATH=. pytest | ||
|
||
test: | ||
python -m pytest | ||
|
||
dist: | ||
python3 setup.py sdist bdist_wheel | ||
python setup.py sdist bdist_wheel | ||
|
||
redist: clean dist | ||
|
||
install: | ||
pip install . | ||
python -m pip install . | ||
|
||
install-from-source: dist | ||
pip install dist/magenpy-*.tar.gz | ||
python -m pip install dist/magenpy-*.tar.gz | ||
|
||
clean: | ||
$(RM) -r build dist *.egg-info | ||
$(RM) -r magenpy/LDMatrix.c magenpy/utils/c_utils.c | ||
$(RM) -r magenpy/stats/ld/*.c magenpy/stats/score/*.cpp | ||
$(RM) -r magenpy/stats/ld/*.so magenpy/stats/score/*.so | ||
$(RM) -r .pytest_cache .tox temp output | ||
find . -name __pycache__ -exec rm -r {} + | ||
|
||
uninstall: | ||
pip uninstall magenpy | ||
python -m pip uninstall magenpy | ||
|
||
publish-test: | ||
python -m twine upload -r testpypi dist/* --verbose | ||
|
||
publish: | ||
python -m twine upload dist/* --verbose |
Oops, something went wrong.