@@ -55,8 +55,7 @@ def bar3(
5555 import matplotlib .pyplot as plt
5656 except ImportError as exc :
5757 raise ImportError (
58- "matplotlib is required for ndi.fun.plot. "
59- "Install it with: pip install matplotlib"
58+ "matplotlib is required for ndi.fun.plot. " "Install it with: pip install matplotlib"
6059 ) from exc
6160
6261 import pandas as pd
@@ -91,21 +90,14 @@ def bar3(
9190 ax = axes [i ]
9291 for j in range (g2_size ):
9392 for k in range (g3_size ):
94- mask = (
95- (group_indices [0 ] == i )
96- & (group_indices [1 ] == j )
97- & (group_indices [2 ] == k )
98- )
93+ mask = (group_indices [0 ] == i ) & (group_indices [1 ] == j ) & (group_indices [2 ] == k )
9994 vals = df .loc [mask , plotting_variable ].values
10095 x = j * (g3_size + 1 ) + k + 1
10196 if len (vals ) > 0 :
10297 ax .bar (x , np .nanmean (vals ), color = colors [k ])
10398
10499 # Format subplot
105- tick_positions = [
106- (g3_size + 1 ) * j + (g3_size + 1 ) / 2
107- for j in range (g2_size )
108- ]
100+ tick_positions = [(g3_size + 1 ) * j + (g3_size + 1 ) / 2 for j in range (g2_size )]
109101 ax .set_xticks (tick_positions )
110102 ax .set_xticklabels ([str (g ) for g in groups [1 ]])
111103 ax .set_title (str (groups [0 ][i ]))
@@ -150,8 +142,7 @@ def multichan(
150142 import matplotlib .pyplot as plt
151143 except ImportError as exc :
152144 raise ImportError (
153- "matplotlib is required for ndi.fun.plot. "
154- "Install it with: pip install matplotlib"
145+ "matplotlib is required for ndi.fun.plot. " "Install it with: pip install matplotlib"
155146 ) from exc
156147
157148 data = np .asarray (data )
@@ -222,8 +213,7 @@ def stimulusTimeseries(
222213 import matplotlib .pyplot as plt
223214 except ImportError as exc :
224215 raise ImportError (
225- "matplotlib is required for ndi.fun.plot. "
226- "Install it with: pip install matplotlib"
216+ "matplotlib is required for ndi.fun.plot. " "Install it with: pip install matplotlib"
227217 ) from exc
228218
229219 # Read stimulus data from the probe
@@ -240,9 +230,7 @@ def stimulusTimeseries(
240230 for entry in stimulus_data :
241231 if isinstance (entry , dict ) and "stimid" in entry :
242232 ids .extend (
243- entry ["stimid" ]
244- if isinstance (entry ["stimid" ], list )
245- else [entry ["stimid" ]]
233+ entry ["stimid" ] if isinstance (entry ["stimid" ], list ) else [entry ["stimid" ]]
246234 )
247235 stimid = ids if ids else None
248236
@@ -254,14 +242,10 @@ def stimulusTimeseries(
254242 stimon = stimulus_time_data .stimon
255243 stimoff = stimulus_time_data .stimoff
256244 else :
257- raise ValueError (
258- "stimulus_time_data must contain 'stimon' and 'stimoff' fields"
259- )
245+ raise ValueError ("stimulus_time_data must contain 'stimon' and 'stimoff' fields" )
260246
261247 if stimon is None or stimoff is None :
262- raise ValueError (
263- "stimulus_time_data must contain 'stimon' and 'stimoff' fields"
264- )
248+ raise ValueError ("stimulus_time_data must contain 'stimon' and 'stimoff' fields" )
265249
266250 stimon = np .asarray (stimon ).ravel ()
267251 stimoff = np .asarray (stimoff ).ravel ()
0 commit comments