File size: 936 Bytes
f481275
725fa71
 
f481275
725fa71
 
f481275
725fa71
 
 
 
f481275
725fa71
 
 
f481275
 
 
 
725fa71
f481275
725fa71
 
f481275
725fa71
 
f481275
725fa71
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# electricity_prices.py
"""
Simplified electricity price module for Hugging Face demo.

We don't load CSVs or use HF_DATASET_TOKEN anymore.
The real-time app takes electricity_rate directly from the user.

This file only exists:
- to provide a simple default ELECTRICITY_RATES dict (if needed)
- to keep compatibility with older imports (get_electricity_rate)
"""

# Simple default average rates for reference / fallback
ELECTRICITY_RATES = {
    "texas": 0.15,    # average residential USD/kWh (example)
    "china": 0.08,
    "ethiopia": 0.01,
}

def get_electricity_rate(region: str, day=None) -> float:
    """
    For the real-time demo, we don't actually use this in feature construction
    (we rely on user input). But some legacy code may still call it.

    We simply return a region-average from ELECTRICITY_RATES,
    without reading any CSV or using HF_DATASET_TOKEN.
    """
    return ELECTRICITY_RATES.get(region, 0.10)