Skip to content

Dashboard — CLI Simulation Monitor

Text-based dashboard for monitoring spiking network simulations in the terminal. Displays per-neuron firing rates with trend indicators and bar charts. Designed for quick visual feedback during development — not a replacement for proper analysis tools.

SCDashboard

Maintains a rolling history (last 20 timesteps) of firing rates per neuron. On each update(), prints a formatted table with:

  • Neuron index
  • Current firing rate
  • Trend indicator: / UP (rate increasing), \ DWN (decreasing), - STY (stable, ±0.01)
  • Bar chart (rate × 20 characters)
Parameter Meaning
n_neurons Number of neurons to monitor

Methods:

  • update(firing_rates, step) — Record rates and render dashboard
  • History is auto-truncated to 20 entries per neuron

Usage

Python
from sc_neurocore.dashboard.text_dashboard import SCDashboard
import numpy as np

dash = SCDashboard(n_neurons=4)
for step in range(100):
    rates = np.random.rand(4).tolist()
    dash.update(rates, step=step)

Output:

Text Only
--- SC DASHBOARD | Step 42 ---
Neuron   | Rate     | Trend (Last 5)
----------------------------------------
#0       | 0.731    | / UP ||||||||||||||
#1       | 0.245    | \ DWN |||||
#2       | 0.500    | - STY ||||||||||
#3       | 0.892    | / UP ||||||||||||||||||
----------------------------------------

sc_neurocore.dashboard.text_dashboard

SCDashboard

Simple CLI Dashboard for monitoring SC simulation.

Source code in src/sc_neurocore/dashboard/text_dashboard.py
Python
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class SCDashboard:
    """
    Simple CLI Dashboard for monitoring SC simulation.
    """

    def __init__(self, n_neurons: int):
        self.n_neurons = n_neurons
        self.history: list[list[float]] = [[] for _ in range(n_neurons)]

    def update(self, firing_rates: list[float], step: int) -> None:
        # Update history
        for i, rate in enumerate(firing_rates):
            self.history[i].append(rate)
            if len(self.history[i]) > 20:  # Keep last 20
                self.history[i].pop(0)

        self._render(step)

    def _render(self, step: int) -> None:
        # ANSI Escape codes for clearing screen/cursor might not work well in all notebook/CLI envs
        # We will just print a frame separator.

        print(f"\n--- SC DASHBOARD | Step {step} ---")
        print(f"{'Neuron':<8} | {'Rate':<8} | {'Trend (Last 5)'}")
        print("-" * 40)

        for i in range(self.n_neurons):
            rate = self.history[i][-1]

            # Simple sparkline-like trend
            trend = ""
            if len(self.history[i]) >= 2:
                diff = rate - self.history[i][-2]
                if diff > 0.01:
                    trend = "/ UP"
                elif diff < -0.01:
                    trend = "\\ DWN"
                else:
                    trend = "- STY"

            # Bar chart
            bar_len = int(rate * 20)
            bar = "|" * bar_len

            print(f"#{i:<7} | {rate:.3f}    | {trend} {bar}")

        print("-" * 40)