55Depending on Probe.ndim, the plotting is done in 2D or 3D
66"""
77
8- from __future__ import annotations
8+ import warnings
99import numpy as np
1010from 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
0 commit comments