From 54ddb827064d672a3b068c4954d66f676872cde9 Mon Sep 17 00:00:00 2001 From: Kristen Thyng Date: Fri, 21 Jun 2024 14:25:53 -0500 Subject: [PATCH 1/3] without change, deprecation warning is called a lot and it is very annoying --- noaa_coops/station.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noaa_coops/station.py b/noaa_coops/station.py index 9b1e651..134b200 100644 --- a/noaa_coops/station.py +++ b/noaa_coops/station.py @@ -739,7 +739,7 @@ def get_data( # Try to convert strings to numeric values where possible for col in df.columns: - df[col] = pd.to_numeric(df[col], errors="ignore") + df[col] = pd.to_numeric(df[col]) df = df[~df.index.duplicated(keep="first")] self.data = df From 861ba5601ee5d42bb624f7322f0e226f8873be0c Mon Sep 17 00:00:00 2001 From: Kristen Thyng Date: Thu, 27 Jun 2024 15:46:21 -0500 Subject: [PATCH 2/3] another fix, changed versions added another fixed based on a test which caught an error type explicitly that was previously ignored. Also altered the pyproject.toml to make the versions minimums instead of carrot-based to loosen restrictions and make this easier to incorporate into projects. --- noaa_coops/station.py | 5 ++++- pyproject.toml | 30 +++++++++++++++--------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/noaa_coops/station.py b/noaa_coops/station.py index 134b200..de7c57b 100644 --- a/noaa_coops/station.py +++ b/noaa_coops/station.py @@ -739,7 +739,10 @@ def get_data( # Try to convert strings to numeric values where possible for col in df.columns: - df[col] = pd.to_numeric(df[col]) + try: + df[col] = pd.to_numeric(df[col]) + except ValueError: + df[col] = df[col] df = df[~df.index.duplicated(keep="first")] self.data = df diff --git a/pyproject.toml b/pyproject.toml index 56ca842..a8bb31a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,23 +10,23 @@ keywords = ["noaa", "coops", "tides", "currents", "weather", "api"] packages = [{include = "noaa_coops"}] [tool.poetry.dependencies] -python = "^3.8" -requests = "^2.28.2" -pandas = "^1.5.3" -zeep = "^4.2.1" +python = ">= 3.8" +requests = ">= 2.28.2" +pandas = ">= 1.5.3" +zeep = ">= 4.2.1" [tool.poetry.group.dev.dependencies] -autoflake = "^2.0.1" -black = "^23.1.0" -flake8 = {version = "^6", python = "^3.8.1"} -isort = "^5.12.0" -pytest = "^7.2.1" -tox = "^4.4.4" -make = "^0.1.6.post2" -flake8-docstrings = "^1.7.0" -darglint = "^1.8.1" -toml = "^0.10.2" -reuse = "^1.1.1" +autoflake = ">= 2.0.1" +black = ">= 23.1.0" +flake8 = {version = ">= 6", python = ">= 3.8.1"} +isort = ">= 5.12.0" +pytest = ">= 7.2.1" +tox = ">= 4.4.4" +make = ">= 0.1.6.post2" +flake8-docstrings = ">= 1.7.0" +darglint = ">= 1.8.1" +toml = ">= 0.10.2" +reuse = ">= 1.1.1" [tool.black] line-length = 88 From 70770ad7fbefefadb0fd63cc112bfd3db3d41344 Mon Sep 17 00:00:00 2001 From: Kristen Thyng Date: Fri, 5 Jul 2024 14:40:13 -0500 Subject: [PATCH 3/3] change back to caret notation for toml file --- pyproject.toml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a8bb31a..56ca842 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,23 +10,23 @@ keywords = ["noaa", "coops", "tides", "currents", "weather", "api"] packages = [{include = "noaa_coops"}] [tool.poetry.dependencies] -python = ">= 3.8" -requests = ">= 2.28.2" -pandas = ">= 1.5.3" -zeep = ">= 4.2.1" +python = "^3.8" +requests = "^2.28.2" +pandas = "^1.5.3" +zeep = "^4.2.1" [tool.poetry.group.dev.dependencies] -autoflake = ">= 2.0.1" -black = ">= 23.1.0" -flake8 = {version = ">= 6", python = ">= 3.8.1"} -isort = ">= 5.12.0" -pytest = ">= 7.2.1" -tox = ">= 4.4.4" -make = ">= 0.1.6.post2" -flake8-docstrings = ">= 1.7.0" -darglint = ">= 1.8.1" -toml = ">= 0.10.2" -reuse = ">= 1.1.1" +autoflake = "^2.0.1" +black = "^23.1.0" +flake8 = {version = "^6", python = "^3.8.1"} +isort = "^5.12.0" +pytest = "^7.2.1" +tox = "^4.4.4" +make = "^0.1.6.post2" +flake8-docstrings = "^1.7.0" +darglint = "^1.8.1" +toml = "^0.10.2" +reuse = "^1.1.1" [tool.black] line-length = 88