Commit 103f6a0
[analyzer] Refactor CANN1D module and Implement CANN2D module (#20)
* Add CANN2D analysis module and update dependencies
Introduces src/canns/analyzer/experimental_data/CANN2D.py for 2D CANN analysis, including spike train embedding and topological data analysis (TDA) functions. Updates pyproject.toml to add ripser as a dependency and moves sphinx-design to docs extras. Refactors CANN1D.py to use internal function naming and improves numba fallback messaging. Updates __init__.py to expose new CANN2D functions. Minor changes to _datasets_utils.py for compatibility.
Co-Authored-By: Airs702 <116141471+Airs702@users.noreply.github.com>
* Refactor CANN1D and CANN2D modules, update imports
Renamed CANN1D.py and CANN2D.py to cann1d.py and cann2d.py for consistency and updated all relevant imports. Refactored CANN1D bump analysis and animation functions to use configuration dataclasses and improved error handling. Updated example script to use new data loading and function signatures. Changed default maxdim in TDAConfig and related usages from 2 to 1 in CANN2D.
Co-Authored-By: Airs702 <116141471+Airs702@users.noreply.github.com>
* Refactor experimental_data modules for type hints and style
Updated type hints to use PEP 604 union syntax, improved code style and consistency, and reordered imports in cann1d and cann2d modules. Enhanced error handling and function signatures, and made minor formatting improvements throughout. No functional changes were made.
* Fix TDA 2D analysis implementation to match external TDAvis behavior
- Fix active timepoint selection logic to match external TDAvis sorting behavior
- Correct omega parameter from 0.2 to 1 in denoising calls for consistency
- Fix sampling score calculation indexing in both numpy and numba implementations
- Remove epsilon handling in distance matrix to match external behavior
- Add numba optimizations while maintaining computational consistency
- Enhance API with comprehensive results dictionary format
- Add missing standard barcode visualization functionality
Ensures CANN 2D topological data analysis produces identical results to reference implementation.
---------
Co-authored-by: Airs702 <116141471+Airs702@users.noreply.github.com>1 parent b322880 commit 103f6a0
File tree
8 files changed
+2688
-954
lines changed- examples
- src/canns/analyzer/experimental_data
8 files changed
+2688
-954
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 17 | + | |
32 | 18 | | |
33 | 19 | | |
34 | 20 | | |
35 | 21 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 22 | + | |
| 23 | + | |
41 | 24 | | |
42 | 25 | | |
43 | 26 | | |
| |||
52 | 35 | | |
53 | 36 | | |
54 | 37 | | |
55 | | - | |
56 | | - | |
| 38 | + | |
57 | 39 | | |
58 | 40 | | |
59 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
0 commit comments