DARTsort 0.5.18__tar.gz → 0.5.20b0__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 (174) hide show
  1. {dartsort-0.5.18 → dartsort-0.5.20b0}/PKG-INFO +7 -6
  2. {dartsort-0.5.18 → dartsort-0.5.20b0}/README.md +6 -5
  3. {dartsort-0.5.18 → dartsort-0.5.20b0}/docs/index.md +6 -5
  4. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/cli.py +1 -1
  5. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/clustering/__init__.py +7 -2
  6. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/main.py +4 -1
  7. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/peel/matching_util/matching_base.py +2 -1
  8. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/_multichan_denoiser_kit.py +2 -2
  9. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/cli_util.py +2 -2
  10. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/peel_util.py +1 -1
  11. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/spiketorch.py +7 -3
  12. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort.egg-info/PKG-INFO +7 -6
  13. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort.egg-info/SOURCES.txt +0 -1
  14. dartsort-0.5.18/src/dartsort/clustering/modes.py +0 -173
  15. {dartsort-0.5.18 → dartsort-0.5.20b0}/.github/workflows/ci.yml +0 -0
  16. {dartsort-0.5.18 → dartsort-0.5.20b0}/.github/workflows/ci_windows.yml +0 -0
  17. {dartsort-0.5.18 → dartsort-0.5.20b0}/.github/workflows/deploy.yml +0 -0
  18. {dartsort-0.5.18 → dartsort-0.5.20b0}/.github/workflows/docs.yml +0 -0
  19. {dartsort-0.5.18 → dartsort-0.5.20b0}/.gitignore +0 -0
  20. {dartsort-0.5.18 → dartsort-0.5.20b0}/docs/main_api.md +0 -0
  21. {dartsort-0.5.18 → dartsort-0.5.20b0}/docs/toolkit_api.md +0 -0
  22. {dartsort-0.5.18 → dartsort-0.5.20b0}/environment.yml +0 -0
  23. {dartsort-0.5.18 → dartsort-0.5.20b0}/notebook/.keep +0 -0
  24. {dartsort-0.5.18 → dartsort-0.5.20b0}/notebook/ibl_dandi_example.py +0 -0
  25. {dartsort-0.5.18 → dartsort-0.5.20b0}/pyproject.toml +0 -0
  26. {dartsort-0.5.18 → dartsort-0.5.20b0}/setup.cfg +0 -0
  27. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/__init__.py +0 -0
  28. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/clustering/agglomerate.py +0 -0
  29. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/clustering/cluster_util.py +0 -0
  30. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/clustering/clustering.py +0 -0
  31. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/clustering/clustering_features.py +0 -0
  32. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/clustering/density.py +0 -0
  33. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/clustering/forward_backward.py +0 -0
  34. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/clustering/kmeans.py +0 -0
  35. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/clustering/merge.py +0 -0
  36. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/clustering/mixture.py +0 -0
  37. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/clustering/refine_util.py +0 -0
  38. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/config.py +0 -0
  39. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/detect/__init__.py +0 -0
  40. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/detect/detect.py +0 -0
  41. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/evaluate/__init__.py +0 -0
  42. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/evaluate/analysis.py +0 -0
  43. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/evaluate/comparison.py +0 -0
  44. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/evaluate/hybrid_util.py +0 -0
  45. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/evaluate/noise_recording_tools.py +0 -0
  46. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/evaluate/sim_template_tools.py +0 -0
  47. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/evaluate/simkit.py +0 -0
  48. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/evaluate/simlib.py +0 -0
  49. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/localize/__init__.py +0 -0
  50. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/localize/localize_torch.py +0 -0
  51. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/localize/localize_util.py +0 -0
  52. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/peel/__init__.py +0 -0
  53. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/peel/grab.py +0 -0
  54. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/peel/matching.py +0 -0
  55. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/peel/matching_util/__init__.py +0 -0
  56. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/peel/matching_util/compressed_upsampled.py +0 -0
  57. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/peel/matching_util/drifty.py +0 -0
  58. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/peel/matching_util/pairwise.py +0 -0
  59. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/peel/matching_util/pairwise_util.py +0 -0
  60. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/peel/peel_base.py +0 -0
  61. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/peel/peel_lib.py +0 -0
  62. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/peel/reduction_template.py +0 -0
  63. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/peel/shaver.py +0 -0
  64. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/peel/subtract.py +0 -0
  65. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/peel/threshold.py +0 -0
  66. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/pretrained/default_temporal_kernel.npy +0 -0
  67. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/pretrained/detect_np1.pt +0 -0
  68. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/pretrained/detect_np2.pt +0 -0
  69. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/pretrained/glasbey1024.npz +0 -0
  70. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/pretrained/offset_trained_denoiser.pt +0 -0
  71. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/pretrained/offset_trained_denoiser_added_temp.pt +0 -0
  72. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/pretrained/offset_trained_denoiser_added_temp_boost.pt +0 -0
  73. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/pretrained/original_single_chan_denoiser.pt +0 -0
  74. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/pretrained/single_chan_denoiser.pt +0 -0
  75. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/templates/__init__.py +0 -0
  76. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/templates/get_templates.py +0 -0
  77. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/templates/postprocess_util.py +0 -0
  78. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/templates/realignment.py +0 -0
  79. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/templates/template_util.py +0 -0
  80. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/templates/templates.py +0 -0
  81. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/templates/templib.py +0 -0
  82. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/__init__.py +0 -0
  83. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/all_transformers.py +0 -0
  84. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/amortized_localization.py +0 -0
  85. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/amplitudes.py +0 -0
  86. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/decollider.py +0 -0
  87. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/denoising_scorer.py +0 -0
  88. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/enforce_decrease.py +0 -0
  89. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/fixed_prop.py +0 -0
  90. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/interp.py +0 -0
  91. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/localize.py +0 -0
  92. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/matching_denoiser.py +0 -0
  93. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/mixture_classifier.py +0 -0
  94. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/pipeline.py +0 -0
  95. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/reduction.py +0 -0
  96. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/single_channel_denoiser.py +0 -0
  97. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/supervised_denoiser.py +0 -0
  98. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/temporal_pca.py +0 -0
  99. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/transform_base.py +0 -0
  100. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/transform/whiten.py +0 -0
  101. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/__init__.py +0 -0
  102. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/data_util.py +0 -0
  103. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/drift_util.py +0 -0
  104. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/internal_config.py +0 -0
  105. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/interpolation_util.py +0 -0
  106. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/job_util.py +0 -0
  107. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/logging_util.py +0 -0
  108. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/main_util.py +0 -0
  109. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/more_operators.py +0 -0
  110. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/motion.py +0 -0
  111. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/multiprocessing_util.py +0 -0
  112. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/nn_util.py +0 -0
  113. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/noise_util.py +0 -0
  114. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/preprocess_util.py +0 -0
  115. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/py_util.py +0 -0
  116. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/registration_util.py +0 -0
  117. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/residual_util.py +0 -0
  118. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/sparse_util.py +0 -0
  119. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/spikeio.py +0 -0
  120. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/testing_util/__init__.py +0 -0
  121. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/testing_util/matching_debug_util.py +0 -0
  122. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/testing_util/mixture_testing_util.py +0 -0
  123. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/torch_optimization_util.py +0 -0
  124. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/torch_util.py +0 -0
  125. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/util/waveform_util.py +0 -0
  126. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/vis/__init__.py +0 -0
  127. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/vis/analysis_plots.py +0 -0
  128. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/vis/colors.py +0 -0
  129. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/vis/gt.py +0 -0
  130. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/vis/layout.py +0 -0
  131. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/vis/metrics_util.py +0 -0
  132. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/vis/mixture.py +0 -0
  133. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/vis/recanim.py +0 -0
  134. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/vis/scatterplots.py +0 -0
  135. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/vis/sorting.py +0 -0
  136. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/vis/unit.py +0 -0
  137. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/vis/unit_comparison.py +0 -0
  138. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/vis/versus.py +0 -0
  139. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/vis/vismain.py +0 -0
  140. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort/vis/waveforms.py +0 -0
  141. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort.egg-info/dependency_links.txt +0 -0
  142. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort.egg-info/entry_points.txt +0 -0
  143. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort.egg-info/requires.txt +0 -0
  144. {dartsort-0.5.18 → dartsort-0.5.20b0}/src/dartsort.egg-info/top_level.txt +0 -0
  145. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/conftest.py +0 -0
  146. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_agglomerate.py +0 -0
  147. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_alignment.py +0 -0
  148. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_cluster_util.py +0 -0
  149. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_clustering.py +0 -0
  150. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_config.py +0 -0
  151. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_dartsort.py +0 -0
  152. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_data_util.py +0 -0
  153. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_density.py +0 -0
  154. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_detect.py +0 -0
  155. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_drift_util.py +0 -0
  156. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_drifty_matching.py +0 -0
  157. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_enforce_decrease.py +0 -0
  158. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_grab_and_featurize.py +0 -0
  159. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_kmeans.py +0 -0
  160. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_linalg.py +0 -0
  161. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_localize_torch.py +0 -0
  162. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_matching.py +0 -0
  163. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_mixture_classifier.py +0 -0
  164. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_modeling.py +0 -0
  165. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_simkit.py +0 -0
  166. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_spiketorch.py +0 -0
  167. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_subtract.py +0 -0
  168. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_templates.py +0 -0
  169. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_threshold.py +0 -0
  170. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_torch_optimization_util.py +0 -0
  171. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_transform.py +0 -0
  172. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_util.py +0 -0
  173. {dartsort-0.5.18 → dartsort-0.5.20b0}/tests/test_waveform_util.py +0 -0
  174. {dartsort-0.5.18 → dartsort-0.5.20b0}/zensical.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dartsort
