Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Magland committed Jan 4, 2024
1 parent 9dd9c81 commit c3d164a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/example_average_waveforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
2 changes: 1 addition & 1 deletion sortingview/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file was automatically generated by jinjaroot. Do not edit directly.
__version__ = '0.13.1'
__version__ = "0.13.1"
12 changes: 8 additions & 4 deletions sortingview/views/View.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand All @@ -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):
Expand Down Expand Up @@ -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)


Expand Down

0 comments on commit c3d164a

Please sign in to comment.