Skip to content

Change 'min'/'max' to 'greater'/'less' when defining thresholds for threshold_metrics_label_units#4416

Open
ecobost wants to merge 2 commits intoSpikeInterface:mainfrom
ecobost:greater_less
Open

Change 'min'/'max' to 'greater'/'less' when defining thresholds for threshold_metrics_label_units#4416
ecobost wants to merge 2 commits intoSpikeInterface:mainfrom
ecobost:greater_less

Conversation

@ecobost
Copy link
Contributor

@ecobost ecobost commented Feb 27, 2026

This closes #4414

I also added a check to make sure that only valid keys are accepted inside the threshold dictionaries. Currently (in main):

sc.threshold_metrics_label_units(metrics=pd.DataFrame({"m1": [0.5]}), thresholds={"m1": {'greater': 1}}) # -> noise (correct)
sc.threshold_metrics_label_units(metrics=pd.DataFrame({"m1": [0.5]}), thresholds={"m1": {'greatr': 1}}) # -> good (wrong)

in this PR the second line will raise ValueError

@ecobost ecobost changed the title Change 'min'/ Change 'min'/'max' to 'greater'/'less' when defining thresholds for threshold_metrics_label_units Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change max/min keywords in threshold_metrics_label_units to greater/less

1 participant