From 217587910592a25decd02ab9bff70a0b3c86c5cc Mon Sep 17 00:00:00 2001 From: null8626 Date: Wed, 14 Feb 2024 20:24:00 +0700 Subject: [PATCH] style: rename chances_of_remdry (#53) --- pyproject.toml | 4 ++-- python_weather/forecast.py | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3bec901..b300870 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools"] [project] name = "python-weather" -version = "1.1.0" +version = "1.1.1" description = "A free and asynchronous weather API wrapper made in Python, for Python." readme = "README.md" license = { text = "MIT" } @@ -38,4 +38,4 @@ requires-python = ">=3.8" [project.urls] repository = "https://github.com/null8626/python-weather" -download_url = "https://github.com/null8626/python-weather/archive/1.1.0.tar.gz" +download_url = "https://github.com/null8626/python-weather/archive/1.1.1.tar.gz" diff --git a/python_weather/forecast.py b/python_weather/forecast.py index 46b848b..023ad9a 100644 --- a/python_weather/forecast.py +++ b/python_weather/forecast.py @@ -22,6 +22,7 @@ SOFTWARE. """ +import warnings from typing import Iterable, Optional, Tuple from datetime import datetime, date, time from enum import auto @@ -239,11 +240,21 @@ def chances_of_rain(self) -> int: return int(self._BaseForecast__inner['chanceofrain']) @property - def chances_of_remdry(self) -> int: - """:class:`int`: Chances of a rem dry in percent.""" + def chances_of_remaining_dry(self) -> int: + """:class:`int`: Chances of remaining dry in percent.""" return int(self._BaseForecast__inner['chanceofremdry']) + @property + def chances_of_remdry(self) -> int: + """:class:`int`: Deprecated, use chances_of_remaining_dry instead.""" + + warnings.warn( + 'Deprecated as of v1.1.1. Use `chances_of_remaining_dry` instead.', + DeprecationWarning + ) + return self.chances_of_remaining_dry + @property def chances_of_snow(self) -> int: """:class:`int`: Chances of a snow in percent."""