Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Installation

Requirements

Install from Source

Clone the repository and install in editable mode:

git clone https://github.com/NLR-Distribution-Suite/gdm_flow.git
cd gdm_flow
pip install -e .

Optional Extras

GDM-Flow has optional dependency groups for different use cases:

# For AC OPF and DC OPF solvers (requires SciPy)
pip install -e ".[optimization]"

# For sparse Y-bus matrices
pip install -e ".[sparse]"

# For interactive Plotly dashboards
pip install -e ".[plotting]"

# For development and testing
pip install -e ".[dev]"

# For MCP server runtime and MCP tests
pip install -e ".[mcp,optimization]"

# Install everything
pip install -e ".[optimization,sparse,plotting,dev,mcp]"

Dependencies

PackagePurposeRequired
numpyArray operations, Y-bus matricesYes
grid-data-modelsDistribution system data modelYes
typerCLI frameworkYes
richTerminal formattingYes
scipyAC/DC optimization solvers, AC PFOptional
plotlyInteractive HTML dashboardsOptional
mcpMCP server runtime and MCP testsOptional

Testing Notes

For a consolidated local/CI testing reference, see docs/guide/testing.md.

Run all tests:

pytest -v --tb=short

Run MCP server tests directly:

pip install -e ".[mcp,optimization,dev]"
pytest -v --tb=short tests/test_mcp_server.py

In GitHub Actions, MCP tests are enforced by the dedicated mcp-test job in .github/workflows/ci.yml.

Verify Installation

After installation, verify the CLI is available:

gdm-flow --help

You should see:

Usage: gdm-flow [OPTIONS] COMMAND [ARGS]...

 GDM-Flow — Power flow & optimal power flow for distribution systems

╭─ Commands ──────────────────────────────────────────────╮
│ info                Show system topology and component summary.   │
│ run                 Run one or more OPF solvers.                  │
│ compare             Run all solvers and compare results.          │
│ plot                Generate interactive analysis dashboard.      │
│ export              Run solvers and export results to SQLite.     │
│ report-overvoltage  Print voltage violations from results.        │
│ report-overload     Print branch loading violations.              │
│ db-schema           Print SQLite table/column schema.             │
╰─────────────────────────────────────────────────────────╯

Or verify in Python:

import gdm_flow
print(dir(gdm_flow))