tyba-client 0.4.11__tar.gz → 0.4.13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tyba-client
3
- Version: 0.4.11
3
+ Version: 0.4.13
4
4
  Summary: A Python API client for the Tyba Public API
5
5
  License: MIT
6
6
  Author: Tyler Nisonoff
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "tyba-client"
3
- version = "0.4.11"
3
+ version = "0.4.13"
4
4
  description = "A Python API client for the Tyba Public API"
5
5
  authors = ["Tyler Nisonoff <tyler@tybaenergy.com>"]
6
6
  license = "MIT"
@@ -1,5 +1,5 @@
1
1
  from datetime import datetime, time
2
- from typing import List
2
+ from typing import List, Optional
3
3
 
4
4
 
5
5
  class Forecast(object):
@@ -12,15 +12,15 @@ class Forecast(object):
12
12
  return response.json()
13
13
 
14
14
  def most_recent(
15
- self,
16
- object_name: str,
17
- product: str,
18
- start_time: datetime,
19
- end_time: datetime,
20
- forecast_type=None,
21
- predictions_per_hour=None,
22
- prediction_lead_time_mins=None,
23
- horizon_mins=None,
15
+ self,
16
+ object_name: str,
17
+ product: str,
18
+ start_time: datetime,
19
+ end_time: datetime,
20
+ forecast_type=None,
21
+ predictions_per_hour=None,
22
+ prediction_lead_time_mins=None,
23
+ horizon_mins=None,
24
24
  ):
25
25
  return self.get(
26
26
  "most_recent_forecast",
@@ -37,16 +37,16 @@ class Forecast(object):
37
37
  )
38
38
 
39
39
  def most_recent_probabilistic(
40
- self,
41
- object_name: str,
42
- product: str,
43
- start_time: datetime,
44
- end_time: datetime,
45
- quantiles: List[float],
46
- forecast_type=None,
47
- predictions_per_hour=None,
48
- prediction_lead_time_mins=None,
49
- horizon_mins=None,
40
+ self,
41
+ object_name: str,
42
+ product: str,
43
+ start_time: datetime,
44
+ end_time: datetime,
45
+ quantiles: List[float],
46
+ forecast_type=None,
47
+ predictions_per_hour=None,
48
+ prediction_lead_time_mins=None,
49
+ horizon_mins=None,
50
50
 
51
51
  ):
52
52
  return self.get(
@@ -65,18 +65,18 @@ class Forecast(object):
65
65
  )
66
66
 
67
67
  def vintaged(
68
- self,
69
- object_name: str,
70
- product: str,
71
- start_time: datetime,
72
- end_time: datetime,
73
- days_ago: int,
74
- before_time: time,
75
- exact_vintage: bool = False,
76
- forecast_type=None,
77
- predictions_per_hour=None,
78
- prediction_lead_time_mins=None,
79
- horizon_mins=None,
68
+ self,
69
+ object_name: str,
70
+ product: str,
71
+ start_time: datetime,
72
+ end_time: datetime,
73
+ days_ago: int,
74
+ before_time: time,
75
+ exact_vintage: bool = False,
76
+ forecast_type=None,
77
+ predictions_per_hour=None,
78
+ prediction_lead_time_mins=None,
79
+ horizon_mins=None,
80
80
  ):
81
81
  return self.get(
82
82
  "vintaged_forecast",
@@ -96,19 +96,19 @@ class Forecast(object):
96
96
  )
97
97
 
98
98
  def vintaged_probabilistic(
99
- self,
100
- object_name: str,
101
- product: str,
102
- start_time: datetime,
103
- end_time: datetime,
104
- quantiles: List[float],
105
- days_ago: int,
106
- before_time: time,
107
- exact_vintage: bool = False,
108
- forecast_type=None,
109
- predictions_per_hour=None,
110
- prediction_lead_time_mins=None,
111
- horizon_mins=None,
99
+ self,
100
+ object_name: str,
101
+ product: str,
102
+ start_time: datetime,
103
+ end_time: datetime,
104
+ quantiles: List[float],
105
+ days_ago: int,
106
+ before_time: time,
107
+ exact_vintage: bool = False,
108
+ forecast_type=None,
109
+ predictions_per_hour=None,
110
+ prediction_lead_time_mins=None,
111
+ horizon_mins=None,
112
112
  ):
113
113
  return self.get(
114
114
  "vintaged_probabilistic_forecast",
@@ -129,15 +129,15 @@ class Forecast(object):
129
129
  )
130
130
 
131
131
  def by_vintage(
132
- self,
133
- object_name: str,
134
- product: str,
135
- vintage_start_time: datetime,
136
- vintage_end_time: datetime,
137
- forecast_type=None,
138
- predictions_per_hour=None,
139
- prediction_lead_time_mins=None,
140
- horizon_mins=None,
132
+ self,
133
+ object_name: str,
134
+ product: str,
135
+ vintage_start_time: datetime,
136
+ vintage_end_time: datetime,
137
+ forecast_type=None,
138
+ predictions_per_hour=None,
139
+ prediction_lead_time_mins=None,
140
+ horizon_mins=None,
141
141
  ):
142
142
  return self.get(
143
143
  "forecasts_by_vintage",
@@ -154,16 +154,16 @@ class Forecast(object):
154
154
  )
155
155
 
156
156
  def by_vintage_probabilistic(
157
- self,
158
- object_name: str,
159
- product: str,
160
- quantiles: List[float],
161
- vintage_start_time: datetime,
162
- vintage_end_time: datetime,
163
- forecast_type=None,
164
- predictions_per_hour=None,
165
- prediction_lead_time_mins=None,
166
- horizon_mins=None,
157
+ self,
158
+ object_name: str,
159
+ product: str,
160
+ quantiles: List[float],
161
+ vintage_start_time: datetime,
162
+ vintage_end_time: datetime,
163
+ forecast_type=None,
164
+ predictions_per_hour=None,
165
+ prediction_lead_time_mins=None,
166
+ horizon_mins=None,
167
167
  ):
168
168
  return self.get(
169
169
  "probabilistic_forecasts_by_vintage",
@@ -181,7 +181,8 @@ class Forecast(object):
181
181
  )
182
182
 
183
183
  def actuals(
184
- self, object_name: str, product: str, start_time: datetime, end_time: datetime
184
+ self, object_name: str, product: str, start_time: datetime, end_time: datetime,
185
+ predictions_per_hour: Optional[int] = None
185
186
  ):
186
187
  return self.get(
187
188
  "actuals",
@@ -190,5 +191,6 @@ class Forecast(object):
190
191
  "product": product,
191
192
  "start_time": start_time,
192
193
  "end_time": end_time,
194
+ "predictions_per_hour": predictions_per_hour,
193
195
  },
194
196
  )
@@ -11,11 +11,6 @@ from warnings import warn
11
11
  from tyba_client.utils import string_enum
12
12
 
13
13
 
14
- warn("""tyba_client.models is deprecated in favor of using generation_models. Tyba will cease to support
15
- tyba_client.models come 1/1/2025. See https://docs.tybaenergy.com/api/index.html or reach out to us for
16
- help migrating.""", FutureWarning)
17
-
18
-
19
14
  class ValidationError(ValueError):
20
15
  pass
21
16
 
File without changes