Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
920dca2
basic eda for 2d boids dataset
dimkab Oct 28, 2025
7d4db23
plotting functions for forces
dimkab Oct 28, 2025
425a5d4
todo list for spatial analysis dashboard
dimkab Nov 1, 2025
929708f
cleanup
dimkab Nov 1, 2025
309b36a
initial db implementation, with scripts for generation and boids 3d d…
dimkab Nov 5, 2025
e8e1363
minor
dimkab Nov 5, 2025
0d22aa1
adding env node type
dimkab Nov 5, 2025
72503fa
extended properties properly loaded into the table
dimkab Nov 6, 2025
d72b187
updated docs
dimkab Nov 6, 2025
d566ed9
initial mock analysis gui app; some grafana
dimkab Nov 7, 2025
97159e0
widgets-refactor
dimkab Nov 7, 2025
6d820df
simplify categories todo
dimkab Nov 7, 2025
40bff5a
schema refactor and reorganizing files
dimkab Nov 8, 2025
6cbe2ff
clean up .md mess
dimkab Nov 9, 2025
7cee8da
fixed
dimkab Nov 12, 2025
df3ded2
removed heatmap widget
dimkab Nov 12, 2025
ad3ac0c
cleanup; histogram/time series plots update
dimkab Nov 13, 2025
d473585
split the basic widget into two. improved hist/time series visualizat…
dimkab Nov 13, 2025
3dbc9fd
gnn rollout loader; bug fixes
dimkab Nov 14, 2025
9dcfff2
default window size set to 10
dimkab Nov 14, 2025
19c513f
raw property plots; configurable quantiles; distance_to_food; scope d…
dimkab Nov 19, 2025
107134c
optional normalization of shown extended properties
dimkab Nov 20, 2025
22e433c
javascript 2d animation; add some extra properties to gnn rollouts
dimkab Nov 20, 2025
460077a
session scope; nice violin plots
dimkab Nov 21, 2025
6476001
cloud deployment working
dimkab Nov 21, 2025
d6ef721
3d animation works
dimkab Nov 21, 2025
9961b6d
increased memory
dimkab Nov 21, 2025
28cb71d
merged violin plot type
dimkab Nov 21, 2025
166c03f
rollout import fixed
dimkab Nov 23, 2025
e770546
session scope analysis fixes
dimkab Nov 25, 2025
007906d
Merge branch 'main' into db-eda-dashboard
dimkab Nov 25, 2025
51aea3d
added time control to property name extraction
dimkab Nov 26, 2025
bfd2d84
Merge branch 'main' into db-eda-dashboard
dimkab Dec 2, 2025
e856bb9
renamed readme for data dashboard
dimkab Dec 4, 2025
b2452c5
Merge branch 'main' into db-eda-dashboard
dimkab Dec 4, 2025
146c563
Merge branch 'main' into db-eda-dashboard
dimkab Dec 12, 2025
d43715d
basic cloud sql access example
dimkab Jan 6, 2026
d665131
updated the query notebook for cloud sql examples
dimkab Jan 7, 2026
c1b8732
updated query db notebook and setup (sql files were missing)
dimkab Jan 7, 2026
a3a3d52
fixed animation; pinned aiosql
dimkab Jan 7, 2026
37167ae
better handling of project dependencies
dimkab Jan 7, 2026
1663d56
support for multiple CSV formats in the data dashboard
dimkab Jan 13, 2026
3da0c3e
some gui conveniences
dimkab Jan 13, 2026
7aec1ed
pinning aiosql again
dimkab Jan 13, 2026
7072c73
bulk insert optimization (default off)
dimkab Jan 21, 2026
948e370
script to run the dashboard easily
dimkab Feb 12, 2026
b2272b0
Merge branch 'main' into db-eda-dashboard
dimkab Feb 23, 2026
35c83a1
formatting changes to make lint happy; setup extra for db-dashboard
dimkab Feb 23, 2026
c03bcc6
do not swallow exception
dimkab Feb 23, 2026
3d176ad
fix docs and CI
dimkab Feb 23, 2026
3f28ccb
fixing some tests
dimkab Feb 23, 2026
7b500cd
disable cloud_db notebook in CI
dimkab Feb 23, 2026
a524703
now also test runs locally
dimkab Feb 23, 2026
f3cb05f
info metadata popup
dimkab Mar 5, 2026
2787281
bundle schema sql files with the package
dimkab Mar 10, 2026
6b9eeda
moved schema files inside the package, similar to queries
dimkab Mar 10, 2026
b92cfee
lint
dimkab Mar 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Database Configuration
# Copy this file to .env and fill in your values

# Database Backend Selection
# Options: 'postgres' or 'duckdb'
DB_BACKEND=duckdb

# PostgreSQL Configuration (used when DB_BACKEND=postgres)
POSTGRES_DB=tracking_analytics
POSTGRES_USER=dima
POSTGRES_PASSWORD=
POSTGRES_HOST=localhost
POSTGRES_PORT=5432

# DuckDB Configuration (used when DB_BACKEND=duckdb)
DUCKDB_PATH=tracking.duckdb
DUCKDB_READ_ONLY=false
87 changes: 87 additions & 0 deletions .gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# .gcloudignore - Exclude files from Cloud Build uploads
# This works like .dockerignore but for gcloud builds submit

# Data directories (IMPORTANT - exclude large data files)
# Use / prefix to match only at root level
/data/
/simulated_data/
/trained_models/
/meshes/
*.duckdb
*.duckdb.wal

# Git
.git/
.gitignore

# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
*.egg-info/
dist/
build/

# Virtual environments
.venv/
.venv-*/
venv/
env/
ENV/

