Conversation
| raise ValueError("Empty masks") | ||
| elif len(masks) == 1: | ||
| roi_mask = masks[0] |
There was a problem hiding this comment.
if len(masks) == 0:
roi_mask = masks[0]
did not make sense as it would throw an index error.
| ignore_map[:cut_x[0], :] = True | ||
| ignore_map[nx - cut_x[1]:, :] = True | ||
| ignore_map[:, cut_z[0]] = True | ||
| ignore_map[:, :cut_z[0]] = True |
There was a problem hiding this comment.
this previously did set the whole axis to True.
Now it's symmetric to how cut_x is used two lines above:
ignore_map[:cut_x[0], :] = True
| info_entry["prep"] = "wholemount" | ||
|
|
||
| eye = header_dict.get("eye", "unknown") | ||
| if 'eye' == '': |
There was a problem hiding this comment.
'eye' == '' did not make sense as it is always False
|
|
||
| for polarity_i in polarities: | ||
| if kind == 'gauss': | ||
| if kind == 'gauss' or kind == 'gaussian': |
There was a problem hiding this comment.
The default argument of the function for kind is gaussian:
def fit_rf_model(srf, kind='gaussian', polarity=None, center=None):
so we should either support it or change the default to kind='gauss'.
| std_trf = np.std(trf) | ||
|
|
||
| if (rf_time is not None) or (np.isfinite(max_dt_future)): | ||
| if (rf_time is not None) and (np.isfinite(max_dt_future)): |
There was a problem hiding this comment.
For
rf_time = None
max_dt_future = 42.0
Below line would have checked None > 42.0 which would result in the type error TypeError: '>' not supported between instances of 'NoneType' and 'float'
|
|
||
| frame_dt_offset = frame_dt_offset[npix_x_offset_left:-npix_x_offset_right] | ||
| npix_x_offset_right_idx = npix_x_offset_left if npix_x_offset_left > 0 else None | ||
| frame_dt_offset = frame_dt_offset[npix_x_offset_left:-npix_x_offset_right_idx] |
There was a problem hiding this comment.
for npix_x_offset_right_idx=0, you get something like
frame_dt_offset[...:0]
which works, but returns an empty array.
frame_dt_offset[0:None]
returns the full array, which is what we probably want for npix_x_offset_right_idx = 0.
|
|
||
| if not (ch_stack.shape[:2] in [(nxpix, nypix), (nxpix, nzpix)]): | ||
| ValueError(f'Stack shape error: {ch_stack.shape} not in [{(nxpix, nypix)}, {(nxpix, nzpix)}]') | ||
| raise ValueError(f'Stack shape error: {ch_stack.shape} not in [{(nxpix, nypix)}, {(nxpix, nzpix)}]') |
There was a problem hiding this comment.
the error was not raised before.
| stim_dict = (self.stimulus_tab & key).fetch1('stim_dict') | ||
|
|
||
| if ('pix_scale_x_um' not in stim_dict) or ('pix_scale_x_um' not in stim_dict): | ||
| if ('pix_scale_x_um' not in stim_dict) or ('pix_scale_y_um' not in stim_dict): |
There was a problem hiding this comment.
it previously checked twice if pix_scale_x_um is in the stim_dict.
These potential bugs were surfaced by AI, and fixed manually.