3
- Version: 0.5.18
3
+ Version: 0.5.20b0
4
4
  Summary: DARTsort
5
5
  Author-email: Charlie Windolf <ciw2048@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/cwindolf/dartsort
@@ -91,15 +91,19 @@ You can use `conda-forge` to install Python, `dartsort`, and its dependencies as
91
91
 
92
92
  ## Usage
93
93
 
94
+ **Please** read the [important configuration details section](#important-configuration-details) below for information on the parameters of the `DARTsortUserConfig`.
95
+ In particular, you will most likely need to set the `preprocessing` flag.
96
+
94
97
  For more detailed documentation of the main function parameters and configuration options, see the [main API documentation](main_api.md).
95
98
 
96
99
  ### As a Python function
97
100
 
98
- _dartsort_ can be run in Python with:
101
+ _dartsort_ can be run in Python with (for example):
99
102
 
100
103
  ```python
101
104
  import dartsort
102
105
 
106
+ # if the default settings make sense for you...
103
107
  dartsort.dartsort(recording, output_dir)
104
108
 
105
109
  # or, to set configuration options, something like...
@@ -109,14 +113,11 @@ dartsort_result = dartsort.dartsort(
109
113
  cfg=dartsort.DARTsortUserConfig(
110
114
  preprocessing="ibllike",
111
115
  work_in_tmpdir=True,
112
- copy_recording_to_tmpdir=True,
116
+ copy_recording_to_tmpdir="yes",
113
117
  ),
114
118
  )
115
119
  ```
116
120
 
117
- **Please** read the [important configuration details section](#important-configuration-details) below for information on the parameters of the `DARTsortUserConfig`.
118
- In particular, you will most likely need to set the `preprocessing` flag.
119
-
120
121
  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)).
