DARTsort 0.5.16__tar.gz → 0.5.18__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. {dartsort-0.5.16 → dartsort-0.5.18}/.github/workflows/ci.yml +1 -0
  2. {dartsort-0.5.16 → dartsort-0.5.18}/PKG-INFO +35 -37
  3. {dartsort-0.5.16 → dartsort-0.5.18}/README.md +34 -36
  4. {dartsort-0.5.16 → dartsort-0.5.18}/docs/index.md +34 -36
  5. {dartsort-0.5.16 → dartsort-0.5.18}/pyproject.toml +4 -1
  6. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/__init__.py +0 -1
  7. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/clustering/agglomerate.py +0 -1
  8. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/clustering/clustering.py +1 -6
  9. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/clustering/clustering_features.py +2 -4
  10. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/clustering/density.py +16 -12
  11. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/clustering/merge.py +1 -1
  12. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/clustering/mixture.py +12 -11
  13. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/clustering/refine_util.py +6 -59
  14. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/config.py +6 -8
  15. dartsort-0.5.18/src/dartsort/detect/__init__.py +3 -0
  16. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/detect/detect.py +124 -15
  17. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/evaluate/comparison.py +83 -82
  18. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/evaluate/hybrid_util.py +8 -6
  19. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/localize/localize_torch.py +6 -5
  20. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/main.py +38 -22
  21. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/peel/grab.py +6 -5
  22. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/peel/matching.py +22 -141
  23. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/peel/matching_util/compressed_upsampled.py +25 -203
  24. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/peel/matching_util/drifty.py +16 -24
  25. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/peel/matching_util/matching_base.py +213 -75
  26. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/peel/peel_base.py +33 -35
  27. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/peel/peel_lib.py +48 -136
  28. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/peel/subtract.py +3 -8
  29. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/peel/threshold.py +0 -2
  30. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/_multichan_denoiser_kit.py +22 -3
  31. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/amortized_localization.py +19 -15
  32. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/decollider.py +15 -2
  33. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/mixture_classifier.py +4 -1
  34. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/whiten.py +4 -1
  35. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/data_util.py +175 -86
  36. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/drift_util.py +3 -3
  37. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/internal_config.py +16 -28
  38. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/interpolation_util.py +17 -16
  39. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/main_util.py +50 -14
  40. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/motion.py +12 -12
  41. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/noise_util.py +8 -208
  42. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/peel_util.py +7 -2
  43. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/preprocess_util.py +49 -0
  44. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/spiketorch.py +34 -4
  45. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/testing_util/matching_debug_util.py +23 -28
  46. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/testing_util/mixture_testing_util.py +0 -3
  47. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/waveform_util.py +17 -23
  48. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/vis/analysis_plots.py +0 -5
  49. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/vis/mixture.py +44 -26
  50. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/vis/unit.py +0 -1
  51. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/vis/vismain.py +18 -6
  52. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort.egg-info/PKG-INFO +35 -37
  53. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort.egg-info/SOURCES.txt +0 -1
  54. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_alignment.py +6 -8
  55. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_dartsort.py +21 -5
  56. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_data_util.py +1 -0
  57. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_detect.py +6 -12
  58. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_matching.py +15 -14
  59. dartsort-0.5.16/src/dartsort/detect/__init__.py +0 -3
  60. dartsort-0.5.16/src/dartsort/detect/detect_filters.py +0 -36
  61. {dartsort-0.5.16 → dartsort-0.5.18}/.github/workflows/ci_windows.yml +0 -0
  62. {dartsort-0.5.16 → dartsort-0.5.18}/.github/workflows/deploy.yml +0 -0
  63. {dartsort-0.5.16 → dartsort-0.5.18}/.github/workflows/docs.yml +0 -0
  64. {dartsort-0.5.16 → dartsort-0.5.18}/.gitignore +0 -0
  65. {dartsort-0.5.16 → dartsort-0.5.18}/docs/main_api.md +0 -0
  66. {dartsort-0.5.16 → dartsort-0.5.18}/docs/toolkit_api.md +0 -0
  67. {dartsort-0.5.16 → dartsort-0.5.18}/environment.yml +0 -0
  68. {dartsort-0.5.16 → dartsort-0.5.18}/notebook/.keep +0 -0
  69. {dartsort-0.5.16 → dartsort-0.5.18}/notebook/ibl_dandi_example.py +0 -0
  70. {dartsort-0.5.16 → dartsort-0.5.18}/setup.cfg +0 -0
  71. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/cli.py +0 -0
  72. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/clustering/__init__.py +0 -0
  73. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/clustering/cluster_util.py +0 -0
  74. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/clustering/forward_backward.py +0 -0
  75. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/clustering/kmeans.py +0 -0
  76. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/clustering/modes.py +0 -0
  77. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/evaluate/__init__.py +0 -0
  78. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/evaluate/analysis.py +0 -0
  79. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/evaluate/noise_recording_tools.py +0 -0
  80. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/evaluate/sim_template_tools.py +0 -0
  81. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/evaluate/simkit.py +0 -0
  82. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/evaluate/simlib.py +0 -0
  83. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/localize/__init__.py +0 -0
  84. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/localize/localize_util.py +0 -0
  85. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/peel/__init__.py +0 -0
  86. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/peel/matching_util/__init__.py +0 -0
  87. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/peel/matching_util/pairwise.py +0 -0
  88. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/peel/matching_util/pairwise_util.py +0 -0
  89. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/peel/reduction_template.py +0 -0
  90. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/peel/shaver.py +0 -0
  91. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/pretrained/default_temporal_kernel.npy +0 -0
  92. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/pretrained/detect_np1.pt +0 -0
  93. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/pretrained/detect_np2.pt +0 -0
  94. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/pretrained/glasbey1024.npz +0 -0
  95. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/pretrained/offset_trained_denoiser.pt +0 -0
  96. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/pretrained/offset_trained_denoiser_added_temp.pt +0 -0
  97. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/pretrained/offset_trained_denoiser_added_temp_boost.pt +0 -0
  98. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/pretrained/original_single_chan_denoiser.pt +0 -0
  99. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/pretrained/single_chan_denoiser.pt +0 -0
  100. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/templates/__init__.py +0 -0
  101. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/templates/get_templates.py +0 -0
  102. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/templates/postprocess_util.py +0 -0
  103. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/templates/realignment.py +0 -0
  104. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/templates/template_util.py +0 -0
  105. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/templates/templates.py +0 -0
  106. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/templates/templib.py +0 -0
  107. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/__init__.py +0 -0
  108. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/all_transformers.py +0 -0
  109. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/amplitudes.py +0 -0
  110. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/denoising_scorer.py +0 -0
  111. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/enforce_decrease.py +0 -0
  112. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/fixed_prop.py +0 -0
  113. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/interp.py +0 -0
  114. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/localize.py +0 -0
  115. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/matching_denoiser.py +0 -0
  116. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/pipeline.py +0 -0
  117. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/reduction.py +0 -0
  118. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/single_channel_denoiser.py +0 -0
  119. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/supervised_denoiser.py +0 -0
  120. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/temporal_pca.py +0 -0
  121. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/transform/transform_base.py +0 -0
  122. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/__init__.py +0 -0
  123. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/cli_util.py +0 -0
  124. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/job_util.py +0 -0
  125. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/logging_util.py +0 -0
  126. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/more_operators.py +0 -0
  127. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/multiprocessing_util.py +0 -0
  128. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/nn_util.py +0 -0
  129. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/py_util.py +0 -0
  130. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/registration_util.py +0 -0
  131. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/residual_util.py +0 -0
  132. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/sparse_util.py +0 -0
  133. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/spikeio.py +0 -0
  134. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/testing_util/__init__.py +0 -0
  135. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/torch_optimization_util.py +0 -0
  136. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/util/torch_util.py +0 -0
  137. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/vis/__init__.py +0 -0
  138. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/vis/colors.py +0 -0
  139. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/vis/gt.py +0 -0
  140. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/vis/layout.py +0 -0
  141. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/vis/metrics_util.py +0 -0
  142. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/vis/recanim.py +0 -0
  143. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/vis/scatterplots.py +0 -0
  144. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/vis/sorting.py +0 -0
  145. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/vis/unit_comparison.py +0 -0
  146. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/vis/versus.py +0 -0
  147. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort/vis/waveforms.py +0 -0
  148. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort.egg-info/dependency_links.txt +0 -0
  149. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort.egg-info/entry_points.txt +0 -0
  150. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort.egg-info/requires.txt +0 -0
  151. {dartsort-0.5.16 → dartsort-0.5.18}/src/dartsort.egg-info/top_level.txt +0 -0
  152. {dartsort-0.5.16 → dartsort-0.5.18}/tests/conftest.py +0 -0
  153. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_agglomerate.py +0 -0
  154. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_cluster_util.py +0 -0
  155. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_clustering.py +0 -0
  156. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_config.py +0 -0
  157. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_density.py +0 -0
  158. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_drift_util.py +0 -0
  159. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_drifty_matching.py +0 -0
  160. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_enforce_decrease.py +0 -0
  161. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_grab_and_featurize.py +0 -0
  162. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_kmeans.py +0 -0
  163. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_linalg.py +0 -0
  164. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_localize_torch.py +0 -0
  165. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_mixture_classifier.py +0 -0
  166. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_modeling.py +0 -0
  167. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_simkit.py +0 -0
  168. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_spiketorch.py +0 -0
  169. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_subtract.py +0 -0
  170. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_templates.py +0 -0
  171. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_threshold.py +0 -0
  172. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_torch_optimization_util.py +0 -0
  173. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_transform.py +0 -0
  174. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_util.py +0 -0
  175. {dartsort-0.5.16 → dartsort-0.5.18}/tests/test_waveform_util.py +0 -0
  176. {dartsort-0.5.16 → dartsort-0.5.18}/zensical.toml +0 -0
