Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-24.04, macos-14, macos-15-intel ]
python-version: [ 310, 311 ]
python-version: [ 310, 311, 312, 313 ]

steps:
- name: "Checkout code"
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:

- name: "Build sdist"
run: |
pip3 install pipx ppsetuptools
pip3 install pipx
pipx run build --sdist

- name: "Upload build artifacts"
Expand Down
26 changes: 6 additions & 20 deletions cibuildwheel.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,11 @@ linux.before-test = [
"pip install 'biopython' 'matplotlib' 'numpy<2' 'pandas' 'pygments' 'scipy'"
]

# Run examples serially (one at a time) without parallel to avoid memory issues in CI
# Run ALL examples serially (one at a time) - including slow ones after memory fixes
linux.test-command = [
"""cd {project}/examples && for f in *.py; do
case "$f" in
benefits_of_sex.py|genealogies_with_selection.py|measuring_fixation_probabilities.py|multi_sample_adaptive.py|mutation_selection_balance_highd.py|neutral_LD_highd.py|speed_highd.py|speed_lowd.py)
echo "Skipping slow example: $f"
;;
*)
echo "Testing $f..."
MPLBACKEND=Agg python3 "$f" || exit 1
;;
esac
echo "Testing $f..."
MPLBACKEND=Agg python3 "$f" || exit 1
done"""
]

Expand All @@ -51,17 +44,10 @@ macos.before-test = [
"pip install 'biopython' 'matplotlib' 'numpy<2' 'pandas' 'pygments' 'scipy'"
]

# Run same tests as Linux for consistency - serially without parallel
# Run ALL examples serially - including slow ones after memory fixes
macos.test-command = [
"""cd {project}/examples && for f in *.py; do
case "$f" in
benefits_of_sex.py|genealogies_with_selection.py|measuring_fixation_probabilities.py|multi_sample_adaptive.py|mutation_selection_balance_highd.py|neutral_LD_highd.py|speed_highd.py|speed_lowd.py)
echo "Skipping slow example: $f"
;;
*)
echo "Testing $f..."
MPLBACKEND=Agg python3 "$f" || exit 1
;;
esac
echo "Testing $f..."
MPLBACKEND=Agg python3 "$f" || exit 1
done"""
]
4 changes: 2 additions & 2 deletions examples/mutation_selection_balance_highd.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
for locus in range(L):

# make histogram
y,x = np.histogram(allele_frequencies[:,locus], bins=af_bins, normed='True')
y,x = np.histogram(allele_frequencies[:,locus], bins=af_bins, density=True)

# plot
plt.plot(bc, y, color=plt.cm.jet(locus*4))
Expand All @@ -78,7 +78,7 @@
# compare explicitly to diffusion theory by normalizing to the diffusion theory prediction
plt.figure()
for locus in range(L):
y,x = np.histogram(allele_frequencies[:,locus], bins=af_bins, normed='True')
y,x = np.histogram(allele_frequencies[:,locus], bins=af_bins, density=True)

# calculate the diffusion theory single locus result
diffusion_theory = bc**(2*N*mu-1)*(1-bc)**(2*N*mu-1)*np.exp(2*N*s[locus]*bc)
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
{ name = "Ivan Aksamentov" },
]
readme = "README.md"
requires-python = ">=3.6"
requires-python = ">=3.10"
keywords = ["packaging", "dependency", "infer", "pyproject.toml"]
classifiers = [
"Programming Language :: Python :: 3",
Expand All @@ -25,8 +25,7 @@ repository = "https://github.com/neherlab/ffpopsim"
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"numpy",
"ppsetuptools",
"numpy<2",
"setuptools",
"wheel",
]
9 changes: 1 addition & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
#!/usr/bin/env python
# vim: fdm=indent

import sys
import subprocess
import os

# Python 3.6 compatibility: Python 3.6 has no compatible version of setuptools that supports
# PEP-517 (the `pyproject.toml`-based config), so we use a shim package `ppsetuptools` instead.
if sys.version_info >= (3, 7):
from setuptools import setup, Extension
else:
from ppsetuptools import setup, Extension

from setuptools import setup, Extension
import numpy as np

# Get GSL include paths
Expand Down
Loading