Only allow a single model to be returned through /historical#14
Merged
sam-watttime merged 3 commits intomainfrom Mar 19, 2024
Merged
Only allow a single model to be returned through /historical#14sam-watttime merged 3 commits intomainfrom
sam-watttime merged 3 commits intomainfrom
Conversation
…e ouptut types to datetime (point_time, train_start, train_end, NOT model-date)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a
modelis not specified for theWattTimeHistoricalaccessor, it will grab the most recent model available for each point_time in the specified range (start -> end).The optional
include_metaparameter will alert users what model produced each point, however there is potential for accidental harm if this is not utilized. Furthermore, there aren't many valid use cases for requesting data from multiple models in a single request.This change will ensure that historical requests can only return a single model's data. Additionally, that model will be the most recent one available for any point_time across their request.
This also required a few typing changes for datetimes. Previously were were returning
train_start,train_endanddate_startas strings fromWattTimeMyAccess. This behavior is maintained for json responses, but pandas responses convert the type to datetime objects. Likewise,WattTimeHistoricalwill now returnpoint_timeas a datetime object for pandas formats.Testing has been added for both the single model, and typing changes.