summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--windy/point_forecast.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/windy/point_forecast.py b/windy/point_forecast.py
index 558c03d..5affd05 100644
--- a/windy/point_forecast.py
+++ b/windy/point_forecast.py
@@ -85,10 +85,10 @@ class Request:
return body
-class EntryView:
+class Prediction:
"""
- Allows to iterate over samples in Response in a zip-like manner, where all parameters for a given time point are
- available via item access.
+ Allows to iterate over predicted values from the Response in a zip-like manner, where all parameters for a given
+ time point are available via item access.
"""
def __init__(self, response, index=0):
self._response = response
@@ -112,7 +112,7 @@ class EntryView:
@property
def timestamp(self):
"""
- Datetime object representing timestamp of the current entry.
+ Datetime object representing timestamp of the current prediction.
"""
return self._response.timestamps[self._index]
@@ -125,10 +125,10 @@ class Response:
Wraps raw JSON response from the Windy's API to allow for easier access, converts all values to pint's
Quantities, and converts all timestamps into datetime objects.
- Can be used in a for-loop to access all samples via EntryView:
+ Can be used in a for-loop to access all samples via Prediction:
- >>> for entry in response:
- >>> print(entry.timestamp, entry['temp-surface'])
+ >>> for prediction in response:
+ >>> print(prediction.timestamp, prediction['temp-surface'])
Otherwise, timestamps list and samples dictionary are available for direct access.
"""
@@ -150,14 +150,14 @@ class Response:
"""
return tuple(self.samples.keys())
- def entries(self) -> EntryView:
+ def predictions(self) -> Prediction:
"""
- Helper iterator to go over all of the samples in a zip-like manner.
+ Helper iterator to go over the predicted values in a zip-like manner.
"""
- return EntryView(self)
+ return Prediction(self)
def __iter__(self):
- return self.entries()
+ return self.predictions()
@dataclass