summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-10-07 23:51:52 +0200
committerAki <please@ignore.pl>2022-10-07 23:51:52 +0200
commitfc9d28f0cab30dd349fb8b235ef633520817d051 (patch)
treebf2d344e9fa0c9248385f63b6afad64231492a21
parent73b7fe1a0487b1791d8bccd9adcde0e05b49a560 (diff)
downloadwindy-fc9d28f0cab30dd349fb8b235ef633520817d051.zip
windy-fc9d28f0cab30dd349fb8b235ef633520817d051.tar.gz
windy-fc9d28f0cab30dd349fb8b235ef633520817d051.tar.bz2
Added quick accessors for levels and parameters in Prediction
-rw-r--r--windy/point_forecast.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/windy/point_forecast.py b/windy/point_forecast.py
index 938d30e..0132751 100644
--- a/windy/point_forecast.py
+++ b/windy/point_forecast.py
@@ -120,6 +120,17 @@ class Prediction:
def timestamp(self) -> datetime:
return self._response.timestamps[self._index]
+ @property
+ def parameters(self) -> tuple:
+ return self._response.parameters
+
+ @property
+ def levels(self) -> tuple:
+ return self._response.levels
+
+ def __iter__(self):
+ return iter(self.parameters)
+
def __getitem__(self, key):
return self._response.samples[key][self._index]