-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a national end point, that provides elexon BMRS solar foreacsts from elexonpy package #347
Add a national end point, that provides elexon BMRS solar foreacsts from elexonpy package #347
Conversation
for more information, see https://pre-commit.ci
…uk-pv-national-gsp-api into 14Richa/solar-forecast-endpoint
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea looks really good
A few points
- It would be good, to only get slar forecasts, not wind forecasts
- Need to add a test
- We might want to create a pydantic return object, not just a dataframe.
for more information, see https://pre-commit.ci
…uk-pv-national-gsp-api into 14Richa/solar-forecast-endpoint
for more information, see https://pre-commit.ci
…uk-pv-national-gsp-api into 14Richa/solar-forecast-endpoint
for more information, see https://pre-commit.ci
…uk-pv-national-gsp-api into 14Richa/solar-forecast-endpoint
Can you make sure tge pre commit works |
This is solved. |
Can you add a test? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also do you need to add elexonpy
to requirements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is good apart from a small change
Tests need test the actual api. The mocking is good though
f"&process_type=Day Ahead" | ||
) | ||
|
||
m.get(url, json=empty_mock_data, headers={"Content-Type": "application/json"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to set the actual api up and call the route. See other national tests
|
||
m.get(url, json=empty_mock_data, headers={"Content-Type": "application/json"}) | ||
|
||
response = requests.get(url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead use response = api_client.get("/v0/solar/GB/national/elexon")
, this should use the mocked api you have done above
Hmm I know this is merged now, but I'm not sure that the test added here is actually testing anything at all as it is..? 😅 cc. @peterdudfield |
I know i merged it to give it a go myself - https://github.com/openclimatefix/uk-pv-national-gsp-api/pull/350/files |
* Add a national end point, that provides elexon BMRS solar foreacsts from elexonpy package (#347) * added import statements of elexonpy * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * added API for solar forecast * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * minor fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * minor fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * changed function name * added filter functionality * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * added API link * minor fix * remove try except block * changed bmrs to elexon * minor fix * resolving pre hook * minor fix in docstring * removed router * minor fix in naming * added elexonpy in requirement.txt file * resolve hook error * minor fix * added response model * fixed unit test * remove plevel --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * first try at mocking elexon api * upadte url for api * update test, remove try and except * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * isort * and try and except * add intergation test * lint * PR comments, move elexon to below forecast and pvlive * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * change docker-compose to docker compose * fix test * Minor change to mock method on real class --------- Co-authored-by: Richa <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: braddf <[email protected]> Co-authored-by: braddf <[email protected]>
Description
This PR introduces a new API endpoint
/v0/solar/national/bmrs
to fetch BMRS solar forecasts from the Elexon API.Example Response
Below is the screenshot of the data getting from the API:
Fixes #346
Checklist: