Skip to content

Commit f4dc4a3

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 01dd054 commit f4dc4a3

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

src/spikeinterface/core/sortinganalyzer.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ def create_binary_folder(
744744
sorting_analyzer = SortingAnalyzer(
745745
sorting=sorting,
746746
recording=recording,
747-
rec_attributes={**rec_attributes_to_save, 'probegroup': probegroup},
747+
rec_attributes={**rec_attributes_to_save, "probegroup": probegroup},
748748
format="binary_folder",
749749
sparsity=sparsity,
750750
return_in_uV=return_in_uV,
@@ -915,10 +915,11 @@ def load_from_binary_folder(
915915
probegroup_file = folder / "recording_info" / "probegroup.json"
916916

917917
# Check all required files are present
918-
if not (settings_file.is_file() and sorting_folder.is_dir() and
919-
rec_attributes_file.is_file()):
920-
raise ValueError(f"Folder {folder} is not a valid SortingAnalyzer binary folder."
921-
" Please ensure that you are loading a valid SortingAnalyzer folder.")
918+
if not (settings_file.is_file() and sorting_folder.is_dir() and rec_attributes_file.is_file()):
919+
raise ValueError(
920+
f"Folder {folder} is not a valid SortingAnalyzer binary folder."
921+
" Please ensure that you are loading a valid SortingAnalyzer folder."
922+
)
922923

923924
# Load settings file
924925
with open(settings_file, "r") as f:
@@ -1081,7 +1082,7 @@ def create_zarr(
10811082
sorting_analyzer = SortingAnalyzer(
10821083
sorting=NumpySorting.from_sorting(sorting, with_metadata=True, copy_spike_vector=True),
10831084
recording=recording,
1084-
rec_attributes={**rec_attributes_to_save, 'probegroup': probegroup},
1085+
rec_attributes={**rec_attributes_to_save, "probegroup": probegroup},
10851086
format="zarr",
10861087
sparsity=sparsity,
10871088
return_in_uV=return_in_uV,
@@ -1125,12 +1126,16 @@ def load_from_zarr(
11251126
)
11261127

11271128
# Check all required inputs exist
1128-
if (zarr_root.attrs.get("settings") is None or zarr_root.get("sorting") is None
1129+
if (
1130+
zarr_root.attrs.get("settings") is None
1131+
or zarr_root.get("sorting") is None
11291132
or zarr_root.get("recording_info") is None
11301133
or zarr_root["recording_info"].attrs.get("recording_attributes") is None
11311134
):
1132-
raise ValueError(f"Folder {folder} is not a valid SortingAnalyzer Zarr folder."
1133-
" Please ensure that you are loading a valid SortingAnalyzer folder.")
1135+
raise ValueError(
1136+
f"Folder {folder} is not a valid SortingAnalyzer Zarr folder."
1137+
" Please ensure that you are loading a valid SortingAnalyzer folder."
1138+
)
11341139

11351140
# Load settings
11361141
settings = zarr_root.attrs["settings"]

0 commit comments

Comments
 (0)