Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
magland committed Apr 26, 2024
1 parent f0455a6 commit 8c08163
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions sortingview/SpikeSortingView/prepare_spikesortingview_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def prepare_spikesortingview_data(
bandpass_filter: bool = False,
) -> str:
# NOTE(DS): for data longer than 25hours with fs = 20000; num_frame is too large for int32
if recording.get_num_frames() > (2 ** 31 - 1):
if recording.get_num_frames() > (2**31 - 1):
int_type = np.int64
else:
int_type = np.int32
Expand Down Expand Up @@ -104,7 +104,7 @@ def prepare_spikesortingview_data(
start_frame_with_padding = max(start_frame - snippet_len[0], 0)
end_frame_with_padding = min(end_frame + snippet_len[1], num_frames)
traces_with_padding = recording.get_traces(start_frame=start_frame_with_padding, end_frame=end_frame_with_padding)
traces_sample = traces_with_padding[start_frame - start_frame_with_padding: start_frame - start_frame_with_padding + int(sampling_frequency * 1), :]
traces_sample = traces_with_padding[start_frame - start_frame_with_padding : start_frame - start_frame_with_padding + int(sampling_frequency * 1), :]
f.create_dataset(f"segment/{iseg}/traces_sample", data=traces_sample)
all_subsampled_spike_trains = []
for unit_id in unit_ids:
Expand Down Expand Up @@ -137,7 +137,7 @@ def prepare_spikesortingview_data(
channel_neighborhood = unit_channel_neighborhoods[str(unit_id)]
channel_neighborhood_indices = [channel_ids.tolist().index(ch_id) for ch_id in channel_neighborhood]
num = len(all_subsampled_spike_trains[ii])
spike_snippets = spike_snippets_concat[index: index + num, :, channel_neighborhood_indices]
spike_snippets = spike_snippets_concat[index : index + num, :, channel_neighborhood_indices]
index = index + num
f.create_dataset(f"segment/{iseg}/unit/{unit_id}/subsampled_spike_snippets", data=spike_snippets)
uri = kcl.store_file_local(output_file_name)
Expand Down Expand Up @@ -165,7 +165,7 @@ def subsample(x: np.ndarray, num: int):
if num >= len(x):
return x
stride = math.floor(len(x) / num)
return x[0: stride * num: stride]
return x[0 : stride * num : stride]


def extract_spike_snippets(*, traces: np.ndarray, times: np.ndarray, snippet_len: Tuple[int, int]):
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.3'
__version__ = "0.13.3"
4 changes: 2 additions & 2 deletions sortingview/views/TabLayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class TabLayout(View):
Tab layout
"""

def __init__(self, items: List[TabLayoutItem], tab_bar_layout: Literal['horizontal', 'vertical'] = 'horizontal', **kwargs) -> None:
def __init__(self, items: List[TabLayoutItem], tab_bar_layout: Literal["horizontal", "vertical"] = "horizontal", **kwargs) -> None:
super().__init__("TabLayout", is_layout=True, **kwargs)
self._items = items
self._tab_bar_layout = tab_bar_layout
Expand All @@ -22,7 +22,7 @@ def to_dict(self) -> dict:
ret = {
"type": self.type,
"items": [item.view.to_dict() if item.view.is_layout else {"type": "View", "viewId": item.view.id} for item in self._items],
"itemProperties": [{"label": item.label} for item in self._items]
"itemProperties": [{"label": item.label} for item in self._items],
}
if self._tab_bar_layout != "horizontal":
ret["tabBarLayout"] = self._tab_bar_layout
Expand Down

0 comments on commit 8c08163

Please sign in to comment.