Skip to content

Commit eed1eee

Browse files
committed
Cleanup
1 parent c31c53d commit eed1eee

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

element_array_ephys/ephys_report.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ class QualityMetricCutoffs(dj.Lookup):
149149

150150
contents = [(0, None, None, None), (1, 0.1, 0.9, 0.5)]
151151

152+
@classmethod
152153
def insert_new_cutoffs(
153154
cls,
154155
cutoffs_id: int = None,

element_array_ephys/plotting/qc.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,31 +83,24 @@ def cutoffs(self) -> dict:
8383
)
8484

8585
@cutoffs.setter
86-
def cutoffs(self, add_to_tables: bool = False, **cutoff_kwargs):
86+
def cutoffs(self, cutoff_dict):
8787
"""Use class_instance.cutoffs = dict(var=cutoff) to adjust cutoffs
8888
89-
If add_to_tables=True, adds to the QualityMetricCutoffs/Set tables
90-
9189
Args:
92-
add_to_tables (bool, optional): add to ephys_report tables. Default False
93-
cutoff_kwargs (kwargs): Cutoffs to adjust: amplitude_cutoff_maximum,
90+
cutoff_dict (kwargs): Cutoffs to adjust: amplitude_cutoff_maximum,
9491
presence_ratio_minimum, and/or isi_violations_maximum
9592
"""
96-
self._amplitude_cutoff_max = cutoff_kwargs.get(
93+
self._amplitude_cutoff_max = cutoff_dict.get(
9794
"amplitude_cutoff_maximum", self._amplitude_cutoff_max
9895
)
99-
self._presence_ratio_min = cutoff_kwargs.get(
96+
self._presence_ratio_min = cutoff_dict.get(
10097
"presence_ratio_minimum", self._presence_ratio_min
10198
)
102-
self._isi_violations_max = cutoff_kwargs.get(
99+
self._isi_violations_max = cutoff_dict.get(
103100
"isi_violations_maximum", self._isi_violations_max
104101
)
105102
_ = self.units
106103

107-
if add_to_tables:
108-
ephys_report.QualityMetricCutoffs.insert_new_cutoffs(**cutoff_kwargs)
109-
logger.info("Added cutoffs to QualityMetricCutoffs table")
110-
111104
@property
112105
def units(self) -> pd.DataFrame:
113106
"""Pandas dataframe of QC metrics"""

0 commit comments

Comments
 (0)