Skip to content

Commit

Permalink
change column back to system id
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Oct 23, 2024
1 parent 5a4ffdb commit 634c490
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions india_forecast_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_generation_data(
session=db_session, site_uuids=site_uuids, start_utc=start, end_utc=end
)
# hard code as for the moment
system_id = 1
system_id = sites[0].ml_id

if len(generation_data) == 0:
log.warning("No generation found for the specified sites/period")
Expand Down Expand Up @@ -129,9 +129,6 @@ def get_generation_data(
col = generation_df.columns[0]
generation_df[col] = generation_df[col].astype(float) * 1e3\

# rename columns 0 to power_kw
generation_df.rename({col:"power_kw"}, axis=1, inplace=True)

# Site metadata dataframe
sites_df = pd.DataFrame(
[
Expand Down
2 changes: 1 addition & 1 deletion tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_get_generation_data(db_session, sites, generation_db_values, init_times

# Check for 5 (non-null) generation values
assert len(gen_df) == 5
assert not gen_df["power_kw"].isnull().any() # 0 is the ml_id/system_id of the wind site
assert not gen_df["0"].isnull().any() # 0 is the ml_id/system_id of the wind site

# Check first and last timestamps are correct
assert gen_df.index[0] == init_timestamp - dt.timedelta(hours=1)
Expand Down

0 comments on commit 634c490

Please sign in to comment.