ContinuousSaver#
- class ContinuousSaver(
- save_path: Path,
- chunk_duration__ms: Quantity__ms = 10000.0 * pq.ms,
- populations: dict | None = None,
- recording_config: dict | None = None,
Bases:
objectManages continuous saving of simulation data in chunks to prevent memory overflow.
Instead of accumulating all data in RAM, this class periodically saves chunks to disk and clears memory. Data can be loaded and combined afterward.
- Parameters:
save_path (Path) – Directory where chunks will be saved
chunk_duration__ms (float) – Duration of each chunk in milliseconds (default: 10000 ms = 10 seconds)
populations (dict) – Dictionary of populations to record from
recording_config (dict) – Configuration like {“aMN”: [0, 10, 20, …]} for which cells to record
Methods
Save final chunk and spike data.
Record a spike event.
Record data for current simulation timestep.
- record_step(timestep__ms: float) None[source]#
Record data for current simulation timestep.
Call this from your step callback at each timestep.
- finalize(
- timestep__ms: Quantity__ms,
- spike_results=None,
Save final chunk and spike data.
Call this after simulation completes.
- Parameters:
timestep__ms (Quantity__ms) – Integration timestep in milliseconds
spike_results (NEO Block, optional) – NEO Block containing spike trains from SimulationRunner. If provided, spike data will be extracted and saved to chunks.
- Return type: