From 87277813a18d38747f575c7a9bf7bfc58dc4b2d7 Mon Sep 17 00:00:00 2001 From: nc9 Date: Tue, 26 May 2026 08:52:07 +1000 Subject: [PATCH] fix(types): remove DataMetric.RENEWABLE_PROPORTION The renewable proportion is a market-level metric. The API only exposes it via /market/network/ (MarketMetric.RENEWABLE_PROPORTION, shipped in v0.11.0). It is not implemented on /data/network/, so calling get_network_data(metrics=[DataMetric.RENEWABLE_PROPORTION]) returned a confusing 400 with no useful message. Drop the dead enum value so users can't accidentally use the broken path; document the correct one in the DataMetric docstring. Fixes #18 --- openelectricity/types.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openelectricity/types.py b/openelectricity/types.py index b128453..3f286ab 100644 --- a/openelectricity/types.py +++ b/openelectricity/types.py @@ -36,13 +36,18 @@ class Network(StrEnum): class DataMetric(StrEnum): - """Data metrics available for network and facility data.""" + """Data metrics available for network and facility data. + + Note: ``renewable_proportion`` is a market-level metric and is only + available via :meth:`get_market` with + :attr:`MarketMetric.RENEWABLE_PROPORTION`. It is not exposed on + ``/data/network/`` and so is not listed here. + """ POWER = "power" ENERGY = "energy" EMISSIONS = "emissions" MARKET_VALUE = "market_value" - RENEWABLE_PROPORTION = "renewable_proportion" STORAGE_BATTERY = "storage_battery"