Skip to content

Commit d156642

Browse files
Document members of Forecast class
1 parent 7aabff8 commit d156642

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

src/datapoint/Forecast.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,26 @@ def __init__(self, frequency, api_data):
111111
self.frequency = frequency
112112
self.data_date = datetime.datetime.fromisoformat(
113113
api_data["features"][0]["properties"]["modelRunDate"]
114-
)
115-
116-
self.forecast_longitude = api_data["features"][0]["geometry"]["coordinates"][0]
117-
self.forecast_latitude = api_data["features"][0]["geometry"]["coordinates"][1]
114+
) #: The date the provided forecast was generated.
115+
116+
self.forecast_longitude = api_data["features"][0]["geometry"]["coordinates"][
117+
0
118+
] #: The longitude of the provided forecast.
119+
self.forecast_latitude = api_data["features"][0]["geometry"]["coordinates"][
120+
1
121+
] #: The latitude of the provided forecast.
118122
self.distance_from_requested_location = api_data["features"][0]["properties"][
119123
"requestPointDistance"
120-
]
121-
self.name = api_data["features"][0]["properties"]["location"]["name"]
124+
] #: The distance of the location of the provided forecast from the requested location
125+
self.name = api_data["features"][0]["properties"]["location"][
126+
"name"
127+
] #: The name of the location of the provided forecast
122128

123129
# N.B. Elevation is in metres above or below the WGS 84 reference
124130
# ellipsoid as per GeoJSON spec.
125-
self.elevation = api_data["features"][0]["geometry"]["coordinates"][2]
126-
127-
# Need different parsing to cope with daily vs. hourly/three-hourly
128-
# forecasts. Do hourly first
131+
self.elevation = api_data["features"][0]["geometry"]["coordinates"][
132+
2
133+
] #: The elevation of the location of the provided forecast
129134

130135
forecasts = api_data["features"][0]["properties"]["timeSeries"]
131136
parameters = api_data["parameters"][0]

0 commit comments

Comments
 (0)