How hellotem/local_wandb works
Project type and purpose
• This is an open-source, offline experiment‐tracking tool (a lightweight local alternative to wandb.ai).
File structure
• Root directory:
• LICENSE, README.md
• local_wandb.py – core logging/IO library (write & read modes)
• local_wandb_ui.py – offline GUI entry point for visualizing experiments
• Runtime‐generated structure under local_wandb/<project>/<run-timestamp-name>/:
• config.json, metrics.csv
• images/ (PNG)
• tensors/ (NumPy .npy files)
README for architecture clues
• The README describes:
• A logging API that emits JSON, CSV, PNG, NPY to disk
• A list_runs & read‐mode API that reads existing runs
• A PyQt5 GUI that inputs run folders and renders plots, images, histograms
a. Main components
1. Client Code (user scripts that import LocalWandb)
2. Logging Library (local_wandb.py)
3. Local File System Storage (project/run folders: JSON, CSV, images/, tensors/)
4. Offline GUI Application (local_wandb_ui.py & internal visualization modules)
5. Third‐party Dependencies (PyQt5, Matplotlib, NumPy, (optional) PyTorch)
b. Relationships & data flows
• Client Code → Logging Library: calls run.config, run.log*, run.finish()
• Logging Library → File System: writes config.json, metrics.csv, .png, .npy
• GUI Application → File System: scans folder tree via LocalWandb.list_runs, reads files
• GUI Subcomponents (Plotter, Image Viewer, Tensor Histogram) ← File content
• GUI ←→ User: interactive selection, comparisons, plots
c. Architectural patterns & principles
• Layered architecture:
– API layer (Logging vs. Visualization)
– Storage layer (structured on‐disk)
• Separation of concerns: logging vs. UI
• Extensibility points: adding new log_* methods or visualization widgets
• Stateless library: all state persisted on disk, making it reproducible
d. Key technologies & libraries
• Python 3.x
• local_wandb.py: built‐in modules (json, csv, os), NumPy for tensors, Matplotlib for figure saving
• local_wandb_ui.py: PyQt5 GUI, Matplotlib (embedded), NumPy
• File formats: JSON (config), CSV (metrics), PNG (images/figures), NPY (tensors)