diff --git a/CHANGELOG.md b/CHANGELOG.md index 628a7742..0e3593d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention. +## [0.4.2] - 2025-03-25 + ++ Fix - Add key_source to `ProbeLevelReport` to filter for 'good' quality units + ## [0.4.1] - 2025-02-13 + Fix - Auto generate ProbeInsertion allows duplicate probes (e.g. probe reuse) diff --git a/element_array_ephys/ephys_report.py b/element_array_ephys/ephys_report.py index 0c6836a0..819772ba 100644 --- a/element_array_ephys/ephys_report.py +++ b/element_array_ephys/ephys_report.py @@ -50,6 +50,12 @@ class ProbeLevelReport(dj.Computed): --- drift_map_plot: attach """ + + @property + def key_source(self): + return ephys.CuratedClustering & ( + ephys.CuratedClustering.Unit & "cluster_quality_label='good'" + ) def make(self, key): from .plotting.probe_level import plot_driftmap diff --git a/element_array_ephys/spike_sorting/si_spike_sorting.py b/element_array_ephys/spike_sorting/si_spike_sorting.py index e3e797b6..a324afa3 100644 --- a/element_array_ephys/spike_sorting/si_spike_sorting.py +++ b/element_array_ephys/spike_sorting/si_spike_sorting.py @@ -275,7 +275,7 @@ def make(self, key): postprocessing_params = params["SI_POSTPROCESSING_PARAMS"] - job_kwargs = postprocessing_params.get( + job_kwargs = postprocessing_params.pop( "job_kwargs", {"n_jobs": -1, "chunk_duration": "1s"} ) @@ -366,7 +366,7 @@ def make(self, key): postprocessing_params = params["SI_POSTPROCESSING_PARAMS"] - job_kwargs = postprocessing_params.get( + job_kwargs = postprocessing_params.pop( "job_kwargs", {"n_jobs": -1, "chunk_duration": "1s"} ) @@ -383,6 +383,8 @@ def _export_to_phy(): sorting_analyzer=sorting_analyzer, output_folder=analyzer_output_dir / "phy", use_relative_path=True, + remove_if_exists=True, + copy_binary=True, **job_kwargs, ) @@ -395,6 +397,7 @@ def _export_report(): si.exporters.export_report( sorting_analyzer=sorting_analyzer, output_folder=analyzer_output_dir / "spikeinterface_report", + remove_if_exists=True, **job_kwargs, ) diff --git a/element_array_ephys/version.py b/element_array_ephys/version.py index 0f62035b..ae202a66 100644 --- a/element_array_ephys/version.py +++ b/element_array_ephys/version.py @@ -1,3 +1,3 @@ """Package metadata.""" -__version__ = "0.4.1" +__version__ = "0.4.2"