Skip to content

Commit c3ad36f

Browse files
authored
Merge branch 'datajoint:main' into main
2 parents 294d4f5 + 24df134 commit c3ad36f

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

element_array_ephys/ephys_acute.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,10 @@ def make(self, key):
841841
spikeglx_meta_filepath.parent
842842
)
843843
spikeglx_recording.validate_file("ap")
844+
run_CatGT = (
845+
params.pop("run_CatGT", True)
846+
and "_tcat." not in spikeglx_meta_filepath.stem
847+
)
844848

845849
if clustering_method.startswith("pykilosort"):
846850
kilosort_triggering.run_pykilosort(
@@ -861,7 +865,7 @@ def make(self, key):
861865
ks_output_dir=kilosort_dir,
862866
params=params,
863867
KS2ver=f'{Decimal(clustering_method.replace("kilosort", "")):.1f}',
864-
run_CatGT=True,
868+
run_CatGT=run_CatGT,
865869
)
866870
run_kilosort.run_modules()
867871
elif acq_software == "Open Ephys":

element_array_ephys/ephys_chronic.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,10 @@ def make(self, key):
772772
spikeglx_meta_filepath.parent
773773
)
774774
spikeglx_recording.validate_file("ap")
775+
run_CatGT = (
776+
params.pop("run_CatGT", True)
777+
and "_tcat." not in spikeglx_meta_filepath.stem
778+
)
775779

776780
if clustering_method.startswith("pykilosort"):
777781
kilosort_triggering.run_pykilosort(
@@ -792,7 +796,7 @@ def make(self, key):
792796
ks_output_dir=kilosort_dir,
793797
params=params,
794798
KS2ver=f'{Decimal(clustering_method.replace("kilosort", "")):.1f}',
795-
run_CatGT=True,
799+
run_CatGT=run_CatGT,
796800
)
797801
run_kilosort.run_modules()
798802
elif acq_software == "Open Ephys":

element_array_ephys/ephys_no_curation.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,10 @@ def make(self, key):
848848
spikeglx_meta_filepath.parent
849849
)
850850
spikeglx_recording.validate_file("ap")
851+
run_CatGT = (
852+
params.pop("run_CatGT", True)
853+
and "_tcat." not in spikeglx_meta_filepath.stem
854+
)
851855

852856
if clustering_method.startswith("pykilosort"):
853857
kilosort_triggering.run_pykilosort(
@@ -868,7 +872,7 @@ def make(self, key):
868872
ks_output_dir=kilosort_dir,
869873
params=params,
870874
KS2ver=f'{Decimal(clustering_method.replace("kilosort", "")):.1f}',
871-
run_CatGT=True,
875+
run_CatGT=run_CatGT,
872876
)
873877
run_kilosort.run_modules()
874878
elif acq_software == "Open Ephys":

element_array_ephys/readers/spikeglx.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,12 @@ def validate_file(self, file_type="ap"):
167167
file_path = self.root_dir / (self.root_name + f".{file_type}.bin")
168168
file_size = file_path.stat().st_size
169169

170-
meta_mapping = {"ap": self.apmeta, "lf": self.lfmeta}
171-
meta = meta_mapping[file_type]
170+
if file_type == "ap":
171+
meta = self.apmeta
172+
elif file_type == "lf":
173+
meta = self.lfmeta
174+
else:
175+
raise KeyError(f"Unknown file_type {file_type} - must be 'ap' or 'lf'")
172176

173177
if file_size != meta.meta["fileSizeBytes"]:
174178
raise IOError(

0 commit comments

Comments
 (0)