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
57 changes: 56 additions & 1 deletion .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,64 @@ jobs:
run: |
python -c "from myogen.simulator.neuron.populations import AlphaMN__Pool; print('NEURON components OK')"

test_wheels_jaxley_only:
name: Test wheel WITHOUT NEURON/MPI (Jaxley-only install)
needs: [build_wheels]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Download wheels
uses: actions/download-artifact@v7
with:
name: wheels-ubuntu-latest
path: dist/

# Deliberately DO NOT install NEURON, mpi4py, or system MPI. This proves the
# default (Jaxley-only) install works with none of the NEURON stack present.
- name: Install wheel (core deps only)
run: |
python -m pip install --upgrade pip
# dist/ holds both cp312 and cp313 wheels; install only the one matching
# this runner's Python so pip doesn't reject the other ABI.
tag="cp$(echo '${{ matrix.python-version }}' | tr -d .)"
pip install dist/*"${tag}-${tag}"*.whl

- name: Verify NEURON is absent
run: |
python -c "
try:
import neuron
raise SystemExit('FAIL: neuron is installed; this job must run without it')
except ImportError:
print('OK: NEURON runtime is not installed')
"

- name: Import MyoGen without NEURON
run: |
python -c "import myogen; print('import myogen OK')"
python -c "import myogen.simulator as s; print('import myogen.simulator OK; HillModel <-', s.HillModel.__module__)"
python -c "from myogen.simulator.jaxley import run_jax, value_and_grad_run, surface_emg_jax; print('differentiable API OK')"

- name: Build real NERLab motor neurons on the Jaxley backend
run: |
python -c "
import numpy as np
from myogen.simulator.jaxley.populations import AlphaMN__Pool
pool = AlphaMN__Pool(recruitment_thresholds__array=np.array([0.1, 0.3, 0.6]), mode='active')
assert len(pool) == 3, len(pool)
print('Jaxley-only install verified:', len(pool), 'NERLab MNs built, no NEURON present')
"

publish:
name: Publish to PyPI
needs: [build_wheels, build_sdist, test_wheels]
needs: [build_wheels, build_sdist, test_wheels, test_wheels_jaxley_only]
runs-on: ubuntu-latest
if: github.event_name == 'release' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
permissions:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ jobs:
with:
enable-cache: true

- name: Sync project + docs/nwb extras
run: uv sync --locked --group docs --extra nwb
- name: Sync project + docs/nwb/neuron extras
# NEURON is now an optional extra (Jaxley is the default backend). The docs
# build needs it: `poe setup_myogen` compiles NMODL, and mkdocstrings imports
# the NEURON injection utilities (api/io-and-neuron.md) to document them.
run: uv sync --locked --group docs --extra nwb --extra neuron

- name: Compile NMODL mechanisms
run: uv run poe setup_myogen
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ jobs:
python -m pip install --upgrade pip
python -m pip install uv

- name: Install project with dev group
- name: Install project with dev group + optional NEURON backend
# NEURON is now an optional extra (Jaxley is the default backend), so the
# test suite must opt into it to exercise the NEURON-backed tests.
run: |
uv sync --locked --group dev
uv sync --locked --group dev --extra neuron

- name: Compile NEURON mechanisms
run: uv run poe setup_myogen
Expand Down
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
### Python template
# macOS Finder metadata
.DS_Store

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -212,3 +215,26 @@ notes/
/artifacts/
/.runtime-deps/
/graphify-out/

# Local working artifacts kept out of the public history
docs/session_notes/*
!docs/session_notes/2026-06-02_jaxley_nerlab_architecture_migration.md
# Evidence: only the final full runs are versioned; exploratory/intermediate
# runs stay local (git add -A must not re-add them).
experiments/twin/evidence/*
!experiments/twin/evidence/pic_grid_full_20261018_132043.json
!experiments/twin/evidence/val_comparison_bac411989ee8d42b_20261018_124637.json
!experiments/twin/evidence/val_comparison_ef1bd7e84b9abd03_20261018_124343.json
!experiments/twin/evidence/deliverable_b_full_binned_20261018_123116.json
!experiments/twin/evidence/deliverable_c_full_binned_20261018_131156.json
!experiments/twin/evidence/g4_descent_full_20261018_180008.json
!experiments/twin/evidence/g5_basin_full_20261018_191021.json
!experiments/twin/evidence/r2a_profiles_full_20261018_134617.json
!experiments/twin/evidence/sensitivity_checks_20261013_112432.json
!experiments/twin/evidence/gradient_repair_x64_20261018_154132.json
docs/DIGITAL_TWIN_ROADMAP.md
debug_*.py
diag_*.py
README-old.md
Figure_1.pdf
Figure_1_preview.jpg
Loading
Loading