-
-
Notifications
You must be signed in to change notification settings - Fork 31
Uk national #157
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
base: main
Are you sure you want to change the base?
Uk national #157
Conversation
…nal-and-gsp-locations # Conflicts: # src/quartz_api/cmd/main.py # src/quartz_api/internal/backends/dataplatform/client.py # src/quartz_api/internal/models.py
…nal-and-gsp-framework # Conflicts: # src/quartz_api/cmd/main.py
…-locations # Conflicts: # src/quartz_api/cmd/main.py # src/quartz_api/internal/service/uk_national/gsp.py # src/quartz_api/internal/service/uk_national/national.py # src/quartz_api/internal/service/uk_national/system.py
# Conflicts: # src/quartz_api/internal/service/uk_national/national.py
# Conflicts: # src/quartz_api/internal/service/uk_national/national.py
# Conflicts: # src/quartz_api/internal/service/uk_national/gsp.py # src/quartz_api/internal/service/uk_national/national.py # src/quartz_api/internal/service/uk_national/system.py
# Conflicts: # src/quartz_api/internal/backends/dataplatform/client.py
| return forecasts_one_timestamp | ||
|
|
||
| @override | ||
| async def get_forecast_for_multiple_locations( |
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.
I could also move this into the gsp.py route, and just use the route for get forecast at one timestamp. But we do need to make sure we only call ListForecastersRequest request once
devsjc
left a comment
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.
Lots of notes to do with changing where default values are managed and removing a bunch of optional ones. I think this makes the logic path much easier to follow.
| forecaster_name: str | None = None, | ||
| start_datetime: dt.datetime | None = None, | ||
| end_datetime: dt.datetime | None = None, | ||
| created_before_datetime: dt.datetime | None = None, |
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.
I don't think these should be optional at this level; it should be the job of the HTTP route calling these interface functions to put suitable defaults onto them.
| forecaster_name: str | None = None, | |
| start_datetime: dt.datetime | None = None, | |
| end_datetime: dt.datetime | None = None, | |
| created_before_datetime: dt.datetime | None = None, | |
| forecaster_name: str, | |
| start_datetime: dt.datetime, | |
| end_datetime: dt.datetime, | |
| created_before_datetime: dt.datetime, |
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.
I agree with datetimes, but the forecaster_name sometimes we just want to pull a forecast, and API doesnt need to know which model to pull this for.
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.
Fair enough.
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.
Most of this can go
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.
I think this needs to stay. We need to have a function somewhere that floor the start time to the nearest 6 hours, and then minuses it. I think this is the right place for the tests
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.
Not if they live in the defaults though? It would be odd to test the pandas 'floor' or subtract timedelta functions, as you trust pandas to have tested that.
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.
- Its not pandas
- the logic of floor 6 and minus 2 days I think is worth its own function
- linting didnt let me put datetime.now() in the defaults
B008 Do not perform function call `dt.datetime.now` in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
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.
Similarly, most of this can go
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.
I think this needs to stay. We need to have a function somewhere that floor the start time to the nearest 6 hours, and then minuses it. I think this is the right place for it.
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.
See my above comment.
Co-authored-by: devsjc <47188100+devsjc@users.noreply.github.com>
Co-authored-by: devsjc <47188100+devsjc@users.noreply.github.com>
Co-authored-by: devsjc <47188100+devsjc@users.noreply.github.com>
|
BTW, i got a linting error you ok with this @devsjc ? |
Co-authored-by: devsjc <47188100+devsjc@users.noreply.github.com>
Pull Request
Description
Move uk-national over to this quartz-api
Currently
#147
How Has This Been Tested?
dont do in this PR: add end to end test for uk-national with the app #179
dont do in this PR: add seperate UAT in airflow that tests it
Checklist: