Skip to content

Commit

Permalink
refactor: Apply formatting from Black
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroWave022 committed Jul 2, 2023
1 parent bac7350 commit ae2c841
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion yr_weather/locationforecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class ForecastGeometry(_ForecastData):
type: Optional[str] = None
coordinates: Optional[List[int]] = None


@dataclass
class ForecastFuture:
"""A class holding a forecast predicting the weather in the future from a specified time.
Expand All @@ -129,6 +130,7 @@ class ForecastFuture:
details: :class:`.ForecastFutureDetails`
The forecast data for this forecast.
"""

summary: Optional[ForecastFutureSummary] = None
details: Optional[ForecastFutureDetails] = None

Expand All @@ -139,6 +141,7 @@ def __post_init__(self):
if self.details:
self.details = ForecastFutureDetails.create(self.details)


@dataclass
class ForecastTime:
"""A class holding data about a forecast for a specific time.
Expand All @@ -156,6 +159,7 @@ class ForecastTime:
next_12_hours: :class:`.ForecastFuture`
A ForecastFuture with data about the forecast the 12 hours.
"""

_data: dict
time: str = field(init=False)
details: ForecastTimeDetails = field(init=False)
Expand All @@ -165,7 +169,9 @@ class ForecastTime:

def __post_init__(self) -> None:
self.time = self._data["time"]
self.details = ForecastTimeDetails.create(self._data["data"]["instant"]["details"])
self.details = ForecastTimeDetails.create(
self._data["data"]["instant"]["details"]
)
self.next_hour = ForecastFuture(**self._data["data"]["next_1_hours"])
self.next_6_hours = ForecastFuture(**self._data["data"]["next_6_hours"])
self.next_12_hours = ForecastFuture(**self._data["data"]["next_12_hours"])
Expand Down

0 comments on commit ae2c841

Please sign in to comment.