API Reference¶
Complete API documentation for neurospatial, automatically generated from source code docstrings.
Core Modules¶
neurospatial.environment¶
The main Environment class and related functionality (modular package).
Key Classes:
Environment: Main class for discretized spatial environments
Modules:
environment.core: Core dataclass with state and propertiesenvironment.factories: Factory classmethods for creating environmentsenvironment.queries: Spatial query methodsenvironment.trajectory: Trajectory analysis methodsenvironment.fields: Spatial field operationsenvironment.metrics: Environment metrics and properties
neurospatial.composite¶
Merge multiple environments into composite structures.
Key Classes:
CompositeEnvironment: Combine multiple environments with automatic bridge inference
neurospatial.regions¶
Define and manage named regions of interest (ROIs).
Key Classes:
Region: Immutable point or polygon regionRegions: Container for managing multiple regions
neurospatial.layout¶
Layout engines for discretizing continuous space.
Key Modules:
layout.base:LayoutEngineprotocol definitionlayout.engines.*: Concrete layout implementationslayout.factories: Factory functions for creating layouts
neurospatial.alignment¶
Transform and align spatial representations.
Key Functions:
map_probabilities(): Align probability distributions between environmentsget_2d_rotation_matrix(): Create 2D rotation matrices
neurospatial.transforms¶
2D affine transformations.
Key Classes:
Affine2D: Composable 2D affine transformations
neurospatial.simulation v0.2.0+¶
Generate synthetic spatial data, neural activity, and spike trains for testing and validation.
Key Modules:
simulation.trajectory: Trajectory generation (OU process, structured laps)simulation.models: Neural models (place cells, boundary cells, grid cells)simulation.spikes: Spike generation (Poisson process, refractory periods)simulation.session: High-level session simulation APIsimulation.validation: Automated validation against ground truthsimulation.examples: Pre-configured example sessions
Key Classes:
PlaceCellModel: Gaussian place field model with ground truthBoundaryCellModel: Distance-tuned boundary/border cell modelGridCellModel: Hexagonal grid cell model (2D only)SimulationSession: Complete simulation session dataclass
Key Functions:
simulate_trajectory_ou(): Ornstein-Uhlenbeck process for realistic explorationsimulate_trajectory_sinusoidal(): Sinusoidal movement for 1D trackssimulate_trajectory_laps(): Structured lap-based trajectoriesgenerate_poisson_spikes(): Generate spikes from firing ratesgenerate_population_spikes(): Generate spikes for neuron populationssimulate_session(): One-call workflow for complete sessionsvalidate_simulation(): Compare detected fields to ground truthopen_field_session(),linear_track_session(), etc.: Pre-configured examples
See Also:
- Simulation Workflows Tutorial: Comprehensive examples and quick start guide
Layout Engines¶
Detailed documentation for each layout engine:
- RegularGridLayout
- HexagonalLayout
- GraphLayout
- MaskedGridLayout
- ShapelyPolygonLayout
- TriangularMeshLayout
- ImageMaskLayout
Navigation¶
Use the sidebar to browse the complete API reference, or search for specific functions, classes, or methods.
Docstring Format¶
All docstrings follow NumPy docstring conventions for consistency with the scientific Python ecosystem.