121
122
  `output_dir` is the folder where _dartsort_ will save its output.
122
123
  There are more details on these and the rest of the arguments in the [main API documentation](main_api.md).
@@ -48,15 +48,19 @@ You can use `conda-forge` to install Python, `dartsort`, and its dependencies as
48
48
 
49
49
  ## Usage
50
50
 
51
+ **Please** read the [important configuration details section](#important-configuration-details) below for information on the parameters of the `DARTsortUserConfig`.
52
+ In particular, you will most likely need to set the `preprocessing` flag.
53
+
51
54
  For more detailed documentation of the main function parameters and configuration options, see the [main API documentation](main_api.md).
52
55
 
53
56
  ### As a Python function
54
57
 
55
- _dartsort_ can be run in Python with:
58
+ _dartsort_ can be run in Python with (for example):
56
59
 
57
60
  ```python
58
61
  import dartsort
59
62
 
63
+ # if the default settings make sense for you...
60
64
  dartsort.dartsort(recording, output_dir)
61
65
 
62
66
  # or, to set configuration options, something like...
@@ -66,14 +70,11 @@ dartsort_result = dartsort.dartsort(
66
70
  cfg=dartsort.DARTsortUserConfig(
67
71
  preprocessing="ibllike",
68
72
  work_in_tmpdir=True,
69
- copy_recording_to_tmpdir=True,
73
+ copy_recording_to_tmpdir="yes",
70
74
  ),
71
75
  )
72
76
  ```
73
77
 
74
- **Please** read the [important configuration details section](#important-configuration-details) below for information on the parameters of the `DARTsortUserConfig`.
75
- In particular, you will most likely need to set the `preprocessing` flag.
76
-
77
78
  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)).
