Skip to content

Commit 29ab7bf

Browse files
committed
Fix region.py merge artifacts and ruff errors
1 parent b306e61 commit 29ab7bf

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

region.py

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
1-
import streamlit as st
21
import pandas as pd
32
import plotly.express as px
4-
import requests
5-
6-
from data_utils import (
7-
parse_period_and_value,
8-
top_n_by_total,
9-
)
10-
# from eia_api import fetch_all_pages
11-
12-
st.set_page_config(page_title="EIA Demand by Region (ET)", layout="wide")
13-
st.title("U.S. Electricity Demand by Region (Eastern Time)")
14-
15-
# API Key Retrieval
16-
api_key = st.secrets.get("EIA_API_KEY", None)
17-
18-
# Predefine time and unit values
19-
start = st.sidebar.text_input("Start date (YYYY-MM-DD)", value="2026-02-09")
20-
end = st.sidebar.text_input("End date (YYYY-MM-DD)", value="2026-02-16")
21-
units = st.sidebar.radio("Units", ["MWh", "GWh"], horizontal=True)
3+
import streamlit as st
224

235
from data_utils import (
246
convert_units,
@@ -57,8 +39,7 @@ def load_region_data(api_key: str, start: str, end: str) -> pd.DataFrame:
5739
"length": 5000,
5840
}
5941
rows = fetch_all_pages(BASE_URL, params)
60-
df = pd.json_normalize(rows)
61-
return df
42+
return pd.json_normalize(rows)
6243

6344

6445
with st.spinner("Loading data from EIA..."):

0 commit comments

Comments
 (0)