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
import numpy as np

from sc_neurocore.dashboard import SCDashboard

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 ||||||||||||||||||
----------------------------------------

Verification

The dashboard surface is covered by the dedicated flat and package test paths: tests/test_dashboard.py and tests/test_dashboard/test_text_dashboard.py. The 2026-06-27 scoped verification passed Ruff, Ruff docstring checks, strict mypy, 16 passed focused dashboard tests, and 100% isolated package coverage for sc_neurocore.dashboard.

The dashboard is a terminal rendering helper. Its Rust, Julia, and Mojo counterpart files remain placeholder safety markers because this slice did not change numerical behaviour or cross-language execution.

sc_neurocore.dashboard.text_dashboard

Text dashboard for quick terminal monitoring of SC simulation rates.

SCDashboard

Simple CLI dashboard for monitoring SC simulation rates.

Source code in src/sc_neurocore/dashboard/text_dashboard.py
Python
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
57
58
class SCDashboard:
    """Simple CLI dashboard for monitoring SC simulation rates."""

    def __init__(self, n_neurons: int) -> None:
        """Create a dashboard with one rolling history per neuron."""
        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:
        """Append one frame of firing rates and render the dashboard."""
        # 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)

__init__(n_neurons)

Create a dashboard with one rolling history per neuron.

Source code in src/sc_neurocore/dashboard/text_dashboard.py
Python
15
16
17
18
def __init__(self, n_neurons: int) -> None:
    """Create a dashboard with one rolling history per neuron."""
    self.n_neurons = n_neurons
    self.history: list[list[float]] = [[] for _ in range(n_neurons)]

update(firing_rates, step)

Append one frame of firing rates and render the dashboard.

Source code in src/sc_neurocore/dashboard/text_dashboard.py
Python
20
21
22
23
24
25
26
27
28
def update(self, firing_rates: list[float], step: int) -> None:
    """Append one frame of firing rates and render the dashboard."""
    # 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)