Skip to content

Software

This project is a small stack of Python packages plus Arbor, not a single monolith. toric_spines_sim is the simulation/analysis repo collaborators clone; the others are installed by uv sync from GitHub.

Environment

Use uv (not conda) for Python. Each project has a .venv at the repo root. You do not activate it: prefix commands with uv run.

uv add numpy                          # PyPI
uv add "git+https://github.com/jmrfox/mascaf.git"
uv run python scripts/append_sink.py TS1
uv run pytest

pyproject.toml is the source of truth for dependencies. Optional extras:

Group Install What it is for
(default) uv sync simulation, pymcfs, mascaf, tests (dev is included)
neurosignature uv sync --group neurosignature TS1 descriptor pipeline and example notebook
docs uv sync --group docs MkDocs preview (mkdocs serve)

If you truly need conda-forge packages alongside PyPI, Pixi can pull both; this repo does not require that.

OS. Arbor does not ship native Windows wheels. The supported path is Linux or macOS, or WSL2 Ubuntu on Windows, with the clone on the Linux filesystem (~/..., not /mnt/c/...). Cursor / VS Code can edit the same tree from Windows. macOS works the same as Linux once CMake and the NMODL catalogue toolchain are installed — see Getting started.

Interactivity. Jupyter notebooks (jupytext .py sources) are the lightweight lab notebook. The axon studies also ship Dash apps (terminal server + browser UI). marimo is an option for new notebooks; nothing here depends on it.

Packages developed for this work

Package Role
toric_spines_sim This repo: morphology pipeline CLIs, TSModel / TSSimulator, axon studies, Dash / PDF
mascaf Mesh And Skeleton CAble model Fitting. Fits an SWC cable to a mesh + skeleton. This project pins the release branch. Docs: mascaf.readthedocs.io. Methods: bioRxiv
pymcfs Python mean-curvature flow skeletonization (MCFS). This is the supported skeletonizer (scripts/skeletonize_meshes.py)
swctools SWC I/O and morphology helpers used by mascaf and the simulator
jscip Parameter banks (sampling, derived quantities, constraints). Used heavily; you do not need to extend it to run sims
neurosignature Optional. Descriptors for multi-channel event-in / multi-channel signal-out systems. Design: Neurosignature

mascaf’s GitHub main branch still contains extra toric-spine research scripts; release is the installable package this repo uses.

Other libraries

Tool Role
Arbor Cable-cell simulator. Custom NMODL catalogue is built locally (see Getting started)
pynapple Event and time-series types (Ts, Tsd, TsGroup) for inputs and results
CGAL / CGALLab Computational geometry. Original MCFS implementation used here; still useful for interactive mesh repair and one-off skeletonization. Not required for the automated pipeline. Details: Skeletons

Biophysics notes

Temperature is Kelvin (in vitro ~297 K; barn owl in vivo ~313 K). Capacitance is µF/cm²; leak is S/cm²; axial resistivity is Ω·cm. ICx banks: make_icx_parameter_bank_invitro() (Sanculi patch clamp) and make_icx_parameter_bank_invivo() (Peña and Konishi 2002 rest; Sanculi leak × 3). Tutorials use make_default_parameter_bank(). Axon studies return the invivo bank from simulations/ts{id}/params.py; uncomment another factory or set .value for a per-spine change.