78
79
  `output_dir` is the folder where _dartsort_ will save its output.
79
80
  There are more details on these and the rest of the arguments in the [main API documentation](main_api.md).
@@ -48,15 +48,19 @@ You can use `conda-forge` to install Python, `dartsort`, and its dependencies as
48
48
 
49
49
  ## Usage
50
50
 
51
+ **Please** read the [important configuration details section](#important-configuration-details) below for information on the parameters of the `DARTsortUserConfig`.
52
+ In particular, you will most likely need to set the `preprocessing` flag.
53
+
51
54
  For more detailed documentation of the main function parameters and configuration options, see the [main API documentation](main_api.md).
52
55
 
53
56
  ### As a Python function
54
57
 
55
- _dartsort_ can be run in Python with:
58
+ _dartsort_ can be run in Python with (for example):
56
59
 
57
60
  ```python
58
61
  import dartsort
59
62
 
63
+ # if the default settings make sense for you...
60
64
  dartsort.dartsort(recording, output_dir)
61
65
 
62
66
  # or, to set configuration options, something like...
@@ -66,14 +70,11 @@ dartsort_result = dartsort.dartsort(
66
70
  cfg=dartsort.DARTsortUserConfig(
67
71
  preprocessing="ibllike",
68
72
  work_in_tmpdir=True,
69
- copy_recording_to_tmpdir=True,
73
+ copy_recording_to_tmpdir="yes",
70
74
  ),
71
75
  )
72
76
  ```
73
77
 
74
- **Please** read the [important configuration details section](#important-configuration-details) below for information on the parameters of the `DARTsortUserConfig`.
75
- In particular, you will most likely need to set the `preprocessing` flag.
76
-
77
78
  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)).
78
79
  `output_dir` is the folder where _dartsort_ will save its output.
79
80
  There are more details on these and the rest of the arguments in the [main API documentation](main_api.md).
@@ -21,7 +21,7 @@ def dartsort_cli():
21
21
  assert dartsort_cli.__doc__ is not None
22
22
  ap = argparse.ArgumentParser(
23
23
  prog="dartsort",
24
- epilog=dartsort_cli.__doc__.split("---")[1],
24
+ epilog=main.tag + "\n\n" + dartsort_cli.__doc__.split("---")[1],
25
25
  formatter_class=argparse.ArgumentDefaultsHelpFormatter,
26
26
  )
27
27
  ap.add_argument("recording", help="Path to SpikeInterface RecordingExtractor.")
@@ -1,3 +1,8 @@
1
- from .clustering_features import SimpleMatrixFeatures, StableWaveformFeatures
2
- from .clustering import get_clusterer, clustering_strategies, refinement_strategies, TMMRefinement
3
1
  from .agglomerate import deduplicate_spikes
2
+ from .clustering import (
3
+ TMMRefinement,
4
+ clustering_strategies,
5
+ get_clusterer,
6
+ refinement_strategies,
7
+ )
8
+ from .clustering_features import SimpleMatrixFeatures, StableWaveformFeatures
@@ -2,9 +2,10 @@
2
2
 
3
3
  import traceback
4
4
  from collections.abc import Sequence
5
+ from importlib.metadata import version
5
6
  from pathlib import Path
6
7
  from tempfile import TemporaryDirectory
7
- from typing import Any
8
+ from typing import Any, cast
8
9
 
9
10
  from dredge.motion_util import MotionEstimate
10
11
  from spikeinterface.core import BaseRecording, Motion
@@ -71,6 +72,7 @@ from .util.py_util import dartcopytree, ensure_path, panic, timer
71
72
  from .util.torch_util import cleanup_and_log_gpu_usage
72
73
 
73
74
  logger = get_logger(__name__)
75
+ tag = f"{__package__} {version(cast(str, __package__))} >>-===-- ((@))"
74
76
 
75
77
 
