Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9112e43
initial commit
chrishalcrow May 15, 2025
247f538
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2025
bb8237e
update docstrings
chrishalcrow May 19, 2025
11db7ec
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 19, 2025
8d49927
respond to Heberto
chrishalcrow May 28, 2025
833b14f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 28, 2025
0c42f58
Bits and pieces
chrishalcrow May 28, 2025
dd4d632
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 28, 2025
c9973ce
add github action to copy probe features
chrishalcrow Jun 1, 2025
f00695a
try to fix action whitespace
chrishalcrow Jun 1, 2025
851a696
defo fix whitespace
chrishalcrow Jun 1, 2025
3cb1768
Remove `make_npx_description` from `read_spikeglx`
chrishalcrow Jun 20, 2025
783dba9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 20, 2025
280f103
add mux_table_array to read_spikeglx
chrishalcrow Jun 26, 2025
43c57c7
Refactor Open Ephys and add mux table contact annotation
alejoe91 Jun 26, 2025
b3299ee
Merge branch 'use-mux-tables' of github.com:chrishalcrow/probeinterfa…
alejoe91 Jun 26, 2025
2650ee7
rename neuropixels ressource file
samuelgarcia Jul 2, 2025
02c3540
rename neuropixels ressource file
samuelgarcia Jul 2, 2025
607519b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 2, 2025
9567cfd
clean mux_table_arraymux_channels
samuelgarcia Jul 2, 2025
9bf8f15
Merge branch 'use-mux-tables' of github.com:chrishalcrow/probeinterfa…
samuelgarcia Jul 2, 2025
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
31 changes: 31 additions & 0 deletions .github/workflows/copy_probe_features.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Sync neuropixels_probe_features from ProbeTable

on:
schedule:
- cron: '0 0 * * 1' # Every Monday at 00:00 UTC
workflow_dispatch:

jobs:
copy-file:
runs-on: ubuntu-latest

steps:
- name: Checkout current repository
uses: actions/checkout@v4

- name: Copy file from external repo
run: |
# Download the file directly
curl -o src/probeinterface/resources/neuropixels_probe_features.json \
https://raw.githubusercontent.com/billkarsh/ProbeTable/refs/heads/main/Tables/probe_features.json

- name: Commit changes if any
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"

git add src/probeinterface/resources/neuropixels_probe_features.json

# Only commit if there are changes
git diff --staged --quiet || git commit -m "Update neuropixels_probe_features from ProbeTable"
git push
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ tests/*.prb
tests/*.json
tests/*/*.prb

*.json
*.prb
tests/*/*.json
tests/*/*.tsv
Expand Down
29 changes: 14 additions & 15 deletions resources/generate_neuropixels_library.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import shutil
from pathlib import Path

import json

import numpy as np
import matplotlib.pyplot as plt

from probeinterface.neuropixels_tools import npx_descriptions, probe_part_number_to_probe_type, _make_npx_probe_from_description
from probeinterface.neuropixels_tools import _make_npx_probe_from_description, get_probe_metadata_from_probe_features
from probeinterface.plotting import plot_probe
from probeinterface import write_probeinterface

Expand All @@ -18,35 +20,35 @@ def generate_all_npx():
# if not base_folder.exists():
base_folder.mkdir(exist_ok=True)

probe_features_filepath = Path(__file__).absolute().parent / Path("../src/probeinterface/resources/neuropixels_probe_features.json")
probe_features = json.load(open(probe_features_filepath, "r"))
probe_part_numbers = probe_features['neuropixels_probes'].keys()


for probe_number, probe_type in probe_part_number_to_probe_type.items():
for probe_number in probe_part_numbers:

if probe_number is None:
continue

if probe_number == "1110":
if probe_number == "NP1110":
# the formula by the imrow table is wrong and more complicated
continue

probe_folder = base_folder / probe_number
probe_folder.mkdir(exist_ok=True)

print(probe_number, probe_type)

probe_description = npx_descriptions[probe_type]

pt_metadata, _, _ = get_probe_metadata_from_probe_features(probe_features, probe_number)


num_shank = probe_description["shank_number"]
contact_per_shank = probe_description["ncols_per_shank"] * probe_description["nrows_per_shank"]
num_shank = pt_metadata["num_shanks"]
contact_per_shank = pt_metadata["cols_per_shank"] * pt_metadata["rows_per_shank"]
if num_shank == 1:
elec_ids = np.arange(contact_per_shank)
shank_ids = None
else:
elec_ids = np.concatenate([np.arange(contact_per_shank) for i in range(num_shank)])
shank_ids = np.concatenate([np.zeros(contact_per_shank) + i for i in range(num_shank)])

probe = _make_npx_probe_from_description(probe_description, elec_ids, shank_ids)
probe = _make_npx_probe_from_description(pt_metadata, elec_ids, shank_ids)

# ploting
fig, axs = plt.subplots(ncols=2)
Expand All @@ -67,7 +69,7 @@ def generate_all_npx():
plot_probe(probe, ax=ax)
ax.set_title("")

yp = probe_description["y_pitch"]
yp = pt_metadata["electrode_pitch_vert_um"]
ax.set_ylim(-yp*8, yp*13)
ax.yaxis.set_visible(False)
ax.spines["top"].set_visible(False)
Expand Down Expand Up @@ -99,8 +101,5 @@ def generate_all_npx():






if __name__ == "__main__":
generate_all_npx()
Loading