Skip to main content

UnitMatchPy and DeepUnitMatch

This repository contains:

  • UnitMatchPy: automatic matching of neurons across sessions (Python package).
  • DeepUnitMatch: DeepUnitMatch pipeline and demos (see preprint below).

References

Versions

  • UnitMatchPy version: 3.6.1 (from pyproject.toml)
  • DeepUnitMatch: code lives under DeepUnitMatch/ (see DeepUnitMatch (DUM) section)

System requirements

Both UnitMatchPy and DeepUnitMatch can be ran on a standard computer, with sufficient RAM (>32GB for large datasets). This software is supported for Windows and macOS, and has been tested on Windows 11.

Installation

pip install (including pip install -e .) installs into whatever Python environment your pip points to (system Python, a conda env, or a virtualenv). pip does not create or name environments.

We recommend using Anaconda/Miniconda (conda) to create an isolated environment first:

# Create a new environment (pick any name you like; example: UMPy)
conda create -n UMPy python=3.11 pip #(press y when prompted)
conda activate UMPy

GPU (CUDA) users: install this first

Skip this if you're on macOS (no CUDA) or don't have an NVIDIA GPU -- Option A/B below will just install the CPU build automatically, no extra steps needed.

If you do have an NVIDIA GPU (Windows/Linux) and want DeepUnitMatch to run on it, install the CUDA-enabled PyTorch build before Option A or B below:

pip install --extra-index-url https://download.pytorch.org/whl/cu126 torch

(if you've cloned this repo, pip install -r requirements-cuda.txt from this folder does the same thing). Do this first because plain pip install UnitMatchPy / pip install -e . alone always installs the CPU-only build -- PyPI's default torch wheel is CPU-only, and pip has no way to detect that a GPU is present. Once torch is already installed and satisfies the version range Option A/B ask for, they'll leave it alone instead of overwriting it with the CPU build.

Verify it worked:

python -c "import torch; print(torch.__version__, torch.cuda.is_available())"

This should print a version ending in +cuXXX (not +cpu) and True. If it's not, see pyproject.toml's torch dependency comment, or check nvidia-smi shows a working driver.

Then install using pip (options below). This step should take less than few minutes.

Option A: Install the released package (PyPI)

pip install UnitMatchPy

Optional extras (heavier dependencies used by some notebooks and integration with SpikeInterface):

pip install "UnitMatchPy[full,notebooks]"

Option B: Install a local, editable copy (for development / modified code)

First, open a terminal and navigate to this folder (the one containing pyproject.toml). The pip install -e command must be run from here:

# Windows (PowerShell) - note; you may have to give writing access to the specific CONDA environment via Windows Security → Virus & threat protection → Ransomware protection → Manage ransomware protection. For example, if the below steps result in "could not create 'UnitMatchPy.egg-info'"

Look at Controlled folder access:
cd $HOME\Documents\GitHub\UnitMatch\UnitMatchPy

# macOS / Linux
cd ~/Documents/GitHub/UnitMatch/UnitMatchPy
pip install -e .

Optional extras (e.g. if you'd like to run the notebooks or integrate with SpikeInterface):

pip install -e ".[full,notebooks]"

Demo notebooks

All demo notebooks are in Demo Notebooks/.

Run UnitMatchPy

To run UnitMatchPy, standard spike sorting data is needed (channel positions and extracted raw waveforms for each unit). Waveforms can be extracted externally (e.g. BombCell) or using the demo notebooks:

  • Demo Notebooks/extract_raw_data_demo.ipynb (compressed .cbin/.ch or raw)
  • Demo Notebooks/extract_raw_data_demo_open_ephys.ipynb (Open Ephys)
  • Demo Notebooks/UMPy_spike_interface_demo.ipynb (SpikeInterface workflow)

Example notebooks:

  • Demo Notebooks/UMPy_example.ipynb (recommended starting point)
  • Demo Notebooks/UMPy_example_detailed.ipynb (more modular / advanced)

The GUI is an optional step to curate and explore UnitMatch outputs; see Demo Notebooks/GUI_Reference_Guide.md for usage tips and shortcuts.

Run DeepUnitMatch

To try the DeepUnitMatch version, start with:

  • Demo Notebooks/DeepUnitMatch.ipynb

It should take just a few minutes to run on a standard PC.

If you want to train / fine-tune a model on your own data, see:

  • Demo Notebooks/DUM_training.ipynb

Important note: DeepUnitMatch current trained model is for Npix 2.0 4-shank only. You will need to train a new model with your own data if you have any other type of probe. (For example, Mouse2 from the figshare data is a Npix 1 dataset, you'll notice the trained model won't give good results on this mouse for that reason.)

Metadata

Release files for UnitMatchPy 3.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for UnitMatchPy 3.6.1
File Size Uploaded
unitmatchpy-3.6.1.tar.gz 192.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for UnitMatchPy 3.6.1
File Interpreter ABI Platform
unitmatchpy-3.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 688.5 kB

Release files / unitmatchpy-3.6.1.tar.gz

Download URL unitmatchpy-3.6.1.tar.gz
Size 192.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2b6641a72b9202e6f7b47babc0c8c2dc763fde287a5eae9fb15b1e00c47f6ab4
BLAKE2b-256 checksum
How to use checksums
af26696ddc936b745b6fe1d628c77ba62f41ae9b26f43d8f67530123b79d08e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release files / unitmatchpy-3.6.1-py3-none-any.whl

Download URL unitmatchpy-3.6.1-py3-none-any.whl
Size 495.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04723bec1071d7c562cb74f4772e95d3acc19f2c409c971cfdc6c26f2ab559e8
BLAKE2b-256 checksum
How to use checksums
34fa1c045ef2ad07e737133a3ec2042a3bc4cd0e819914217f12019a8c5045c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.6.1 This release

2 release files

3.6.0

2 release files

3.5.0

2 release files

3.4.1

2 release files

3.4.0

2 release files

3.3.1

2 release files

3.3.0

2 release files

3.2.9

2 release files

3.2.8

2 release files

3.2.7

2 release files

3.2.6

2 release files

3.2.5

2 release files

3.2.4

2 release files

3.2.3

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2

2 release files

3.1

2 release files

3.0

2 release files

2.42

2 release files

2.41

2 release files

2.40

2 release files

2.31

2 release files

2.20

2 release files

2.18

2 release files

2.16

2 release files

2.15

2 release files

2.14

2 release files

2.13

2 release files

2.12

2 release files

2.11

2 release files

2.4

2 release files

2.2

2 release files

2.1

2 release files

2.0

2 release files

1.2

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page