Skip to content

Commit a10d0a6

Browse files
authored
fix small issues (#33)
* fix forecast params * fix other problems * one more link * moar csv
1 parent defba6e commit a10d0a6

File tree

5 files changed

+35
-32
lines changed

5 files changed

+35
-32
lines changed

sfa_api/forecasts.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ def post(self, forecast_id, *args):
161161
to be trusted).
162162
example: |-
163163
timestamp,value,quality_flag
164-
2018-10-29T12:04:23Z,32.93,0
164+
2018-10-29T12:00:00Z,32.93,0
165+
2018-10-29T13:00:00Z,25.17,0
165166
responses:
166167
201:
167168
$ref: '#/components/responses/201-Created'

sfa_api/observations.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ def post(self, obs_id, *args):
193193
to be trusted).
194194
example: |-
195195
timestamp,value,quality_flag
196-
2018-10-29T12:04:23Z,32.93,0
196+
2018-10-29T12:00:00Z,32.93,0
197+
2018-10-29T13:00:00Z,25.17,0
197198
responses:
198199
201:
199200
$ref: '#/components/responses/201-Created'

sfa_api/schema.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from sfa_api import spec, ma
55

66

7-
VARIABLES = ['ghi', 'dni', 'dhi', 'temp', 'wspd',
7+
VARIABLES = ['ghi', 'dni', 'dhi', 'temp_air', 'wind_speed',
88
'poa', 'ac_power', 'dc_power']
99
VARIABLE_FIELD = variable = ma.String(
1010
title='Variable',
@@ -124,7 +124,7 @@ class Meta:
124124
variable = VARIABLE_FIELD
125125
site_id = ma.UUID(
126126
title='Site ID',
127-
description="UUID the assocaiated site",
127+
description="UUID the associated site",
128128
required=True)
129129
name = ma.String(
130130
title='Name',
@@ -133,9 +133,10 @@ class Meta:
133133
interval_label = ma.String(
134134
title='Interval Label',
135135
description=('For data that represents intervals, indicates if a time '
136-
'labels the beginning or ending of the interval. N/A for '
137-
'instantaneous data'),
138-
validate=validate.OneOf(['start', 'end']))
136+
'labels the beginning or ending of the interval. '
137+
'instant for instantaneous data'),
138+
validate=validate.OneOf(['beginning', 'ending', 'instant']),
139+
required=True)
139140
uncertainty = ma.Float(
140141
title='Uncertainty',
141142
description='A measure of the uncertainty of the observation values.')
@@ -209,28 +210,27 @@ class Meta:
209210
'the run length & issue frequency attribute.'))
210211
lead_time_to_start = ma.String(
211212
title='Lead time to start',
212-
description="Lead time to start of forecast",
213+
description=("The difference between the issue time and the start of "
214+
"the first forecast interval, e.g. 1 hour."),
213215
required=True)
214-
215216
interval_label = ma.String(
216217
title='Interval Label',
217218
description=('For data that represents intervals, indicates if a time '
218219
'labels the beginning or ending of the interval. N/A for '
219220
'instantaneous data'),
220-
validate=validate.OneOf(['start', 'end']))
221-
duration = ma.String(
222-
title='Duration',
223-
description="Interval duration",
224-
required=True
225-
)
226-
intervals = ma.Integer(
227-
title='Intervals',
228-
description="Intervals per submission",
221+
validate=validate.OneOf(['beginning', 'ending', 'instant']))
222+
interval_length = ma.String(
223+
title='Interval length',
224+
description=('The length of time that each data point represents '
225+
'e.g. 5 minutes, 1 hour.'),
229226
required=True
230227
)
231-
issue_frequency = ma.String(
232-
title='Issue Frequency',
233-
description="Forecast issue frequency",
228+
run_length = ma.String(
229+
title='Run Length / Issue Frequency',
230+
description=('The total length of a single issued forecast run '
231+
'e.g. 1 hour. To enforce a continuous, non-overlapping '
232+
'sequence, this is equal to the forecast run issue '
233+
'frequency.'),
234234
required=True,
235235
)
236236
value_type = ma.String(

sfa_api/sites.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class SiteView(MethodView):
6464
def get(self, site_id, *args):
6565
"""
6666
---
67-
summary: Get site information
67+
summary: Get site metadata
6868
tags:
6969
- Sites
7070
parameters:
@@ -138,7 +138,7 @@ def get(self, site_id, *args):
138138
---
139139
summary: Get site observations
140140
description: >
141-
Get all observations associated with site that user has access to
141+
Get metadata for all observations associated with site that user has access to
142142
tags:
143143
- Sites
144144
parameters:
@@ -167,7 +167,7 @@ def get(self, site_id, *args):
167167
---
168168
summary: Get site forecasts
169169
description: >
170-
Get all forecasts associated with site that user has access to
170+
Get metadata for all forecasts associated with site that user has access to
171171
tags:
172172
- Sites
173173
parameters:

sfa_api/spec.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def decorator(schema, **kwargs):
4343
'auth0': {
4444
'type': 'oauth2',
4545
'description': """Authorization request must include
46-
client_id='c16EJo48lbTCQEhqSztGGlmxxxmZ4zX' and
47-
audience='https://api.solarforecastarbiter.org'""",
46+
`client_id='c16EJo48lbTCQEhqSztGGlmxxxmZ4zX'` and
47+
`audience='https://api.solarforecastarbiter.org'`""",
4848
'flows': {
4949
'password': {
5050
'tokenUrl': 'https://solarforecastarbiter.auth0.com/oauth/token', # NOQA
@@ -75,7 +75,7 @@ def decorator(schema, **kwargs):
7575
observation GET/POST data endpoints which also support CSV files.
7676
7777
Most users will interact with the API indirectly through actions on
78-
the [dashboard](https://dashboard.solarforecastarbiter.org). Those
78+
the [dashboard](https://solarforecastarbiter.org/dashboarddoc). Those
7979
users who require direct access to the API may include observational
8080
data providers, forecast data providers, and reference data users.
8181
@@ -222,9 +222,8 @@ def decorator(schema, **kwargs):
222222
```
223223
224224
For more about how to obtain a JWT using the Resource Owner Password flow, see
225-
https://developer.okta.com/blog/2018/06/29/what-is-the-oauth2-password-grant
226-
and
227-
https://auth0.com/docs/api/authentication#resource-owner-password.
225+
[What is the OAuth2 password grant](https://developer.okta.com/blog/2018/06/29/what-is-the-oauth2-password-grant)
226+
and [Auth0 Resource Owner Password](https://auth0.com/docs/api/authentication#resource-owner-password).
228227
"""
229228
ma_plugin = MarshmallowPlugin()
230229
spec = APISpec(
@@ -259,9 +258,11 @@ def decorator(schema, **kwargs):
259258
{'name': 'Forecasts',
260259
'description': 'Access and upload forecast metadata and values.'},
261260
{'name': 'Reports',
262-
'description': 'Access reports.'},
261+
'description': 'Access reports. '
262+
'API to be determined in March/April 2019.'},
263263
{'name': 'Trials',
264-
'description': 'Access information about forecast trials.'}
264+
'description': 'Access information about forecast trials. '
265+
'API to be determined in March/April 2019.'}
265266
],
266267
servers=[
267268
{'url': '//dev-api.solarforecastarbiter.org/',

0 commit comments

Comments
 (0)