# IDE
.vscode/
.idea/
*.swp
*.swo

# Documentation
docs/
*.md
*.rst

# Tests
tests/
.pytest_cache/

# Notebooks
*.ipynb
.ipynb_checkpoints/

# Cache
.cache/
*.cache

# Models and weights (if you have any)
*.pth
*.pt
*.pkl
*.h5
*.onnx

# Docker (keep only what we need)
Dockerfile
.dockerignore

# Misc
.DS_Store
*.log
*.tmp

# Keep only essential files for dashboard deployment
!requirements-db.txt
!pyproject.toml
!README.rst
!collab_env/
!schema/
!scripts/deploy/

.mypy_cache/
submodules/
sim-output/
config-local/
results/
analysis/
.ruff_cache/
59 changes: 59 additions & 0 deletions TESTING_SAFETY_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 🚨 TESTING SAFETY - READ THIS FIRST! 🚨

## CRITICAL WARNING

**Database tests will DROP ALL TABLES and DELETE ALL DATA!**

## Before Running Tests

### ✅ SAFE: Using Test Database
```bash
export POSTGRES_DB=tracking_analytics_test # Ends with _test
pytest tests/db/
```

### ❌ DANGEROUS: Using Production Database
```bash
export POSTGRES_DB=tracking_analytics # Production database!
pytest tests/db/ # ← This will DELETE ALL YOUR DATA!
```

## Safety Checks

Tests include automatic safety checks that will REFUSE to run if:

1. Database name is `tracking_analytics`, `production`, `prod`, or `main`
2. Database name doesn't end with `_test`

**If tests are skipped, this is PROTECTING YOUR DATA!**

## Setup Test Database

```bash
# Create test database
createdb tracking_analytics_test

# Configure environment
export POSTGRES_DB=tracking_analytics_test
export POSTGRES_USER=your_user
export POSTGRES_PASSWORD=your_password

# Now tests are safe to run
pytest tests/db/ -v
```

## Full Documentation

See [docs/data/db/testing_safety.md](docs/data/db/testing_safety.md) for complete testing guidelines.

## Quick Reference

| Database Name | Tests Will Run? | Safe? |
|---------------|-----------------|-------|
| `tracking_analytics_test` | ✅ Yes | ✅ Safe |
| `mydb_test` | ✅ Yes | ✅ Safe |
| `tracking_analytics` | ❌ BLOCKED | 🚨 Would destroy data |
| `production` | ❌ BLOCKED | 🚨 Would destroy data |
| `mydb` | ❌ BLOCKED | 🚨 No _test suffix |

**When in doubt, tests being skipped is GOOD - it means your production data is protected!**
58 changes: 58 additions & 0 deletions collab_env/dashboard/analysis_widgets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Analysis Widget Configuration
#
# This file defines which analysis widgets are enabled and their default parameters.
# Widgets are loaded in order and appear as tabs in the spatial analysis GUI.

# Default shared parameters (used across all widgets unless overridden)
defaults:
spatial_bin_size: 10.0 # Spatial discretization for heatmaps
temporal_window_size: 10 # Time window for windowed analyses
min_samples: 100 # Minimum samples for statistical validity (matches QueryBackend default)

# Widget registry
# Each widget must specify:
# - class: Full Python module path to widget class
# - enabled: true/false to enable/disable widget
# - order: Display order (lower numbers appear first)
# - category: Grouping category (spatial, temporal, behavioral)

widgets:
- class: collab_env.dashboard.widgets.basic_data_viewer_widget.BasicDataViewerWidget
enabled: true
order: 0
category: visualization
description: "Episode viewer with animated agent tracks and spatial density heatmap"

- class: collab_env.dashboard.widgets.extended_properties_viewer_widget.ExtendedPropertiesViewerWidget
enabled: true
order: 1
category: visualization
description: "Time series and histogram visualization of extended properties"

- class: collab_env.dashboard.widgets.velocity_widget.VelocityStatsWidget
enabled: true
order: 2
category: temporal
description: "Comprehensive velocity statistics: individual speed, mean velocity magnitude, relative velocity magnitude"

- class: collab_env.dashboard.widgets.distance_widget.DistanceStatsWidget
enabled: true
order: 3
category: spatial
description: "Relative locations: pairwise distances between agents"

- class: collab_env.dashboard.widgets.correlation_widget.CorrelationWidget
enabled: false
order: 4
category: behavioral
description: "Agent velocity correlations"

# Example: To disable a widget, set enabled to false
# - class: collab_env.dashboard.widgets.correlation_widget.CorrelationWidget
# enabled: false

# Example: To add a custom widget
# - class: my_package.widgets.custom_widget.CustomWidget
# enabled: true
# order: 5
# category: custom
24 changes: 24 additions & 0 deletions collab_env/dashboard/spatial_analysis_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""
Entry point for Spatial Analysis Dashboard.

Run with:
panel serve collab_env/dashboard/spatial_analysis_app.py --show --port 5008 --static-dirs dashboard-static=collab_env/dashboard/static

Development mode with autoreload:
panel serve collab_env/dashboard/spatial_analysis_app.py --dev --show --port 5008 --static-dirs dashboard-static=collab_env/dashboard/static

Note: The --static-dirs argument maps the dashboard's static files (JS/CSS)
to the /dashboard-static/ URL route. This is required for the animation viewer.
"""

import panel as pn
import holoviews as hv
from collab_env.dashboard.spatial_analysis_gui import create_app

# Enable Panel extensions (removed "modal" - not needed for HTML-based overlay)
pn.extension("tabulator", "plotly")
hv.extension("plotly", "bokeh") # plotly first for Scatter3D support

# Create and serve the app
app = create_app()
app.servable()
Loading
Loading