API Reference¶
This section provides complete API documentation for all CoMPASS-Labyrinth modules, automatically generated from docstrings in the source code.
Overview¶
The CoMPASS-Labyrinth API is organized into several main modules:
Core Module¶
Core utilities for project initialization, data loading, and figure management.
- Core Utilities - Project initialization, data loading, configuration
Behavior Module¶
Tools for behavioral data preprocessing and analysis.
- Preprocessing - Data preprocessing utilities
- Pose Estimation - DeepLabCut utilities
- Performance Metrics - Task performance analysis
- Success Metrics - Success rate computation
- Trajectory Analysis - Movement trajectory analysis
- Simulated Agents - Agent-based modeling
CoMPASS Module¶
Implementation of the two-level hierarchical probabilistic framework.
Level 1: Motor State Inference¶
- Data Preparation - Prepare data for Level 1 modeling
- HMM Models - Hidden Markov Model classes and fitting
- Visualization - Level 1 visualization utilities
Level 2: Cognitive State Inference¶
- Data Streams - Feature computation for Level 2
- Models - BGMM and GMM-HMM implementations
- Plotting - Level 2 visualization functions
- Utilities - Helper functions for Level 2
Post-hoc Analysis Module¶
Tools for analyzing model outputs.
- Spatial Analysis - Spatial distribution analysis
- Temporal Analysis - Temporal dynamics analysis
- Bout Analysis - Bout-wise analysis
- Grid Heatmaps - Grid-based visualization
Quick Import Reference¶
# Core functions
from compass_labyrinth import init_project, load_project
# Behavior analysis
from compass_labyrinth.behavior.preprocessing import preprocessing_utils
from compass_labyrinth.behavior.behavior_metrics.task_performance_analysis import (
performance_metrics,
success_metrics,
trajectory_analysis
)
# CoMPASS Level 1
from compass_labyrinth.compass.level_1 import prep_data, momentu, visualization
# CoMPASS Level 2
from compass_labyrinth.compass.level_2 import datastreams, model, plots, utils
# Post-hoc analysis
from compass_labyrinth.post_hoc_analysis.level_1 import (
spatial_analysis,
temporal_analysis,
bout_analysis,
grid_heatmap
)
Documentation Conventions¶
- Parameters Function parameters with type hints and descriptions
- Returns: Return values with type information
- Examples: Usage examples where available
- Source: Link to view source code on GitHub
All documentation is auto-generated from numpy-style docstrings in the source code.