canns 0.12.6__py3-none-any.whl → 0.13.0__py3-none-any.whl
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.
- canns/__init__.py +39 -3
- canns/analyzer/__init__.py +7 -6
- canns/analyzer/data/__init__.py +3 -11
- canns/analyzer/data/asa/__init__.py +74 -0
- canns/analyzer/data/asa/cohospace.py +905 -0
- canns/analyzer/data/asa/config.py +246 -0
- canns/analyzer/data/asa/decode.py +448 -0
- canns/analyzer/data/asa/embedding.py +269 -0
- canns/analyzer/data/asa/filters.py +208 -0
- canns/analyzer/data/asa/fr.py +439 -0
- canns/analyzer/data/asa/path.py +389 -0
- canns/analyzer/data/asa/plotting.py +1276 -0
- canns/analyzer/data/asa/tda.py +901 -0
- canns/analyzer/data/legacy/__init__.py +6 -0
- canns/analyzer/data/{cann1d.py → legacy/cann1d.py} +2 -2
- canns/analyzer/data/{cann2d.py → legacy/cann2d.py} +3 -3
- canns/analyzer/metrics/spatial_metrics.py +70 -100
- canns/analyzer/metrics/systematic_ratemap.py +12 -17
- canns/analyzer/metrics/utils.py +28 -0
- canns/analyzer/model_specific/hopfield.py +19 -16
- canns/analyzer/slow_points/checkpoint.py +32 -9
- canns/analyzer/slow_points/finder.py +33 -6
- canns/analyzer/slow_points/fixed_points.py +12 -0
- canns/analyzer/slow_points/visualization.py +22 -10
- canns/analyzer/visualization/core/backend.py +15 -26
- canns/analyzer/visualization/core/config.py +120 -15
- canns/analyzer/visualization/core/jupyter_utils.py +34 -16
- canns/analyzer/visualization/core/rendering.py +42 -40
- canns/analyzer/visualization/core/writers.py +10 -20
- canns/analyzer/visualization/energy_plots.py +78 -28
- canns/analyzer/visualization/spatial_plots.py +81 -36
- canns/analyzer/visualization/spike_plots.py +27 -7
- canns/analyzer/visualization/theta_sweep_plots.py +159 -72
- canns/analyzer/visualization/tuning_plots.py +11 -3
- canns/data/__init__.py +7 -4
- canns/models/__init__.py +10 -0
- canns/models/basic/cann.py +102 -40
- canns/models/basic/grid_cell.py +9 -8
- canns/models/basic/hierarchical_model.py +57 -11
- canns/models/brain_inspired/hopfield.py +26 -14
- canns/models/brain_inspired/linear.py +15 -16
- canns/models/brain_inspired/spiking.py +23 -12
- canns/pipeline/__init__.py +4 -8
- canns/pipeline/asa/__init__.py +21 -0
- canns/pipeline/asa/__main__.py +11 -0
- canns/pipeline/asa/app.py +1000 -0
- canns/pipeline/asa/runner.py +1095 -0
- canns/pipeline/asa/screens.py +215 -0
- canns/pipeline/asa/state.py +248 -0
- canns/pipeline/asa/styles.tcss +221 -0
- canns/pipeline/asa/widgets.py +233 -0
- canns/pipeline/gallery/__init__.py +7 -0
- canns/task/closed_loop_navigation.py +54 -13
- canns/task/open_loop_navigation.py +230 -147
- canns/task/tracking.py +156 -24
- canns/trainer/__init__.py +8 -5
- canns/utils/__init__.py +12 -4
- {canns-0.12.6.dist-info → canns-0.13.0.dist-info}/METADATA +6 -3
- canns-0.13.0.dist-info/RECORD +91 -0
- {canns-0.12.6.dist-info → canns-0.13.0.dist-info}/entry_points.txt +1 -0
- canns/pipeline/theta_sweep.py +0 -573
- canns-0.12.6.dist-info/RECORD +0 -72
- {canns-0.12.6.dist-info → canns-0.13.0.dist-info}/WHEEL +0 -0
- {canns-0.12.6.dist-info → canns-0.13.0.dist-info}/licenses/LICENSE +0 -0
canns/__init__.py
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
"""Top-level package for CANNs.
|
|
2
|
+
|
|
3
|
+
This module exposes the main namespaces so you can import them directly from
|
|
4
|
+
``canns`` (for example, ``canns.data`` or ``canns.trainer``). It also provides
|
|
5
|
+
simple version metadata.
|
|
6
|
+
|
|
7
|
+
Examples:
|
|
8
|
+
>>> import canns
|
|
9
|
+
>>> print(canns.__version__)
|
|
10
|
+
>>> print(canns.version_info)
|
|
11
|
+
>>> print(list(canns.data.DATASETS))
|
|
12
|
+
"""
|
|
13
|
+
|
|
1
14
|
from . import analyzer as analyzer
|
|
2
15
|
from . import data as data
|
|
3
16
|
from . import models as models
|
|
@@ -7,11 +20,34 @@ from . import utils as utils
|
|
|
7
20
|
|
|
8
21
|
# Version information
|
|
9
22
|
try:
|
|
10
|
-
from ._version import __version__
|
|
23
|
+
from ._version import __version__ as _version
|
|
24
|
+
from ._version import version_info as _version_info
|
|
11
25
|
except ImportError:
|
|
12
26
|
# Fallback if _version.py is not available (e.g., during documentation build)
|
|
13
|
-
|
|
14
|
-
|
|
27
|
+
_version = "unknown"
|
|
28
|
+
_version_info = (0, 0, 0, "unknown")
|
|
29
|
+
|
|
30
|
+
__version__ = _version
|
|
31
|
+
"""Human-readable package version string.
|
|
32
|
+
|
|
33
|
+
This is usually derived from the installed package metadata. When that
|
|
34
|
+
information is unavailable, it falls back to ``"unknown"``.
|
|
35
|
+
|
|
36
|
+
Examples:
|
|
37
|
+
>>> import canns
|
|
38
|
+
>>> print(canns.__version__)
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
version_info = _version_info
|
|
42
|
+
"""Version information as a tuple.
|
|
43
|
+
|
|
44
|
+
The tuple typically follows ``(major, minor, patch)``. A development or
|
|
45
|
+
documentation build may return a fallback value instead.
|
|
46
|
+
|
|
47
|
+
Examples:
|
|
48
|
+
>>> import canns
|
|
49
|
+
>>> print(canns.version_info)
|
|
50
|
+
"""
|
|
15
51
|
|
|
16
52
|
__all__ = [
|
|
17
53
|
"analyzer",
|
canns/analyzer/__init__.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"""Analyzer utilities for inspecting CANNs models and simulations.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
This namespace groups analysis helpers such as model metrics, visualization,
|
|
4
|
+
experimental or synthetic data analysis, slow-point (fixed-point) analysis,
|
|
5
|
+
and model-specific tools.
|
|
6
|
+
|
|
7
|
+
Examples:
|
|
8
|
+
>>> from canns import analyzer
|
|
9
|
+
>>> print(analyzer.__all__)
|
|
9
10
|
"""
|
|
10
11
|
|
|
11
12
|
from . import data, metrics, model_specific, slow_points, visualization
|
canns/analyzer/data/__init__.py
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
"""Data analysis utilities for experimental and synthetic neural data.
|
|
1
|
+
"""Data analysis utilities for experimental and synthetic neural data."""
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
firing rates) and extracting features like bump positions, topological
|
|
5
|
-
structures, and population dynamics.
|
|
6
|
-
"""
|
|
3
|
+
from .asa import * # noqa: F401,F403
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
__all__ = [
|
|
11
|
-
"cann1d",
|
|
12
|
-
"cann2d",
|
|
13
|
-
]
|
|
5
|
+
__all__ = list(locals().get("__all__", []))
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
# Coho-space analysis + visualization
|
|
4
|
+
from .cohospace import (
|
|
5
|
+
compute_cohoscore,
|
|
6
|
+
plot_cohospace_neuron,
|
|
7
|
+
plot_cohospace_population,
|
|
8
|
+
plot_cohospace_trajectory,
|
|
9
|
+
)
|
|
10
|
+
from .config import (
|
|
11
|
+
CANN2DError,
|
|
12
|
+
CANN2DPlotConfig,
|
|
13
|
+
Constants,
|
|
14
|
+
DataLoadError,
|
|
15
|
+
ProcessingError,
|
|
16
|
+
SpikeEmbeddingConfig,
|
|
17
|
+
TDAConfig,
|
|
18
|
+
)
|
|
19
|
+
from .decode import decode_circular_coordinates, decode_circular_coordinates_multi
|
|
20
|
+
from .embedding import embed_spike_trains
|
|
21
|
+
from .fr import (
|
|
22
|
+
FRMResult,
|
|
23
|
+
compute_fr_heatmap_matrix,
|
|
24
|
+
compute_frm,
|
|
25
|
+
plot_frm,
|
|
26
|
+
save_fr_heatmap_png,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
# Path utilities
|
|
30
|
+
from .path import align_coords_to_position, apply_angle_scale
|
|
31
|
+
|
|
32
|
+
# Higher-level plotting helpers
|
|
33
|
+
from .plotting import (
|
|
34
|
+
plot_2d_bump_on_manifold,
|
|
35
|
+
plot_3d_bump_on_torus,
|
|
36
|
+
plot_cohomap,
|
|
37
|
+
plot_cohomap_multi,
|
|
38
|
+
plot_path_compare,
|
|
39
|
+
plot_projection,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
# TDA entry point
|
|
43
|
+
from .tda import tda_vis
|
|
44
|
+
|
|
45
|
+
__all__ = [
|
|
46
|
+
"SpikeEmbeddingConfig",
|
|
47
|
+
"TDAConfig",
|
|
48
|
+
"CANN2DPlotConfig",
|
|
49
|
+
"Constants",
|
|
50
|
+
"CANN2DError",
|
|
51
|
+
"DataLoadError",
|
|
52
|
+
"ProcessingError",
|
|
53
|
+
"embed_spike_trains",
|
|
54
|
+
"tda_vis",
|
|
55
|
+
"decode_circular_coordinates",
|
|
56
|
+
"decode_circular_coordinates_multi",
|
|
57
|
+
"plot_projection",
|
|
58
|
+
"plot_path_compare",
|
|
59
|
+
"plot_cohomap",
|
|
60
|
+
"plot_cohomap_multi",
|
|
61
|
+
"plot_3d_bump_on_torus",
|
|
62
|
+
"plot_2d_bump_on_manifold",
|
|
63
|
+
"compute_fr_heatmap_matrix",
|
|
64
|
+
"save_fr_heatmap_png",
|
|
65
|
+
"FRMResult",
|
|
66
|
+
"compute_frm",
|
|
67
|
+
"plot_frm",
|
|
68
|
+
"plot_cohospace_trajectory",
|
|
69
|
+
"plot_cohospace_neuron",
|
|
70
|
+
"plot_cohospace_population",
|
|
71
|
+
"compute_cohoscore",
|
|
72
|
+
"align_coords_to_position",
|
|
73
|
+
"apply_angle_scale",
|
|
74
|
+
]
|