Skip to content

Commit 62934bf

Browse files
committed
Add extra contacts_kargs deprecation and update to Python3.10
1 parent 606d57e commit 62934bf

13 files changed

Lines changed: 19 additions & 19 deletions

File tree

.github/workflows/full_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
python-version: ["3.9", "3.14"] # Lower and higher versions we support
20+
python-version: ["3.10", "3.14"] # Lower and higher versions we support
2121
os: [macos-latest, windows-latest, ubuntu-latest]
2222
steps:
2323
- uses: actions/checkout@v4

.github/workflows/publish-to-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Set up Python
1515
uses: actions/setup-python@v5
1616
with:
17-
python-version: "3.10"
17+
python-version: "3.11"
1818
- name: Install Tools
1919
run: |
2020
python -m pip install --upgrade pip

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ authors = [
99

1010
description = "Python package to handle probe layout, geometry and wiring to device."
1111
readme = "README.md"
12-
requires-python = ">=3.9"
12+
requires-python = ">=3.10"
1313
classifiers = [
1414
"Programming Language :: Python :: 3",
1515
"License :: OSI Approved :: MIT License",

src/probeinterface/generator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
44
"""
55

6-
from __future__ import annotations
76
import numpy as np
87

98
from typing import Optional

src/probeinterface/io.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
1010
"""
1111

12-
from __future__ import annotations
1312
from pathlib import Path
1413
from typing import Union, Optional
1514
import re

src/probeinterface/library.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
1010
"""
1111

12-
from __future__ import annotations
1312
import os
1413
import warnings
1514
from pathlib import Path

src/probeinterface/neuropixels_tools.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
88
"""
99

10-
from __future__ import annotations
1110
from pathlib import Path
1211
from typing import Union, Optional
1312
import warnings

src/probeinterface/plotting.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Depending on Probe.ndim, the plotting is done in 2D or 3D
66
"""
77

8-
from __future__ import annotations
8+
import warnings
99
import numpy as np
1010
from matplotlib import path as mpl_path
1111

@@ -46,8 +46,6 @@ def create_probe_polygons(
4646
The polygon collection for the probe shape
4747
"""
4848
if contacts_kargs is not None:
49-
import warnings
50-
5149
warnings.warn(
5250
"contacts_kargs is deprecated and will be removed in 0.3.4. Please use `contacts_kwargs` instead.",
5351
category=DeprecationWarning,
@@ -107,13 +105,14 @@ def plot_probe(
107105
contacts_values: list | np.ndarray | None = None,
108106
cmap: str = "viridis",
109107
title: bool = True,
110-
contacts_kargs: dict = {},
108+
contact_kwargs: dict = {},
111109
probe_shape_kwargs: dict = {},
112110
xlims: tuple | None = None,
113111
ylims: tuple | None = None,
114112
zlims: tuple | None = None,
115113
show_channel_on_click: bool = False,
116-
side=None,
114+
side: str | None = None,
115+
contacts_kwargs: dict | None = None,
117116
):
118117
"""Plot a Probe object.
119118
Generates a 2D or 3D axis, depending on Probe.ndim
@@ -138,7 +137,7 @@ def plot_probe(
138137
A colormap color
139138
title : bool, default: True
140139
If True, the axis title is set to the probe name
141-
contacts_kargs : dict, default: {}
140+
contact_kwargs : dict, default: {}
142141
Dict with kwargs for contacts (e.g. alpha, edgecolor, lw)
143142
probe_shape_kwargs : dict, default: {}
144143
Dict with kwargs for probe shape (e.g. alpha, edgecolor, lw)
@@ -152,6 +151,8 @@ def plot_probe(
152151
If True, the channel information is shown upon click
153152
side : None | "front" | "back"
154153
If the probe is two side, then the side must be given otherwise this raises an error.
154+
contacts_kwargs : dict | None, default: None
155+
DEPRECATED, use contact_kwargs instead. Dict with kwargs for contacts (e.g. alpha, edgecolor, lw)
155156
156157
Returns
157158
-------
@@ -162,6 +163,14 @@ def plot_probe(
162163
"""
163164
import matplotlib.pyplot as plt
164165

166+
if contacts_kwargs is not None:
167+
warnings.warn(
168+
"contacts_kwargs is deprecated and will be removed in 0.3.4. Please use `contact_kwargs` instead.",
169+
category=DeprecationWarning,
170+
stacklevel=2,
171+
)
172+
contact_kwargs = contacts_kwargs
173+
165174
if probe.contact_sides is not None:
166175
if side is None or side not in ("front", "back"):
167176
raise ValueError(
@@ -187,7 +196,7 @@ def plot_probe(
187196
contacts_colors=contacts_colors,
188197
contacts_values=contacts_values,
189198
cmap=cmap,
190-
contacts_kargs=contacts_kargs,
199+
contact_kwargs=contact_kwargs,
191200
probe_shape_kwargs=probe_shape_kwargs,
192201
)
193202

src/probeinterface/probe.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import annotations
21
import numpy as np
32
from typing import Optional
43
from pathlib import Path

src/probeinterface/probegroup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import annotations
21
import numpy as np
32
from .utils import generate_unique_ids
43
from .probe import Probe

0 commit comments

Comments
 (0)