Skip to main content

power-dispatch-studio

The PH WESM dispatch engine behind Power Dispatch Studio, as an importable, citable Python module and CLI.

The studio runs the same linear optimization and lowest-cost-first dispatch (merit order) in the browser with HiGHS compiled to WebAssembly. This package is the Python reference code for replaying one recorded day. It builds a supply stack for each island grid from a calculated snapshot of public IEMOP data, applies scenario changes, and clears the three connected grids with inter-grid limits, storage, reserves, and a daily hydro-energy limit. The same calculation and numbers can run in a notebook.

Install

pip install power-dispatch-studio

The only runtime dependency is highspy (the HiGHS solver). A dated snapshot of the public data archive ships in the wheel, so it runs with no network access.

CLI

power-dispatch days                              # recorded days available
power-dispatch run --date 2026-06-15             # hourly CSV to stdout
power-dispatch run --date 2026-06-15 --offer-mode # replay the market's own bids
power-dispatch run --date 2026-06-15 --demand luzon=1500 -o out.csv
power-dispatch run --scenario scenario.json -o out.csv

Python

import power_dispatch as pd

pd.list_days()[:3]
# ['2026-05-01', '2026-05-02', '2026-05-03']

result = pd.run_scenario({
    "date": "2026-06-15",
    "opts": {"demand_delta": {"luzon": 1500}},  # +1.5 GW data-center load
})
result["summary"]["mean_price"]["luzon"]   # PhP/kWh

The scenario override map

A scenario is {"date": "YYYY-MM-DD", "opts": {...}}. The engine accepts the following override keys.

key type meaning
demand_delta {grid: MW} or {grid: [24 MW]} load added or removed, flat or with an hourly shape
fuel_cost {fuel: PhP/kWh} marginal-cost override
fuel_avail_delta {grid: {fuel: MW}} availability edit
solar_delta_mw {grid: MW} installed solar edit
hydrology float water multiplier (1.0 = observed)
caps {leyte|mvip: MW or [24]} link limits
storage [{grid, power_mw, energy_mwh}] added BESS
reserve_deduction bool withhold scheduled reserve
offer_mode bool replay the recorded offer book. False uses the cost calculation
gas_budget {grid: MWh} daily gas-energy limit, for a lower-supply case

grid is one of luzon, visayas, mindanao.

The scenario file

A scenario carries a schema stamp, so a file written in one place runs in another. The studio writes it, this package reads it, and validate says what is wrong before the solver ever sees it.

power-dispatch validate myscenario.json
power-dispatch validate --keys myscenario.json   # every option, with its meaning
power-dispatch run --scenario myscenario.json -o out.csv
import power_dispatch as pd

pd.validate_scenario(scenario)      # a list of messages, and never raises
pd.load_scenario("myscenario.json") # raises ValueError carrying all of them

Your contract position

A scenario file can carry a contract book, and the engine never reads it. settle marks the book against the modeled spot price, and compare_position reports what a scenario does to it.

pos = pd.compare_position(base, scenario, book, load_mw={"luzon": 400})
pos["net_change_php"]     # the contract gain less the open position's extra cost

It marks energy against modeled spot and stops there. No capacity fee, no wheeling charge, no tax, and no credit terms.

The full key table is in the scenario schema.

The data snapshot

The bundled data is a dated snapshot of the public archive at build time (see power_dispatch/data/meta.json). To run against newer calculated data, point the engine at a copy of the deployed web/data/.

power-dispatch run --date 2026-07-01 --data-dir /path/to/web/data
# or: export POWER_DISPATCH_DATA=/path/to/web/data

That same flag runs your own system. The directory needs dispatch.json and profiles.json, and nothing in it has to be Philippine. The data contract lists every key, with a 30-line system that runs. A test in the repository builds that system, solves it, and fails when the document stops matching the engine.

What this is and is not

This replays recorded days with scenario what-ifs on a documented calculation. It is not a price forecast, and offer mode replays the market's published bids rather than simulating bidding strategy. Recorded market inputs trace to the Independent Electricity Market Operator of the Philippines (IEMOP). Fleet and cost inputs cite their own sources. Caller inputs and model assumptions have separate labels. The Historical replay view and method page report the calculation error. Read the full method.

The engine dispatches fuel blocks per island grid, so it holds no named units and no unit commitment. That is a measured choice. Committing each thermal block with a generic minimum-stable floor lowered the price correlation in all five scored series, from 0.442 to -0.003 in Visayas. pipeline/uc_probe.py in the repository carries the test.

MIT licensed.

Download files

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

Source Distribution

power_dispatch_studio-0.2.0.tar.gz (888.2 kB view details)

Uploaded Source

Built Distribution

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

power_dispatch_studio-0.2.0-py3-none-any.whl (631.8 kB view details)

Uploaded Python 3

File details

Details for the file power_dispatch_studio-0.2.0.tar.gz.

File metadata

  • Download URL: power_dispatch_studio-0.2.0.tar.gz
  • Upload date:
  • Size: 888.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.3

File hashes

Hashes for power_dispatch_studio-0.2.0.tar.gz
Algorithm Hash digest
SHA256 985f23daf908f1ecff98a185aa85676fc9c45bbd7918d0dab8358eabea1bc37b
MD5 14440c98c4bf8000adeb7adc4aa6a1cc
BLAKE2b-256 c3d945c3754b9c988f630232fdcf9c6d8a0dd0c3cea5077c7f47950c5d8658f1

See more details on using hashes here.

File details

Details for the file power_dispatch_studio-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for power_dispatch_studio-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28a1ab3235d157d4f5b06cc4c49321c26121f1ce2f05dc6f93bf2b23b9d29bc6
MD5 0f9c36bfc189d7fe223c10c5eab7e76e
BLAKE2b-256 5c59e77ae60af6c47c681348e856d33913db4aa79b98440ee7bb55954bbaffd4

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page