Skip to main content

Orchestration and reference app layer for ML4U chapter examples

Project description

GridSmith

Orchestration and reference app layer for ML4U (Machine Learning for Utilities) chapter examples.

Overview

GridSmith provides a clean, layered architecture for running ML4U chapter examples. It composes algorithms from the Smith library ecosystem (timesmith, anomsmith, geosmith, ressmith, plotsmith) without implementing new algorithms itself.

Architecture

GridSmith is organized into four layers:

  1. Core Layer: Domain objects, configs, and pipelines that compose Smith libraries
  2. API Layer: Stable public interface with user-friendly entrypoints
  3. CLI Layer: Terminal interface for running pipelines
  4. Examples Layer: Runnable chapter examples with documentation

Quick Start

Installation

Basic installation:

pip install gridsmith

With Smith libraries (recommended for full functionality):

pip install gridsmith[smith]
# or
pip install -r requirements-smith.txt

Running a Pipeline

Using the CLI:

gridsmith run ami-anomaly --config configs/ami_anomaly.yaml

Using Python:

from gridsmith import GridSmithClient
from gridsmith.api.config import AMIAnomalyConfig

client = GridSmithClient()
config = AMIAnomalyConfig(
    input_path="data/ami_data.csv",
    output_dir="runs/output",
)

results = client.ami_anomaly(config)

Available Pipelines

GridSmith provides machine learning pipelines for utility operations. Here are the available pipelines:

Core Applications (Part II)

  • ami-anomaly: AMI anomaly detection
  • temperature-load: Temperature-to-load modeling
  • ml-fundamentals: Regression, classification, clustering
  • load-forecasting: Load forecasting with ARIMA/LSTM
  • predictive-maintenance: Asset health monitoring
  • outage-prediction: Storm outage prediction
  • grid-optimization: Grid optimization with RL
  • der-forecasting: Distributed energy resource forecasting
  • demand-response: Customer load profiling

Advanced Techniques (Part III)

  • computer-vision: Vegetation detection, PLD
  • nlp: Log classification, entity extraction
  • ai-utilities: LLM integration
  • geospatial: Feeder mapping, asset location

Integration & Scale (Part IV)

  • mlops: MLflow integration, model registry
  • cybersecurity: Threat detection
  • ethics: Fairness auditing
  • roi-analysis: Cost-benefit analysis
  • realtime-analytics: Streaming analytics
  • compliance: SAIDI/SAIFI reporting
  • feature-engineering: Temporal, geospatial features
  • reliability: Reliability analytics
  • market-operations: Price forecasting, bidding

Advanced Research

  • causal-inference: Difference-in-differences, synthetic control
  • multi-task-learning: MTL models

See Documentation for more details.

Project Structure

gridsmith/
├── src/gridsmith/
│   ├── core/          # Layer 1: Domain objects and pipelines
│   ├── api/           # Layer 2: Public interface
│   └── cli/           # Layer 3: Command-line interface
├── examples/          # Layer 4: Chapter examples
├── configs/           # Configuration files
├── docs/              # Documentation
└── tests/             # Test suite

Development

Setup

git clone <repository>
cd gridsmith
pip install -e ".[dev]"

Running Tests

pytest

Linting

ruff check .

Type Checking

mypy src/gridsmith

Documentation

Design Principles

  1. No new algorithms: GridSmith orchestrates existing Smith libraries
  2. Pure orchestration: Core layer composes, doesn't compute
  3. Stable API: Public interface hides internal structure
  4. Runnable examples: Every chapter has a working example
  5. Testable: Golden tests validate schema and metrics

Definition of Done

  • ✅ Can run one command from a clean venv
  • ✅ Get metrics, tables, and figures in a run folder
  • ✅ README explains inputs and outputs
  • ✅ Test asserts schema and metric keys

Integration Policy

GridSmith integrates with the Smith library ecosystem:

  • timesmith: Time series forecasting and analysis
  • anomsmith: Anomaly detection
  • plotsmith: Data visualization

GridSmith uses graceful fallback - it works with or without Smith libraries installed:

  • Attempts to use Smith libraries when available
  • Falls back to local implementations if libraries are missing
  • Supports multiple API patterns for maximum compatibility

See Integration Guide for details.

Dependencies

GridSmith depends on Smith libs by version:

  • Pin minimal versions
  • Avoid tight coupling to internal modules
  • Import from public APIs only
  • Graceful degradation if libraries unavailable

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gridsmith-0.1.1.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gridsmith-0.1.1-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

Details for the file gridsmith-0.1.1.tar.gz.

File metadata

  • Download URL: gridsmith-0.1.1.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gridsmith-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f2e0fe0722dbb6de908a99f76173b61e40c2218aaa850527cebaf4368f5dbd8e
MD5 e1bcca4273e3ab957ee853ac35e27157
BLAKE2b-256 4d5dabb8b267a0e6cefcfaa5f4c844d780646cb6c0fa8f8fc725bb8d4dfbf1c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for gridsmith-0.1.1.tar.gz:

Publisher: release.yml on kylejones200/gridsmith

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gridsmith-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: gridsmith-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gridsmith-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 774e79e582ddc0ea2a0227d43d29c99840f2545b7a1e8d177cc44b27cc646ffe
MD5 3132cd0315310d07c2ef25e5d4a76d0a
BLAKE2b-256 3707520982723b272ee2f4df9133f5da38393d61f20046178a56161665c86754

See more details on using hashes here.

Provenance

The following attestation bundles were made for gridsmith-0.1.1-py3-none-any.whl:

Publisher: release.yml on kylejones200/gridsmith

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page