Skip to content
Merged
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
25 changes: 25 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Codespell configuration is within pyproject.toml
---
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Annotate locations with typos
uses: codespell-project/codespell-problem-matcher@v1
- name: Codespell
uses: codespell-project/actions-codespell@v2
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ repos:
hooks:
- id: black
files: ^src/|^tests/
- repo: https://github.com/codespell-project/codespell
# Configuration for codespell is in .pre-commit-config.yaml
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies:
- tomli # for python_version < '3.11'
exclude: ^doc/releases/.*\.rst
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,10 @@ omit = [

[tool.black]
line-length = 120

[tool.codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = '.git*,*.pdf,*.svg,data,./doc/releases'
check-hidden = true
# ignore-regex = ''
ignore-words-list = 'compiletime'
8 changes: 4 additions & 4 deletions resources/generate_cambridgeneurotech_libray.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
The script have been modified by Smauel Garcia (samuel.garcia@cnrs.fr):
* more pytonic
* improve code readability
* not more channel_device_index the order is the conatct index
* not more channel_device_index the order is the contact index
* simpler function for plotting.

2021-04-02
Expand Down Expand Up @@ -72,7 +72,7 @@

def convert_probe_shape(listCoord):
'''
This is to convert reference point probe shape inputed in excel
This is to convert reference point probe shape inputted in excel
as string 'x y x y x y that outline the shape of one shanck
and can be converted to an array to draw the porbe
'''
Expand All @@ -95,7 +95,7 @@ def get_contact_order(connector, probe_type):
This will help to re-order the probe contact later on.
"""

# first part of the function to opne the proper connector based on connector name
# first part of the function to open the proper connector based on connector name

# header [0,1] is used to create a mutliindex
df = pd.read_excel(probe_map_file, sheet_name=connector, header=[0,1])
Expand Down Expand Up @@ -188,7 +188,7 @@ def generate_CN_multi_shank(probe_info):

def create_CN_figure(probe_name, probe):
"""
Create custum figire for CN with custum colors + logo
Create custom figire for CN with custom colors + logo
"""
fig, ax = plt.subplots()
fig.set_size_inches(18.5, 10.5)
Expand Down
2 changes: 1 addition & 1 deletion resources/generate_neuropixels_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def generate_all_npx():

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

# ploting
# plotting
fig, axs = plt.subplots(ncols=2)

ax = axs[0]
Expand Down
2 changes: 1 addition & 1 deletion src/probeinterface/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ def read_csv(file: str | Path):

def write_csv(file, probe):
"""
Write contact postions into a 2 or 3 columns csv file
Write contact positions into a 2 or 3 columns csv file
"""

raise NotImplementedError
Expand Down
6 changes: 3 additions & 3 deletions src/probeinterface/neuropixels_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _load_np_probe_features():
"NP2020": "2020",
# Ultra
"NP1100": "1100", # Ultra probe - 1 bank
"NP1110": "1110", # Ultra probe - 16 banks no handle beacuse
"NP1110": "1110", # Ultra probe - 16 banks no handle because
"NP1121": "1121", # Ultra probe - beta configuration
# Opto
"NP1300": "1300", # Opto probe
Expand Down Expand Up @@ -103,7 +103,7 @@ def get_probe_length(probe_part_number: str) -> int:
Returns
-------
probe_length : int
Lenth of full probe (microns)
Length of full probe (microns)
"""

probe_length = 10_000
Expand Down Expand Up @@ -1128,7 +1128,7 @@ def get_saved_channel_indices_from_openephys_settings(
if len(possible_custom_streams) > 1:
warnings.warn(
f"More than one custom parameters associated to {stream_name} "
f"found. Using fisrt one"
f"found. Using first one"
)
custom_stream = possible_custom_streams[0]
else:
Expand Down
2 changes: 1 addition & 1 deletion src/probeinterface/probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ def add_probe_to_zarr_group(self, group: "zarr.Group") -> None:
data = probe_arr[field_name]
group.create_dataset(name=field_name, data=data, dtype=dtype, chunks=False)

# Annotations as a group (special attibutes are stored as annotations)
# Annotations as a group (special attributes are stored as annotations)
annotations_group = group.create_group("annotations")
for key, value in self.annotations.items():
annotations_group.attrs[key] = value
Expand Down
2 changes: 1 addition & 1 deletion src/probeinterface/probegroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def set_global_device_channel_indices(self, channels: np.array | list):
f"Wrong channels size {channels.size} for the number of channels {self.get_contact_count()}"
)

# first reset previsous indices
# first reset previous indices
for i, probe in enumerate(self.probes):
n = probe.get_contact_count()
probe.set_device_channel_indices([-1] * n)
Expand Down
2 changes: 1 addition & 1 deletion src/probeinterface/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def generate_unique_ids(min: int, max: int, n: int, trials: int = 20) -> np.arra
Parameters
----------
min : int
Minimun value permitted for an identifier
Minimum value permitted for an identifier
max : int
Maximum value permitted for an identifier
n : int
Expand Down
2 changes: 1 addition & 1 deletion src/probeinterface/wiring.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
31, 30
],

# from PDF documention of mini-amp-64 page 5
# from PDF documentation of mini-amp-64 page 5
'cambridgeneurotech_mini-amp-64': [
# connector J2 TOP
41, 39, 38, 37, 35, 34, 33, 32, 29, 30, 28, 26, 25, 24, 22, 20,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_io/test_openephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def test_NP1_subset():
assert len(probe_lf.contact_positions) == 200

# Not specifying the stream_name should raise an Exception, because both the ProbeA-AP and
# ProbeA-LFP have custome channel selections
# ProbeA-LFP have custom channel selections
with pytest.raises(AssertionError):
probe = read_openephys(data_path / "OE_Neuropix-PXI-subset" / "settings.xml")

Expand Down
8 changes: 4 additions & 4 deletions tests/test_io/test_spikeglx.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_NP2_4_shanks():
assert np.all(probe.contact_shape_params == {"width": contact_width})
assert np.all(probe.contact_shapes == contact_shape)

# This file does not save the channnels from 0 as the one above (NP2_4_shanks_g0_t0.imec0.ap.meta)
# This file does not save the channels from 0 as the one above (NP2_4_shanks_g0_t0.imec0.ap.meta)
ypos = probe.contact_positions[:, 1]
assert np.min(ypos) == pytest.approx(0)

Expand All @@ -109,7 +109,7 @@ def test_NP2_2013_all():
assert np.all(probe.contact_shape_params == {"width": contact_width})
assert np.all(probe.contact_shapes == contact_shape)

# This file does not save the channnels from 0 as the one above (NP2_4_shanks_g0_t0.imec0.ap.meta)
# This file does not save the channels from 0 as the one above (NP2_4_shanks_g0_t0.imec0.ap.meta)
ypos = probe.contact_positions[:, 1]
assert np.min(ypos) == pytest.approx(0)

Expand All @@ -132,7 +132,7 @@ def test_NP2_2013_subset():
assert np.all(probe.contact_shape_params == {"width": contact_width})
assert np.all(probe.contact_shapes == contact_shape)

# This file does not save the channnels from 0 as the one above (NP2_4_shanks_g0_t0.imec0.ap.meta)
# This file does not save the channels from 0 as the one above (NP2_4_shanks_g0_t0.imec0.ap.meta)
ypos = probe.contact_positions[:, 1]
assert np.min(ypos) == pytest.approx(0)

Expand All @@ -154,7 +154,7 @@ def test_NP2_4_shanks_with_different_electrodes_saved():
assert np.all(probe.contact_shape_params == {"width": contact_width})
assert np.all(probe.contact_shapes == contact_shape)

# This file does not save the channnels from 0 as the one above (NP2_4_shanks_g0_t0.imec0.ap.meta)
# This file does not save the channels from 0 as the one above (NP2_4_shanks_g0_t0.imec0.ap.meta)
ypos = probe.contact_positions[:, 1]
assert np.min(ypos) == pytest.approx(4080.0)
assert np.max(ypos) == pytest.approx(4785.0)
Expand Down