@@ -46,3 +46,4 @@ jobs:
46
46
  uses: coverallsapp/github-action@master
47
47
  with:
48
48
  path-to-lcov: coverage.lcov
49
+ fail-on-error: false
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dartsort
3
- Version: 0.5.16
3
+ Version: 0.5.18
4
4
  Summary: DARTsort
5
5
  Author-email: Charlie Windolf <ciw2048@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/cwindolf/dartsort
@@ -49,25 +49,21 @@ Requires-Dist: matplotlib-venn; extra == "vis"
49
49
  [![Zenodo DOI](https://zenodo.org/badge/421108722.svg)](https://doi.org/10.5281/zenodo.16943074)
50
50
  [![pypi: dartsort](https://img.shields.io/pypi/v/dartsort?label=pypi:%20dartsort)](https://pypi.org/p/dartsort)
51
51
 
52
-
53
52
  # dartsort
54
53
 
55
-
56
- *dartsort* is a modular spike sorter built around a statistical clustering model and a new approach to probe motion.
54
+ _dartsort_ is a modular spike sorter built around a statistical clustering model and a new approach to probe motion.
57
55
  It is also a toolkit of modules for building spike sorters and other analyses of electrophysiology data.
58
56
 
59
-
60
57
  ## :warning: work in progress :warning:
61
58
 
62
59
  We do not currently recommend DARTsort for production spike sorting purposes.
63
60
  Please feel free to open an issue or a discussion if you run into problems.
64
61
 
65
-
66
62
  ## Installation
67
63
 
68
64
  ### Installing into an existing environment
69
65
 
70
- If you already have a Python environment with PyTorch working and you just want to install *dartsort* there, use
66
+ If you already have a Python environment with PyTorch working and you just want to install _dartsort_ there, use
71
67
 
72
68
  ```sh
73
69
  $ pip install dartsort
@@ -81,18 +77,17 @@ If you need to set up Python or PyTorch, I find that a [`conda-forge`](https://c
81
77
 
82
78
  You can use `conda-forge` to install Python, `dartsort`, and its dependencies as follows:
83
79
 
84
- - Follow the `conda-forge` installation instructions for your platform at [https://conda-forge.org/download/](https://conda-forge.org/download/)
85
- - Create an environment with
80
+ - Follow the `conda-forge` installation instructions for your platform at [https://conda-forge.org/download/](https://conda-forge.org/download/)
81
+ - Create an environment with
86
82
  ```sh
87
83
  $ mamba env create -f environment.yml
88
84
  ```
89
85
  This will create an environment called `dartsort`, but you can change the name by adding `-n othername`.
90
- - Activate the environment:
86
+ - Activate the environment:
91
87
  ```sh
92
88
  $ mamba activate dartsort
93
89
  ```
94
- - Install `dartsort` and the rest of its dependencies by running the pip command [above](#installing-into-an-existing-environment)
95
-
90
+ - Install `dartsort` and the rest of its dependencies by running the pip command [above](#installing-into-an-existing-environment)
96
91
 
97
92
  ## Usage
98
93
 
@@ -100,7 +95,7 @@ For more detailed documentation of the main function parameters and configuratio
100
95
 
101
96
  ### As a Python function
102
97
 
103
- *dartsort* can be run in Python with:
98
+ _dartsort_ can be run in Python with:
104
99
 
105
100
  ```python
106
101
  import dartsort
@@ -120,46 +115,50 @@ dartsort_result = dartsort.dartsort(
120
115
  ```
121
116
 
122
117
  **Please** read the [important configuration details section](#important-configuration-details) below for information on the parameters of the `DARTsortUserConfig`.
123
- Some of them, like `preprocessing`, are not set by default and need your input!
124
- (This will probably change.)
118
+ In particular, you will most likely need to set the `preprocessing` flag.
125
119
 
126
120
  Here, `recording` is a [SpikeInterface][SpikeInterface] recording object (see their tutorial on [reading various recording formats](https://spikeinterface.readthedocs.io/en/stable/how_to/read_various_formats.html)).
127
- `output_dir` is the folder where *dartsort* will save its output.
121
+ `output_dir` is the folder where _dartsort_ will save its output.
128
122
  There are more details on these and the rest of the arguments in the [main API documentation](main_api.md).
129
123
 
130
- Once you've run *dartsort*, you might want to check out [the outputs and exporting](#outputs-and-exporting) section below.
124
+ Once you've run _dartsort_, you might want to check out [the outputs and exporting](#outputs-and-exporting) section below.
131
125
 
132
126
  ### Important configuration details
133
127
 
134
- Before running *dartsort*, please be aware of the following important configuration options.
128
+ Before running _dartsort_, please be aware of the following important configuration options.
135
129
 
136
- - `preprocessing`: *dartsort* won't touch your data by default (`preprocessing="none"`), leaving you free to implement your own preprocessing in SpikeInterface or otherwise. However, *dartsort* expects standardized input, and therefore it will explode if you don't set this flag and your data is in its original state (for instance, the raw `int16` data off the probe).
137
- - For a cheap but sensible default, try `preprocessing="ibllikecmr"`, which applies a pipeline similar to that of [the IBL][iblsorting] but with global median common referencing instead of their spatial highpass filter. `preprocessing="ibllike"` will use their spatial highpass filter.
138
- - `do_motion_estimation=True` by default, but you may like to disable it if you know that there is (say) less than 5 microns of total drift in your recording, or if you have handled this in your own preprocessing.
139
- - `work_in_tmpdir` and `copy_recording_to_tmpdir` can be helpful in some cases where slow network drives are involved.
130
+ - `preprocessing`: _dartsort_ doesn't preprocess your data by default (for now, `preprocessing="none"` by default), but this will change.
131
+ - An easy choice is `preprocessing="ibllikecmr"`, which is a lightweight version of [the IBL's strategy][iblsorting], replacing their highpass spatial filter with a common median reference.
132
+ - If you've already preprocessed your data, use `"none"` instead, or `"standardize"` if your preprocessing did not include a standardization step.
133
+ - An implementation of the full IBL strategy is available as `"ibllike"`.
134
+ - The `copy_recording_to_tmpdir` controls whether the recording is copied to a scratch directory for faster reading. It can be `True`, `False`, or `"if_preprocessing"` (the default). By default the recording is cached if `preprocessing` is something other than `"none"`.
135
+ - (The `tmpdir_parent` flag controls the scratch dir, which is your computer's default temporary folder if this is unset.)
136
+ - `do_motion_estimation=True` by default, but you may like to disable it if you know that there is (say) less than 5 microns of total drift in your recording, or if you have handled this in your own preprocessing.
137
+ - `work_in_tmpdir` can be helpful in some cases where slow network drives are involved.
140
138
 
141
139
  ### Outputs and exporting
142
140
 
143
141
  The `dartsort_result = dartsort(...)` function returns a dictionary `dartsort_result` containing a `DARTsortSorting` object: `sorting = dartsort_result["sorting"]`.
144
142
  This object has all the spike train data attached (as arrays under property names `.times_samples` and `.times_seconds` for spike times in samples and seconds, `.labels` for unit labels, and many others; `print(sorting)` to see some more).
145
143
 
146
- If you already ran *dartsort* and want to load the output spike trains, use `dartsort.load(output_dir)` to get the `DARTsortSorting` object.
144
+ If you already ran _dartsort_ and want to load the output spike trains, use `dartsort.load(output_dir)` to get the `DARTsortSorting` object.
147
145
 
148
146
  This object can also export itself to other formats:
149
147
 
150
- - For a SpikeInterface `NumpySorting` object, use `sorting.to_numpy_sorting()`
151
- - For a [Pynapple][Pynapple] `TsGroup`, use `sorting.to_tsgroup()`
152
- - To export to Phy, we currently suggest bridging through SpikeInterface. Start with `sorting.to_numpy_sorting()` and follow the instructions [in SpikeInterface's documentation](https://spikeinterface.readthedocs.io/en/stable/modules/exporters.html#exporting-to-phy) for first creating a `SortingAnalyzer` and then exporting that to Phy.
153
- - For a simple dictionary of numpy arrays, use `dict = sorting.spike_feature_dict`.
154
- - For pandas, use `sorting.to_pandas()`.
148
+ - For a SpikeInterface `NumpySorting` object, use `sorting.to_numpy_sorting()`
149
+ - For a [Pynapple][Pynapple] `TsGroup`, use `sorting.to_tsgroup()`
150
+ - To export to Phy, we currently suggest bridging through SpikeInterface. Start with `sorting.to_numpy_sorting()` and follow the instructions [in SpikeInterface's documentation](https://spikeinterface.readthedocs.io/en/stable/modules/exporters.html#exporting-to-phy) for first creating a `SortingAnalyzer` and then exporting that to Phy.
151
+ - For a simple dictionary of numpy arrays, use `dict = sorting.spike_feature_dict`.
152
+ - For pandas, use `sorting.to_pandas()`.
155
153
 
156
- *dartsort* also saves motion information, returned as `dartsort_result["motion"]` or loaded after the fact as `dartsort.try_load_motion_info(output_dir)`.
154
+ _dartsort_ also saves motion information, returned as `dartsort_result["motion"]` or loaded after the fact as `dartsort.try_load_motion_info(output_dir)`.
157
155
 
158
156
  The data is saved to `output_dir` in the following files:
159
- - `dartsort_sorting.npz`: This NPZ file contains the final spike train under the keys `times_samples`, `channels`, and `labels`.
160
- - `matching1.h5`: This HDF5 file contains spike features and other data from the last matching step. Amplitudes, localizations, and other features live in here; use `h5ls` on the command line to see what's in there. Be aware that the `labels` dataset in this HDF5 is not the same as what's saved in the `dartsort_sorting.npz`.
161
- - `motion_info.pkl` is a pickled `MotionInfo` object.
162
- - There may be a models/ folder containing PyTorch weights files with modeling quantities (for instance, featurization SVD bases, localization neural nets, Gaussian mixture model parameters). If you want to load these up, feel free to reach out for help.
157
+
158
+ - `dartsort_sorting.npz`: This NPZ file contains the final spike train under the keys `times_samples`, `channels`, and `labels`.
159
+ - `matching1.h5`: This HDF5 file contains spike features and other data from the last matching step. Amplitudes, localizations, and other features live in here; use `h5ls` on the command line to see what's in there. Be aware that the `labels` dataset in this HDF5 is not the same as what's saved in the `dartsort_sorting.npz`.
160
+ - `motion_info.pkl` is a pickled `MotionInfo` object.
161
+ - There may be a models/ folder containing PyTorch weights files with modeling quantities (for instance, featurization SVD bases, localization neural nets, Gaussian mixture model parameters). If you want to load these up, feel free to reach out for help.
163
162
 
164
163
  ### Visualization
165
164
 
@@ -190,7 +189,7 @@ Set `make_unit_summaries=True` to create a summary plot for each unit.
190
189
 
191
190
  ### Command-line interface
192
191
 
193
- Try running
192
+ Try running
194
193
 
195
194
  ```sh
196
195
  $ dartsort -h
@@ -206,9 +205,8 @@ If it's more of a data-related or methodology thing, feel free to use the email
206
205
 
207
206
  ## References
208
207
 
209
- - [SpikeInterface][SpikeInterface]
210
- - DREDge [on PyPI][dredge-pypi] and the DREDge [paper][dredge-nm] ([PDF link][dredge-rdcb]).
211
-
208
+ - [SpikeInterface][SpikeInterface]
209
+ - DREDge [on PyPI][dredge-pypi] and the DREDge [paper][dredge-nm] ([PDF link][dredge-rdcb]).
212
210
 
213
211
  [SpikeInterface]: https://spikeinterface.readthedocs.io
214
212
  [iblsorting]: https://figshare.com/articles/online_resource/Spike_sorting_pipeline_for_the_International_Brain_Laboratory/19705522
@@ -6,25 +6,21 @@
6
6
  [![Zenodo DOI](https://zenodo.org/badge/421108722.svg)](https://doi.org/10.5281/zenodo.16943074)
7
7
  [![pypi: dartsort](https://img.shields.io/pypi/v/dartsort?label=pypi:%20dartsort)](https://pypi.org/p/dartsort)
8
8
 
9
-
10
9
  # dartsort
11
10
 
12
-
13
- *dartsort* is a modular spike sorter built around a statistical clustering model and a new approach to probe motion.
11
+ _dartsort_ is a modular spike sorter built around a statistical clustering model and a new approach to probe motion.
14
12
  It is also a toolkit of modules for building spike sorters and other analyses of electrophysiology data.
15
13
 
16
-
17
14
  ## :warning: work in progress :warning:
18
15
 
19
16
  We do not currently recommend DARTsort for production spike sorting purposes.
20
17
  Please feel free to open an issue or a discussion if you run into problems.
21
18
 
22
-
23
19
  ## Installation
24
20
 
25
21
  ### Installing into an existing environment
26
22
 
27
- If you already have a Python environment with PyTorch working and you just want to install *dartsort* there, use
23
+ If you already have a Python environment with PyTorch working and you just want to install _dartsort_ there, use
28
24
 
29
25
  ```sh
30
26
  $ pip install dartsort
@@ -38,18 +34,17 @@ If you need to set up Python or PyTorch, I find that a [`conda-forge`](https://c
38
34
 
39
35
  You can use `conda-forge` to install Python, `dartsort`, and its dependencies as follows:
40
36
 
41
- - Follow the `conda-forge` installation instructions for your platform at [https://conda-forge.org/download/](https://conda-forge.org/download/)
42
- - Create an environment with
37
+ - Follow the `conda-forge` installation instructions for your platform at [https://conda-forge.org/download/](https://conda-forge.org/download/)
38
+ - Create an environment with
43
39
  ```sh
44
40
  $ mamba env create -f environment.yml
45
41
  ```
46
42
  This will create an environment called `dartsort`, but you can change the name by adding `-n othername`.
47
- - Activate the environment:
43
+ - Activate the environment:
48
44
  ```sh
49
45
  $ mamba activate dartsort
50
46
  ```
51
- - Install `dartsort` and the rest of its dependencies by running the pip command [above](#installing-into-an-existing-environment)
52
-
47
+ - Install `dartsort` and the rest of its dependencies by running the pip command [above](#installing-into-an-existing-environment)
53
48
 
54
49
  ## Usage
55
50
 
@@ -57,7 +52,7 @@ For more detailed documentation of the main function parameters and configuratio
57
52
 
58
53
  ### As a Python function
59
54
 
60
- *dartsort* can be run in Python with:
55
+ _dartsort_ can be run in Python with:
61
56
 
62
57
  ```python
63
58
  import dartsort
@@ -77,46 +72,50 @@ dartsort_result = dartsort.dartsort(
77
72
  ```
78
73
 
79
74
  **Please** read the [important configuration details section](#important-configuration-details) below for information on the parameters of the `DARTsortUserConfig`.
80
- Some of them, like `preprocessing`, are not set by default and need your input!
81
- (This will probably change.)
75
+ In particular, you will most likely need to set the `preprocessing` flag.
82
76
 
83
77
  Here, `recording` is a [SpikeInterface][SpikeInterface] recording object (see their tutorial on [reading various recording formats](https://spikeinterface.readthedocs.io/en/stable/how_to/read_various_formats.html)).
84
- `output_dir` is the folder where *dartsort* will save its output.
78
+ `output_dir` is the folder where _dartsort_ will save its output.
85
79
  There are more details on these and the rest of the arguments in the [main API documentation](main_api.md).
86
80
 
87
- Once you've run *dartsort*, you might want to check out [the outputs and exporting](#outputs-and-exporting) section below.
81
+ Once you've run _dartsort_, you might want to check out [the outputs and exporting](#outputs-and-exporting) section below.
88
82
 
89
83
  ### Important configuration details
90
84
 
91
- Before running *dartsort*, please be aware of the following important configuration options.
85
+ Before running _dartsort_, please be aware of the following important configuration options.
92
86
 
93
- - `preprocessing`: *dartsort* won't touch your data by default (`preprocessing="none"`), leaving you free to implement your own preprocessing in SpikeInterface or otherwise. However, *dartsort* expects standardized input, and therefore it will explode if you don't set this flag and your data is in its original state (for instance, the raw `int16` data off the probe).
94
- - For a cheap but sensible default, try `preprocessing="ibllikecmr"`, which applies a pipeline similar to that of [the IBL][iblsorting] but with global median common referencing instead of their spatial highpass filter. `preprocessing="ibllike"` will use their spatial highpass filter.
95
- - `do_motion_estimation=True` by default, but you may like to disable it if you know that there is (say) less than 5 microns of total drift in your recording, or if you have handled this in your own preprocessing.
96
- - `work_in_tmpdir` and `copy_recording_to_tmpdir` can be helpful in some cases where slow network drives are involved.
87
+ - `preprocessing`: _dartsort_ doesn't preprocess your data by default (for now, `preprocessing="none"` by default), but this will change.
88
+ - An easy choice is `preprocessing="ibllikecmr"`, which is a lightweight version of [the IBL's strategy][iblsorting], replacing their highpass spatial filter with a common median reference.
89
+ - If you've already preprocessed your data, use `"none"` instead, or `"standardize"` if your preprocessing did not include a standardization step.
90
+ - An implementation of the full IBL strategy is available as `"ibllike"`.
91
+ - The `copy_recording_to_tmpdir` controls whether the recording is copied to a scratch directory for faster reading. It can be `True`, `False`, or `"if_preprocessing"` (the default). By default the recording is cached if `preprocessing` is something other than `"none"`.
92
+ - (The `tmpdir_parent` flag controls the scratch dir, which is your computer's default temporary folder if this is unset.)
93
+ - `do_motion_estimation=True` by default, but you may like to disable it if you know that there is (say) less than 5 microns of total drift in your recording, or if you have handled this in your own preprocessing.
94
+ - `work_in_tmpdir` can be helpful in some cases where slow network drives are involved.
97
95
 
98
96
  ### Outputs and exporting
99
97
 
100
98
  The `dartsort_result = dartsort(...)` function returns a dictionary `dartsort_result` containing a `DARTsortSorting` object: `sorting = dartsort_result["sorting"]`.
101
99
  This object has all the spike train data attached (as arrays under property names `.times_samples` and `.times_seconds` for spike times in samples and seconds, `.labels` for unit labels, and many others; `print(sorting)` to see some more).
102
100
 
103
- If you already ran *dartsort* and want to load the output spike trains, use `dartsort.load(output_dir)` to get the `DARTsortSorting` object.
101
+ If you already ran _dartsort_ and want to load the output spike trains, use `dartsort.load(output_dir)` to get the `DARTsortSorting` object.
104
102
 
105
103
  This object can also export itself to other formats:
106
104
 
107
- - For a SpikeInterface `NumpySorting` object, use `sorting.to_numpy_sorting()`
108
- - For a [Pynapple][Pynapple] `TsGroup`, use `sorting.to_tsgroup()`
109
- - To export to Phy, we currently suggest bridging through SpikeInterface. Start with `sorting.to_numpy_sorting()` and follow the instructions [in SpikeInterface's documentation](https://spikeinterface.readthedocs.io/en/stable/modules/exporters.html#exporting-to-phy) for first creating a `SortingAnalyzer` and then exporting that to Phy.
110
- - For a simple dictionary of numpy arrays, use `dict = sorting.spike_feature_dict`.
111
- - For pandas, use `sorting.to_pandas()`.
105
+ - For a SpikeInterface `NumpySorting` object, use `sorting.to_numpy_sorting()`
106
+ - For a [Pynapple][Pynapple] `TsGroup`, use `sorting.to_tsgroup()`
107
+ - To export to Phy, we currently suggest bridging through SpikeInterface. Start with `sorting.to_numpy_sorting()` and follow the instructions [in SpikeInterface's documentation](https://spikeinterface.readthedocs.io/en/stable/modules/exporters.html#exporting-to-phy) for first creating a `SortingAnalyzer` and then exporting that to Phy.
108
+ - For a simple dictionary of numpy arrays, use `dict = sorting.spike_feature_dict`.
109
+ - For pandas, use `sorting.to_pandas()`.
112
110
 
113
- *dartsort* also saves motion information, returned as `dartsort_result["motion"]` or loaded after the fact as `dartsort.try_load_motion_info(output_dir)`.
111
+ _dartsort_ also saves motion information, returned as `dartsort_result["motion"]` or loaded after the fact as `dartsort.try_load_motion_info(output_dir)`.
114
112
 
115
113
  The data is saved to `output_dir` in the following files:
116
- - `dartsort_sorting.npz`: This NPZ file contains the final spike train under the keys `times_samples`, `channels`, and `labels`.
117
- - `matching1.h5`: This HDF5 file contains spike features and other data from the last matching step. Amplitudes, localizations, and other features live in here; use `h5ls` on the command line to see what's in there. Be aware that the `labels` dataset in this HDF5 is not the same as what's saved in the `dartsort_sorting.npz`.
118
- - `motion_info.pkl` is a pickled `MotionInfo` object.
119
- - There may be a models/ folder containing PyTorch weights files with modeling quantities (for instance, featurization SVD bases, localization neural nets, Gaussian mixture model parameters). If you want to load these up, feel free to reach out for help.
114
+
115
+ - `dartsort_sorting.npz`: This NPZ file contains the final spike train under the keys `times_samples`, `channels`, and `labels`.
116
+ - `matching1.h5`: This HDF5 file contains spike features and other data from the last matching step. Amplitudes, localizations, and other features live in here; use `h5ls` on the command line to see what's in there. Be aware that the `labels` dataset in this HDF5 is not the same as what's saved in the `dartsort_sorting.npz`.
117
+ - `motion_info.pkl` is a pickled `MotionInfo` object.
118
+ - There may be a models/ folder containing PyTorch weights files with modeling quantities (for instance, featurization SVD bases, localization neural nets, Gaussian mixture model parameters). If you want to load these up, feel free to reach out for help.
120
119
 
121
120
  ### Visualization
122
121
 
@@ -147,7 +146,7 @@ Set `make_unit_summaries=True` to create a summary plot for each unit.
147
146
 
148
147
  ### Command-line interface
149
148
 
150
- Try running
149
+ Try running
151
150
 
152
151
  ```sh
153
152
  $ dartsort -h
@@ -163,9 +162,8 @@ If it's more of a data-related or methodology thing, feel free to use the email
163
162
 
164
163
  ## References
165
164
 
166
- - [SpikeInterface][SpikeInterface]
167
- - DREDge [on PyPI][dredge-pypi] and the DREDge [paper][dredge-nm] ([PDF link][dredge-rdcb]).
168
-
165
+ - [SpikeInterface][SpikeInterface]
166
+ - DREDge [on PyPI][dredge-pypi] and the DREDge [paper][dredge-nm] ([PDF link][dredge-rdcb]).
169
167
 
170
168
  [SpikeInterface]: https://spikeinterface.readthedocs.io
171
169
  [iblsorting]: https://figshare.com/articles/online_resource/Spike_sorting_pipeline_for_the_International_Brain_Laboratory/19705522
@@ -6,25 +6,21 @@
6
6
  [![Zenodo DOI](https://zenodo.org/badge/421108722.svg)](https://doi.org/10.5281/zenodo.16943074)
7
7
  [![pypi: dartsort](https://img.shields.io/pypi/v/dartsort?label=pypi:%20dartsort)](https://pypi.org/p/dartsort)
8
8
 
9
-
10
9
  # dartsort
11
10
 
12
-
13
- *dartsort* is a modular spike sorter built around a statistical clustering model and a new approach to probe motion.
11
+ _dartsort_ is a modular spike sorter built around a statistical clustering model and a new approach to probe motion.
14
12
  It is also a toolkit of modules for building spike sorters and other analyses of electrophysiology data.
15
13
 
16
-
17
14
  ## :warning: work in progress :warning:
18
15
 
19
16
  We do not currently recommend DARTsort for production spike sorting purposes.
20
17
  Please feel free to open an issue or a discussion if you run into problems.
21
18
 
22
-
23
19
  ## Installation
24
20
 
25
21
  ### Installing into an existing environment
26
22
 
27
- If you already have a Python environment with PyTorch working and you just want to install *dartsort* there, use
23
+ If you already have a Python environment with PyTorch working and you just want to install _dartsort_ there, use
28
24
 
29
25
  ```sh
30
26
  $ pip install dartsort
@@ -38,18 +34,17 @@ If you need to set up Python or PyTorch, I find that a [`conda-forge`](https://c
38
34
 
39
35
  You can use `conda-forge` to install Python, `dartsort`, and its dependencies as follows:
40
36
 
41
- - Follow the `conda-forge` installation instructions for your platform at [https://conda-forge.org/download/](https://conda-forge.org/download/)
42
- - Create an environment with
37
+ - Follow the `conda-forge` installation instructions for your platform at [https://conda-forge.org/download/](https://conda-forge.org/download/)
38
+ - Create an environment with
43
39
  ```sh
44
40
  $ mamba env create -f environment.yml
45
41
  ```
46
42
  This will create an environment called `dartsort`, but you can change the name by adding `-n othername`.
47
- - Activate the environment:
43
+ - Activate the environment:
48
44
  ```sh
49
45
  $ mamba activate dartsort
50
46
  ```
51
- - Install `dartsort` and the rest of its dependencies by running the pip command [above](#installing-into-an-existing-environment)
52
-
47
+ - Install `dartsort` and the rest of its dependencies by running the pip command [above](#installing-into-an-existing-environment)
53
48
 
54
49
  ## Usage
55
50
 
@@ -57,7 +52,7 @@ For more detailed documentation of the main function parameters and configuratio
57
52
 
58
53
  ### As a Python function
59
54
 
60
- *dartsort* can be run in Python with:
55
+ _dartsort_ can be run in Python with:
61
56
 
62
57
  ```python
63
58
  import dartsort
@@ -77,46 +72,50 @@ dartsort_result = dartsort.dartsort(
77
72
  ```
78
73
 
79
74
  **Please** read the [important configuration details section](#important-configuration-details) below for information on the parameters of the `DARTsortUserConfig`.
80
- Some of them, like `preprocessing`, are not set by default and need your input!
81
- (This will probably change.)
75
+ In particular, you will most likely need to set the `preprocessing` flag.
82
76
 
83
77
  Here, `recording` is a [SpikeInterface][SpikeInterface] recording object (see their tutorial on [reading various recording formats](https://spikeinterface.readthedocs.io/en/stable/how_to/read_various_formats.html)).
84
- `output_dir` is the folder where *dartsort* will save its output.
78
+ `output_dir` is the folder where _dartsort_ will save its output.
85
79
  There are more details on these and the rest of the arguments in the [main API documentation](main_api.md).
86
80
 
87
- Once you've run *dartsort*, you might want to check out [the outputs and exporting](#outputs-and-exporting) section below.
81
+ Once you've run _dartsort_, you might want to check out [the outputs and exporting](#outputs-and-exporting) section below.
88
82
 
89
83
  ### Important configuration details
90
84
 
91
- Before running *dartsort*, please be aware of the following important configuration options.
85
+ Before running _dartsort_, please be aware of the following important configuration options.
92
86
 
93
- - `preprocessing`: *dartsort* won't touch your data by default (`preprocessing="none"`), leaving you free to implement your own preprocessing in SpikeInterface or otherwise. However, *dartsort* expects standardized input, and therefore it will explode if you don't set this flag and your data is in its original state (for instance, the raw `int16` data off the probe).
94
- - For a cheap but sensible default, try `preprocessing="ibllikecmr"`, which applies a pipeline similar to that of [the IBL][iblsorting] but with global median common referencing instead of their spatial highpass filter. `preprocessing="ibllike"` will use their spatial highpass filter.
95
- - `do_motion_estimation=True` by default, but you may like to disable it if you know that there is (say) less than 5 microns of total drift in your recording, or if you have handled this in your own preprocessing.
96
- - `work_in_tmpdir` and `copy_recording_to_tmpdir` can be helpful in some cases where slow network drives are involved.
87
+ - `preprocessing`: _dartsort_ doesn't preprocess your data by default (for now, `preprocessing="none"` by default), but this will change.
88
+ - An easy choice is `preprocessing="ibllikecmr"`, which is a lightweight version of [the IBL's strategy][iblsorting], replacing their highpass spatial filter with a common median reference.
89
+ - If you've already preprocessed your data, use `"none"` instead, or `"standardize"` if your preprocessing did not include a standardization step.
90
+ - An implementation of the full IBL strategy is available as `"ibllike"`.
91
+ - The `copy_recording_to_tmpdir` controls whether the recording is copied to a scratch directory for faster reading. It can be `True`, `False`, or `"if_preprocessing"` (the default). By default the recording is cached if `preprocessing` is something other than `"none"`.
92
+ - (The `tmpdir_parent` flag controls the scratch dir, which is your computer's default temporary folder if this is unset.)
93
+ - `do_motion_estimation=True` by default, but you may like to disable it if you know that there is (say) less than 5 microns of total drift in your recording, or if you have handled this in your own preprocessing.
94
+ - `work_in_tmpdir` can be helpful in some cases where slow network drives are involved.
97
95
 
98
96
  ### Outputs and exporting
99
97
 
100
98
  The `dartsort_result = dartsort(...)` function returns a dictionary `dartsort_result` containing a `DARTsortSorting` object: `sorting = dartsort_result["sorting"]`.
101
99
  This object has all the spike train data attached (as arrays under property names `.times_samples` and `.times_seconds` for spike times in samples and seconds, `.labels` for unit labels, and many others; `print(sorting)` to see some more).
102
100
 
103
- If you already ran *dartsort* and want to load the output spike trains, use `dartsort.load(output_dir)` to get the `DARTsortSorting` object.
101
+ If you already ran _dartsort_ and want to load the output spike trains, use `dartsort.load(output_dir)` to get the `DARTsortSorting` object.
104
102
 
105
103
  This object can also export itself to other formats:
106
104
 
107
- - For a SpikeInterface `NumpySorting` object, use `sorting.to_numpy_sorting()`
108
- - For a [Pynapple][Pynapple] `TsGroup`, use `sorting.to_tsgroup()`
109
- - To export to Phy, we currently suggest bridging through SpikeInterface. Start with `sorting.to_numpy_sorting()` and follow the instructions [in SpikeInterface's documentation](https://spikeinterface.readthedocs.io/en/stable/modules/exporters.html#exporting-to-phy) for first creating a `SortingAnalyzer` and then exporting that to Phy.
110
- - For a simple dictionary of numpy arrays, use `dict = sorting.spike_feature_dict`.
111
- - For pandas, use `sorting.to_pandas()`.
105
+ - For a SpikeInterface `NumpySorting` object, use `sorting.to_numpy_sorting()`
106
+ - For a [Pynapple][Pynapple] `TsGroup`, use `sorting.to_tsgroup()`
107
+ - To export to Phy, we currently suggest bridging through SpikeInterface. Start with `sorting.to_numpy_sorting()` and follow the instructions [in SpikeInterface's documentation](https://spikeinterface.readthedocs.io/en/stable/modules/exporters.html#exporting-to-phy) for first creating a `SortingAnalyzer` and then exporting that to Phy.
108
+ - For a simple dictionary of numpy arrays, use `dict = sorting.spike_feature_dict`.
109
+ - For pandas, use `sorting.to_pandas()`.
112
110
 
113
- *dartsort* also saves motion information, returned as `dartsort_result["motion"]` or loaded after the fact as `dartsort.try_load_motion_info(output_dir)`.
111
+ _dartsort_ also saves motion information, returned as `dartsort_result["motion"]` or loaded after the fact as `dartsort.try_load_motion_info(output_dir)`.
114
112
 
115
113
  The data is saved to `output_dir` in the following files:
116
- - `dartsort_sorting.npz`: This NPZ file contains the final spike train under the keys `times_samples`, `channels`, and `labels`.
117
- - `matching1.h5`: This HDF5 file contains spike features and other data from the last matching step. Amplitudes, localizations, and other features live in here; use `h5ls` on the command line to see what's in there. Be aware that the `labels` dataset in this HDF5 is not the same as what's saved in the `dartsort_sorting.npz`.
118
- - `motion_info.pkl` is a pickled `MotionInfo` object.
119
- - There may be a models/ folder containing PyTorch weights files with modeling quantities (for instance, featurization SVD bases, localization neural nets, Gaussian mixture model parameters). If you want to load these up, feel free to reach out for help.
114
+
115
+ - `dartsort_sorting.npz`: This NPZ file contains the final spike train under the keys `times_samples`, `channels`, and `labels`.
116
+ - `matching1.h5`: This HDF5 file contains spike features and other data from the last matching step. Amplitudes, localizations, and other features live in here; use `h5ls` on the command line to see what's in there. Be aware that the `labels` dataset in this HDF5 is not the same as what's saved in the `dartsort_sorting.npz`.
117
+ - `motion_info.pkl` is a pickled `MotionInfo` object.
118
+ - There may be a models/ folder containing PyTorch weights files with modeling quantities (for instance, featurization SVD bases, localization neural nets, Gaussian mixture model parameters). If you want to load these up, feel free to reach out for help.
120
119
 
121
120
  ### Visualization
122
121
 
@@ -147,7 +146,7 @@ Set `make_unit_summaries=True` to create a summary plot for each unit.
147
146
 
148
147
  ### Command-line interface
149
148
 
150
- Try running
149
+ Try running
151
150
 
152
151
  ```sh
153
152
  $ dartsort -h
@@ -163,9 +162,8 @@ If it's more of a data-related or methodology thing, feel free to use the email
163
162
 
164
163
  ## References
165
164
 
166
- - [SpikeInterface][SpikeInterface]
167
- - DREDge [on PyPI][dredge-pypi] and the DREDge [paper][dredge-nm] ([PDF link][dredge-rdcb]).
168
-
165
+ - [SpikeInterface][SpikeInterface]
166
+ - DREDge [on PyPI][dredge-pypi] and the DREDge [paper][dredge-nm] ([PDF link][dredge-rdcb]).
169
167
 
170
168
  [SpikeInterface]: https://spikeinterface.readthedocs.io
171
169
  [iblsorting]: https://figshare.com/articles/online_resource/Spike_sorting_pipeline_for_the_International_Brain_Laboratory/19705522
@@ -75,7 +75,10 @@ line-length = 88
75
75
 
76
76
  [tool.ruff.lint]
77
77
  extend-select = ["E", "F", "I", "N", "B", "SIM", "NPY", "RUF", "PTH", "PD", "FURB"]
78
- ignore = ["F722", "N812", "SIM102", "SIM108", "E501", "N806", "N803", "N815"]
78
+ ignore = ["F722", "N812", "SIM102", "SIM108", "E501", "N806", "N803", "N815", "RUF005", "SIM300", "C408", "TRY401"]
79
+
80
+ [tool.ruff.lint.per-file-ignores]
81
+ "**/__init__.py" = ["F401", "F403"]
79
82
 
80
83
  [tool.jupytext]
81
84
  "formats" = "ipynb,py:percent"
@@ -26,7 +26,6 @@ from .main import (
26
26
  DARTsortResult,
27
27
  ObjectiveUpdateTemplateMatchingPeeler,
28
28
  SubtractionPeeler,
29
- check_recording,
30
29
  cluster,
31
30
  dartsort,
32
31
  grab,
@@ -607,7 +607,6 @@ class QDACtx:
607
607
 
608
608
 
609
609
  def _qda_init(ctx):
610
- global _qda_context
611
610
  _qda_context.ctx = ctx
612
611
 
613
612
 
@@ -159,12 +159,7 @@ class Clusterer:
159
159
  mask_ix = np.flatnonzero(features.keep_mask)
160
160
  else:
161
161
  mask_ix = None
162
- if self.sampling_cfg is None:
163
- if mask_ix is not None:
164
- return True, mask_ix
165
- else:
166
- return False, slice(None)
167
- elif features.n <= self.sampling_cfg.n_waveforms_fit:
162
+ if self.sampling_cfg is None or features.n <= self.sampling_cfg.n_waveforms_fit:
168
163
  if mask_ix is not None:
169
164
  return True, mask_ix
170
165
  else:
@@ -1,5 +1,4 @@
1
1
  from typing import Self, cast
2
- from logging import WARN
3
2
 
4
3
  import h5py
5
4
  import numpy as np
@@ -131,7 +130,6 @@ class SimpleMatrixFeatures:
131
130
  samp = amp * np.sign(v)
132
131
 
133
132
  if clustering_features_cfg.use_signed_amplitude:
134
- samp *= clustering_features_cfg.amp_scale
135
133
  features.append(clustering_features_cfg.amp_scale * samp[:, None])
136
134
 
137
135
  do_pcs = bool(clustering_features_cfg.n_main_channel_pcs)
@@ -170,7 +168,7 @@ class SimpleMatrixFeatures:
170
168
  pcs,
171
169
  raise_for_numerics=clustering_features_cfg.raise_for_numerics,
172
170
  )
173
- erp, pcs = interpolate_by_chunk(
171
+ _erp, pcs = interpolate_by_chunk(
174
172
  mask=mask,
175
173
  dataset=pcs,
176
174
  geom=motion.geom,
@@ -190,7 +188,7 @@ class SimpleMatrixFeatures:
190
188
  else:
191
189
  assert sorting.parent_h5_path is not None
192
190
  with h5py.File(sorting.parent_h5_path, "r", locking=False) as h5:
193
- erp, pcs = interpolate_by_chunk(
191
+ _erp, pcs = interpolate_by_chunk(
194
192
  mask=mask,
195
193
  dataset=h5[clustering_features_cfg.pca_dataset_name],
196
194
  geom=motion.geom,