diff --git a/examples/example_average_waveforms.py b/examples/example_average_waveforms.py index e57ca70..ca622e7 100644 --- a/examples/example_average_waveforms.py +++ b/examples/example_average_waveforms.py @@ -67,7 +67,7 @@ def compute_average_waveform(*, recording: si.BaseRecording, sorting: si.BaseSor snippets = extract_snippets(traces=traces, times=times, snippet_len=(20, 20)) waveform = np.mean(snippets, axis=0).T.astype(np.float32) stdev = np.std(snippets, axis=0).T.astype(np.float32) - waveform_percentiles = np.percentile(snippets, [5, 25, 75, 95], axis=0) # type: ignore + waveform_percentiles = np.percentile(snippets, [5, 25, 75, 95], axis=0) # type: ignore waveform_percentiles = [waveform_percentiles[i].T.astype(np.float32) for i in range(4)] return {"channel_ids": recording.get_channel_ids().astype(np.int32), "waveform": waveform, "waveform_std_dev": stdev, "waveform_percentiles": waveform_percentiles} diff --git a/sortingview/version.py b/sortingview/version.py index 4f9f71c..618090e 100644 --- a/sortingview/version.py +++ b/sortingview/version.py @@ -1,2 +1,2 @@ # This file was automatically generated by jinjaroot. Do not edit directly. -__version__ = '0.13.1' \ No newline at end of file +__version__ = "0.13.1" diff --git a/sortingview/views/View.py b/sortingview/views/View.py index c785d63..c00bdf4 100644 --- a/sortingview/views/View.py +++ b/sortingview/views/View.py @@ -66,7 +66,7 @@ def get_descendant_views_including_self(self): ret.append(v) return ret - def url_dict(self, *, label: str, state: Union[dict, None] = None, allow_float64: bool=False): + def url_dict(self, *, label: str, state: Union[dict, None] = None, allow_float64: bool = False): from .Box import Box from .LayoutItem import LayoutItem @@ -78,7 +78,11 @@ def url_dict(self, *, label: str, state: Union[dict, None] = None, allow_float64 data = { "type": "MainLayout", "layout": self.to_dict(), - "views": [{"type": view.type, "viewId": view.id, "dataUri": _upload_data_and_return_uri(view.to_dict(), allow_float64=allow_float64)} for view in all_views if not view.is_layout], + "views": [ + {"type": view.type, "viewId": view.id, "dataUri": _upload_data_and_return_uri(view.to_dict(), allow_float64=allow_float64)} + for view in all_views + if not view.is_layout + ], } view_url = sortingview_view_url F = fig.Figure(view_url=view_url, data=data, allow_float64=allow_float64) @@ -93,7 +97,7 @@ def url_dict(self, *, label: str, state: Union[dict, None] = None, allow_float64 assert V.is_layout # avoid infinite recursion return V.url_dict(label=label, state=state, allow_float64=allow_float64) - def url(self, *, label: str, state: Union[dict, None] = None, allow_float64: bool=False): + def url(self, *, label: str, state: Union[dict, None] = None, allow_float64: bool = False): return fig.url_from_url_dict(self.url_dict(label=label, state=state, allow_float64=allow_float64)) def jupyter(self, *, height: Union[int, None] = None): @@ -145,7 +149,7 @@ def _on_message(self, message): self._sorting_curation = message.get("sortingCuration", {}) -def _upload_data_and_return_uri(data, *, local: bool = False, allow_float64: bool=False): +def _upload_data_and_return_uri(data, *, local: bool = False, allow_float64: bool = False): return kcl.store_json(fig.serialize_data(data, allow_float64=allow_float64), local=local)