76
78
  def dartsort(
@@ -117,6 +119,7 @@ def dartsort(
117
119
  - "motion": MotionInfo
118
120
  """
119
121
  output_dir = ensure_path(output_dir, mkdir=True)
122
+ logger.info(tag)
120
123
 
121
124
  # check if totally done (to avoid doing preprocessing)
122
125
  # if not done, the sorter will still try to resume where it left off later
@@ -13,6 +13,7 @@ from ...util.logging_util import DARTSORTVERBOSE, get_logger
13
13
  from ...util.motion import MotionInfo
14
14
  from ...util.py_util import databag, panic
15
15
  from ...util.spiketorch import (
16
+ _nonzero_static,
16
17
  argrelmax_dedup,
17
18
  argrelmax_dedup_mask_no_thresh,
18
19
  grab_spikes,
@@ -427,7 +428,7 @@ class ChunkTemplateData:
427
428
  padding=padding + exclude_extra_padding,
428
429
  )
429
430
  max_peaks = ceil(nt / self.filter_length_samples)
430
- peaks = mask.nonzero_static(size=max_peaks)
431
+ peaks = _nonzero_static(mask, size=max_peaks, le_ok=True)
431
432
  valid = peaks >= 0
432
433
 
433
434
  # scaled refinement
@@ -266,7 +266,7 @@ def get_noise(
266
266
  channels,
267
267
  channel_index,
268
268
  spike_length_samples=121,
269
- rg: int | None | np.random.Generator = 0,
269
+ rg: int | np.random.Generator | None = 0,
270
270
  generator: torch.Generator | None = None,
271
271
  ):
272
272
  if rg is not None:
@@ -585,7 +585,7 @@ class AsyncBatchDataset(RefreshableDataset):
585
585
  while True:
586
586
  try:
587
587
  self._queue.get()
588
- except Exception:
588
+ except Exception: # noqa: BLE001
589
589
  break
590
590
  for th in self._threads:
591
591
  th.join()
@@ -2,10 +2,10 @@
2
2
  import types
3
3
  import typing
4
4
  from argparse import ArgumentParser, BooleanOptionalAction, _StoreAction
5
- from collections.abc import Sequence
5
+ from collections.abc import Callable, Sequence
6
6
  from dataclasses import _MISSING_TYPE, MISSING, asdict, field, fields
7
7
  from pathlib import Path
8
- from typing import Any, Callable, Literal
8
+ from typing import Any, Literal
9
9
 
10
10
  from annotated_types import Ge, Gt, Le, Lt
11
11
  from typing_extensions import Doc
@@ -190,7 +190,7 @@ def peeler_is_done(
190
190
  (
191
191
  done,
192
192
  output_hdf5_filename,
193
- next_batch_start,
193
+ _next_batch_start,
194
194
  ) = check_resume_or_overwrite(
195
195
  output_hdf5_filename,
196
196
  localization_dataset_name,
@@ -114,13 +114,16 @@ def ptp(waveforms, dim=1, keepdims=False):
114
114
 
115
115
  if TORCH_IS_OLD:
116
116
 
117
- def _nonzero_static(x: Tensor, size: int):
117
+ def _nonzero_static(x: Tensor, size: int, le_ok: bool = False):
118
118
  nz = x.nonzero()
119
- assert nz.shape[0] == size
119
+ if le_ok:
120
+ assert nz.shape[0] <= size
121
+ else:
122
+ assert nz.shape[0] == size
120
123
  return nz
121
124
  else:
122
125
 
123
- def _nonzero_static(x: Tensor, size: int):
126
+ def _nonzero_static(x: Tensor, size: int, le_ok: bool = False):
124
127
  return x.nonzero_static(size=size)
125
128
 
126
129
 
@@ -901,6 +904,7 @@ def argrelmax_dedup_mask_no_thresh(
901
904
  x2 = x2[0, 0]
902
905
  return x2
903
906
 
907
+
904
908
  _cdtypes = {torch.float32: torch.complex64, torch.float64: torch.complex128}
905
909
 
906
910
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dartsort
3
- Version: 0.5.18
3
+ Version: 0.5.20b0
4
4
  Summary: DARTsort
5
5
  Author-email: Charlie Windolf <ciw2048@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/cwindolf/dartsort
@@ -91,15 +91,19 @@ You can use `conda-forge` to install Python, `dartsort`, and its dependencies as
91
91
 
92
92
  ## Usage
93
93
 
94
+ **Please** read the [important configuration details section](#important-configuration-details) below for information on the parameters of the `DARTsortUserConfig`.
95
+ In particular, you will most likely need to set the `preprocessing` flag.
96
+
94
97
  For more detailed documentation of the main function parameters and configuration options, see the [main API documentation](main_api.md).
95
98
 
96
99
  ### As a Python function
97
100
 
98
- _dartsort_ can be run in Python with:
101
+ _dartsort_ can be run in Python with (for example):
99
102
 
100
103
  ```python
101
104
  import dartsort
102
105
 
106
+ # if the default settings make sense for you...
103
107
  dartsort.dartsort(recording, output_dir)
104
108
 
105
109
  # or, to set configuration options, something like...
@@ -109,14 +113,11 @@ dartsort_result = dartsort.dartsort(
109
113
  cfg=dartsort.DARTsortUserConfig(
110
114
  preprocessing="ibllike",
111
115
  work_in_tmpdir=True,
112
- copy_recording_to_tmpdir=True,
116
+ copy_recording_to_tmpdir="yes",
113
117
  ),
114
118
  )
115
119
  ```
116
120
 
117
- **Please** read the [important configuration details section](#important-configuration-details) below for information on the parameters of the `DARTsortUserConfig`.
118
- In particular, you will most likely need to set the `preprocessing` flag.
119
-
120
121
  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)).
121
122
  `output_dir` is the folder where _dartsort_ will save its output.
122
123
  There are more details on these and the rest of the arguments in the [main API documentation](main_api.md).
@@ -32,7 +32,6 @@ src/dartsort/clustering/forward_backward.py
32
32
  src/dartsort/clustering/kmeans.py
33
33
  src/dartsort/clustering/merge.py
34
34
  src/dartsort/clustering/mixture.py
35
- src/dartsort/clustering/modes.py
36
35
  src/dartsort/clustering/refine_util.py
37
36
  src/dartsort/detect/__init__.py
38
37
  src/dartsort/detect/detect.py
@@ -1,173 +0,0 @@
1
- import numpy as np
2
- from scipy.signal import find_peaks
3
-
4
- from . import density
5
-
6
- # todo: replace all isosplit stuff with things based on scipy's isotonic regression.
7
-
8
-
9
- def fit_unimodal_right(x, f, weights=None, cut=0, hard=False):
10
- """Unimodal to the right of cut, increasing to the left. Continuity at the border."""
11
- from isosplit import jisotonic5, up_down_isotonic_regression # type: ignore
12
-
13
- assert jisotonic5 is not None
14
- if weights is None:
15
- weights = np.ones_like(f)
16
-
17
- # figure out where cut lands and what f(cut) should be
18
- cuti_left = np.searchsorted(x, cut)
19
- if cuti_left >= len(x) - 1:
20
- # everything is to the left... fit increasing!
21
- return jisotonic5.jisotonic5(f, weights=weights)[0]
22
- cuti_right = np.searchsorted(x, cut, side="right") - 1
23
- if cuti_right <= 0:
24
- # everything is to the right... fit unimodal!
25
- return up_down_isotonic_regression(f, weights=weights)
26
- # else, in the middle somewhere...
27
- assert cuti_left in (cuti_right, cuti_right + 1)
28
-
29
- out = np.empty_like(f)
30
- out[cuti_right:] = up_down_isotonic_regression(
31
- np.ascontiguousarray(f[cuti_right:]),
32
- weights=np.ascontiguousarray(weights[cuti_right:]),
33
- )
34
-
35
- # impose continuity with a large penalty
36
- f_left = np.concatenate((f[:cuti_left], out[cuti_right : cuti_right + 1]))
37
- w_left = np.concatenate(
38
- (weights[:cuti_left], 1e6 + 10 * weights.sum(keepdims=True))
39
- )
40
- out[:cuti_left] = jisotonic5.jisotonic5(f_left, w_left)[0][:-1]
41
-
42
- return out
43
-
44
-
45
- def fit_bimodal_at(x, f, weights=None, cut=0):
46
- from isosplit import up_down_isotonic_regression # type: ignore
47
-
48
- if weights is None:
49
- weights = np.ones_like(f)
50
- which_right = x > cut
51
- which_left = np.logical_not(which_right)
52
- out = np.empty_like(f)
53
- if which_left.any():
54
- out[which_left] = up_down_isotonic_regression(
55
- f[which_left], weights=weights[which_left]
56
- )
57
- if which_right.any():
58
- out[which_right] = up_down_isotonic_regression(
59
- f[which_right], weights=weights[which_right]
60
- )
61
- return out
62
-
63
-
64
- def smoothed_dipscore_at(
65
- cut,
66
- samples,
67
- alternative="smoothed",
68
- dipscore_only=False,
69
- score_kind="tv",
70
- cut_relmax_order=3,
71
- null="isotoniconesideunnormed",
72
- debug_info=None,
73
- ):
74
- from isosplit import up_down_isotonic_regression # type: ignore
75
-
76
- if samples.size < 3:
77
- return 0.0
78
-
79
- densities = density.get_smoothed_density(
80
- samples[:, None],
81
- sigma=0.5 * 1.06 * samples.std() * (samples.size**-0.2),
82
- bin_size_ratio=20.0,
83
- min_bin_size=0.025,
84
- max_n_bins=512,
85
- min_n_bins=10,
86
- )
87
- spacings = np.diff(samples)
88
- spacings = np.concatenate(
89
- (spacings[:1], 0.5 * (spacings[1:] + spacings[:-1]), spacings[-1:])
90
- )
91
- with np.errstate(all="raise"):
92
- densities /= (densities * spacings).sum()
93
-
94
- if cut is None:
95
- # closest maxes left + right of 0
96
- maxers, _ = find_peaks(densities, distance=cut_relmax_order)
97
- coords = samples[maxers]
98
- left_cut = right_cut = 0
99
- if (coords < 0).any():
100
- left_cut = coords[coords < 0].max()
101
- if (coords > 0).any():
102
- right_cut = coords[coords > 0].min()
103
- candidates = np.logical_and(samples >= left_cut, samples <= right_cut)
104
- cut = 0
105
- if candidates.any():
106
- cut = samples[candidates][np.argmin(densities[candidates])]
107
-
108
- if alternative == "bimodal":
109
- densities = fit_bimodal_at(samples, densities, cut=cut)
110
- densities /= (densities * spacings).sum()
111
- else:
112
- assert alternative == "smoothed"
113
-
114
- score = 0
115
- best_dens_err = np.inf
116
- best_uni = None
117
-
118
- if score_kind == "ks":
119
- empirical = np.cumsum(densities * spacings)
120
- else:
121
- empirical = None
122
-
123
- if null in ("isotonic", "gcm"):
124
- orders = (slice(None),)
125
- signs = (1,)
126
- else:
127
- orders = (slice(None), slice(None, None, -1))
128
- signs = (1, -1)
129
-
130
- # change to density which is best overall fit
131
- for hard in (False, True):
132
- for order, sign in zip(orders, signs):
133
- s = np.ascontiguousarray(samples[order])
134
- d = np.ascontiguousarray(densities[order])
135
- if null in ("isotoniconeside", "isotoniconesideunnormed"):
136
- dens = fit_unimodal_right(sign * s, d, cut=sign * cut, hard=hard)
137
- elif null == "isotonic":
138
- dens = up_down_isotonic_regression(d)
139
- else:
140
- assert False
141
-
142
- dens = dens[order]
143
- if null not in ("isotonic", "isotoniconesideunnormed"):
144
- dens /= (dens * spacings).sum()
145
-
146
- dens_err = (np.abs(dens - densities) * spacings).sum()
147
- if score_kind == "ks":
148
- assert empirical is not None
149
- my_score = np.abs(empirical - np.cumsum(dens * spacings)).max()
150
- elif score_kind == "tv":
151
- my_score = 0.5 * dens_err
152
- else:
153
- assert False
154
-
155
- # if my_score > score:
156
- if dens_err < best_dens_err:
157
- score = my_score
158
- best_dens_err = dens_err
159
- best_uni = dens
160
-
161
- if debug_info is not None:
162
- debug_info["domain"] = samples
163
- debug_info["alternative_density"] = densities
164
- debug_info["cut"] = cut
165
- debug_info["score"] = score
166
- debug_info["score_kind"] = score_kind
167
- debug_info["uni_density"] = best_uni
168
- debug_info["samples"] = samples
169
-
170
- if dipscore_only:
171
- return score
172
-
173
- return score, samples, densities, best_uni, cut
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes