WattTime / watttime-python-client

A software development kit for the WattTime API, showing basic examples of usage.
4 stars 6 forks source link

Only allow a single model to be returned through /historical #14

Closed sam-watttime closed 6 months ago

sam-watttime commented 6 months ago

If a model is not specified for the WattTimeHistorical accessor, it will grab the most recent model available for each point_time in the specified range (start -> end).

The optional include_meta parameter 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_end and date_start as strings from WattTimeMyAccess. This behavior is maintained for json responses, but pandas responses convert the type to datetime objects. Likewise, WattTimeHistorical will now return point_time as a datetime object for pandas formats.

Testing has been added for both the single model, and typing changes.