summaryrefslogtreecommitdiff
path: root/cached
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2022-05-31 15:36:40 -0700
committerScott Gasch <[email protected]>2022-05-31 15:36:40 -0700
commit02302bbd9363facb59c4df2c1f4013087702cfa6 (patch)
tree938e51338678416afc891d2839c2ee8dd341f34d /cached
parentf3dbc7dc19ba5703f8f5aa9bf8af3c491b3510f6 (diff)
Improve docstrings for sphinx.
Diffstat (limited to 'cached')
-rw-r--r--cached/weather_data.py33
1 files changed, 25 insertions, 8 deletions
diff --git a/cached/weather_data.py b/cached/weather_data.py
index 87c3260..91d665d 100644
--- a/cached/weather_data.py
+++ b/cached/weather_data.py
@@ -3,7 +3,11 @@
# © Copyright 2021-2022, Scott Gasch
-"""How's the weather?"""
+"""A cache of weather data for Bellevue, WA.
+:class:`CachedWeatherData` class that derives from :class:`Persistent`
+so that, on creation, the decorator transparently pulls in data from
+disk, if possible, to avoid a network request.
+"""
import datetime
import json
@@ -47,13 +51,26 @@ cfg.add_argument(
@dataclass
class WeatherData:
- date: datetime.date # The date
- high: float # The predicted high in F
- low: float # The predicted low in F
- precipitation_inches: float # Number of inches of precipitation / day
- conditions: List[str] # Conditions per ~3h window
- most_common_condition: str # The most common condition
- icon: str # An icon to represent it
+ date: datetime.date
+ """The date of the forecast"""
+
+ high: float
+ """The predicted high temperature in F"""
+
+ low: float
+ """The predicted low temperature in F"""
+
+ precipitation_inches: float
+ """Number of inches of precipitation / day"""
+
+ conditions: List[str]
+ """Conditions per ~3h window"""
+
+ most_common_condition: str
+ """The most common condition of the day"""
+
+ icon: str
+ """An icon representing the most common condition of the day"""
@persistent.persistent_autoloaded_singleton() # type: ignore