Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 31, 2024
1 parent edf4107 commit 5af3f6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/national.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
# Initialize Elexon API client
api_client = ApiClient()
forecast_api = GenerationForecastApi(api_client)
forecast_generation_wind_and_solar_day_ahead_get = forecast_api.forecast_generation_wind_and_solar_day_ahead_get
forecast_generation_wind_and_solar_day_ahead_get = (
forecast_api.forecast_generation_wind_and_solar_day_ahead_get
)


@router.get("/elexon", summary="Get elexon Solar Forecast")
Expand Down Expand Up @@ -100,9 +102,7 @@ def get_elexon_forecast(
logger.error("KeyError: %s. Data: %s", str(e), row)
raise HTTPException(status_code=500, detail="Internal Server Error")
except Exception as e:
logger.error(
"Error during DataFrame to Model conversion: %s. Data: %s", str(e), row
)
logger.error("Error during DataFrame to Model conversion: %s. Data: %s", str(e), row)
raise HTTPException(status_code=500, detail="Internal Server Error")

result = SolarForecastResponse(data=forecast_values)
Expand Down
1 change: 0 additions & 1 deletion src/tests/test_elexon_forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,3 @@ def test_get_elexon_forecast_with_data(mock_function, api_client):
for i in range(len(api_data)):
assert api_data[i]["expected_power_generation_megawatts"] == mock_data[i].quantity
assert pd.Timestamp(api_data[i]["timestamp"]) == pd.Timestamp(mock_data[i].publish_time)

0 comments on commit 5af3f6e

Please sign in to comment.