Skip to content

Commit

Permalink
Update Python versions and GitHub Actions configuration (#82)
Browse files Browse the repository at this point in the history
* Update supported python versions, versioneer, install, GitHub Actions; format/lint

* Update Python version support and upgrade setup-python action to v5

* Fix Python version formatting in GitHub Actions workflow

* Update Python version requirements to 3.8 or higher

* try adding blas and lapack dependencies

* Replace setup-python with conda for dependency management and remove OS-specific installation steps for BLAS and LAPACK

* Add conda-forge channel to workflow and verify Python and pip installation

* Add Miniconda version and environment activation to workflow

* Enable auto-activation of the base environment in the workflow and clean up unnecessary conda info commands

* Activate the conda environment in the workflow and ensure the base environment is auto-activated

* Add default shell configuration for workflow and remove explicit conda activation

* fix stdpopsim api call in sim nb

* fix factorial api call

* Add conditional installation of gcc and clang for Ubuntu and macOS

* gxx, not gcc

* compiler env vars

* abandon conda

* fix workflow syntax

* Update macOS version in build matrix to macos-15-large

* Update macOS condition for installing blas/lapack to macos-15-large

* Replace Ubuntu and macOS blas/lapack installation steps with Homebrew setup

* Refactor Homebrew installation steps in build workflow

* abandon macos

* matrix syntax

* Remove Python 3.13 from the build matrix in GitHub Actions workflow

* black format

* Replace DeviceArray with Array in documentation examples

* Update installation instructions to include --use-pep517 flag (see #81)

* try macos again with pep517

* no macos, install blas/lapack
  • Loading branch information
wsdewitt authored Jan 9, 2025
1 parent 936c0bd commit c7d27ef
Show file tree
Hide file tree
Showing 16 changed files with 1,148 additions and 567 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,23 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.7, 3.8, 3.9]
os: [ubuntu-latest,]
# os: [ubuntu-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-pandoc@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install blas/lapack if ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install libblas-dev liblapack-dev
- name: Install
run: |
python -m pip install --upgrade pip
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/docs-build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ jobs:
- uses: r-lib/actions/setup-pandoc@v2

- name: Checkout 🛎️
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.12'

- name: Install blas/lapack
run: |
sudo apt-get install libblas-dev liblapack-dev
- name: Install
run: |
Expand All @@ -27,7 +31,7 @@ jobs:
make docs
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.2.2
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: docs # The branch the action should deploy to.
folder: docs/_build/html # The folder the action should deploy.
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default:

install:
pip install -r requirements.txt
pip install -e .
pip install --use-pep517 -e .

test:
pytest
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

# This is processed by Jinja2 and inserted before each notebook
nbsphinx_prolog = r"""
{% set docname = 'docs/' + env.doc2path(env.docname, base=None) %}
{% set docname = 'docs/' + env.doc2path(env.docname, base=None) | string %}
.. only:: html
.. role:: raw-html(raw)
:format: html
Expand Down
4 changes: 3 additions & 1 deletion docs/install.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Installation
############

Python 3.7 or higher is required.
Python 3.8 or higher is required.

Pip
===
Expand All @@ -10,6 +10,8 @@ Pip
pip install mushi
.. note::
You might need the flag ``--use-pep517`` to avoid errors installing the proxTV dependency.

Conda
=====
Expand Down
11 changes: 5 additions & 6 deletions docs/notebooks/simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -74,9 +74,8 @@
"source": [
"species = stdpopsim.get_species(\"HomSap\")\n",
"model = species.get_demographic_model(\"Zigzag_1S14\")\n",
"ddb = model.get_demography_debugger()\n",
"eta_true = mushi.eta(change_points,\n",
" 1 / ddb.coalescence_rate_trajectory(steps=t,\n",
" 1 / model.model.debug().coalescence_rate_trajectory(steps=t,\n",
" lineages={0: 2},\n",
" double_step_validation=False)[0])\n",
"\n",
Expand Down Expand Up @@ -235,7 +234,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -346,7 +345,7 @@
"metadata": {
"celltoolbar": "Slideshow",
"kernelspec": {
"display_name": "Python 3",
"display_name": "mushi",
"language": "python",
"name": "python3"
},
Expand All @@ -360,7 +359,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
"version": "3.12.8"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit c7d27ef

Please sign in to comment.