Skip to content

Commit 74497c5

Browse files
authored
Merge pull request #420 from int-brain-lab/json_encoder
make sure channel dict is compatible with json encoder datatypes
2 parents 37860e9 + c8c86b2 commit 74497c5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

ibllib/pipes/histology.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,11 @@ def create_channel_dict(traj, brain_locations):
347347
channel_dict = []
348348
for i in np.arange(brain_locations.id.size):
349349
channel_dict.append({
350-
'x': brain_locations.xyz[i, 0] * 1e6,
351-
'y': brain_locations.xyz[i, 1] * 1e6,
352-
'z': brain_locations.xyz[i, 2] * 1e6,
353-
'axial': brain_locations.axial[i],
354-
'lateral': brain_locations.lateral[i],
350+
'x': np.float64(brain_locations.xyz[i, 0] * 1e6),
351+
'y': np.float64(brain_locations.xyz[i, 1] * 1e6),
352+
'z': np.float64(brain_locations.xyz[i, 2] * 1e6),
353+
'axial': np.float64(brain_locations.axial[i]),
354+
'lateral': np.float64(brain_locations.lateral[i]),
355355
'brain_region': int(brain_locations.id[i]),
356356
'trajectory_estimate': traj['id']
357357
})

ibllib/plots/figures.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def raw_destripe(raw, fs, t0, i_plt, n_plt,
104104
if fig is None or axs is None:
105105
fig, axs = plt.subplots(nrows=1, ncols=n_plt, figsize=(14, 5), gridspec_kw={'width_ratios': 4 * n_plt})
106106

107-
if i_plt > len(axs)-1: # Error
107+
if i_plt > len(axs) - 1: # Error
108108
raise ValueError(f'The given increment of subplot ({i_plt+1}) '
109109
f'is larger than the total number of subplots ({len(axs)})')
110110

@@ -113,10 +113,10 @@ def raw_destripe(raw, fs, t0, i_plt, n_plt,
113113
destripe = voltage.destripe(raw, fs=fs)
114114
X = destripe[:, :int(DISPLAY_TIME * fs)].T
115115
Xs = X[SAMPLE_SKIP:].T # Remove artifact at beginning
116-
Tplot = Xs.shape[1]/fs
116+
Tplot = Xs.shape[1] / fs
117117

118118
# PLOT RAW DATA
119-
d = Density(-Xs, fs=fs, taxis=1, ax=axs[i_plt], vmin=MIN_X, vmax=MAX_X, cmap='Greys')
119+
d = Density(-Xs, fs=fs, taxis=1, ax=axs[i_plt], vmin=MIN_X, vmax=MAX_X, cmap='Greys') # noqa
120120
axs[i_plt].set_ylabel('')
121121
axs[i_plt].set_xlim((0, Tplot * 1e3))
122122
axs[i_plt].set_ylim((0, nc))

0 commit comments

Comments
 (0)