From a73844bf530d691c534813506cae73a5e7ecfa97 Mon Sep 17 00:00:00 2001 From: jarq6c Date: Tue, 19 Nov 2024 10:32:49 -0600 Subject: [PATCH 1/9] Switch docstrings to raw strings to silence deprecation warning. --- python/metrics/src/hydrotools/metrics/metrics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/metrics/src/hydrotools/metrics/metrics.py b/python/metrics/src/hydrotools/metrics/metrics.py index b8fcb469..d629716b 100644 --- a/python/metrics/src/hydrotools/metrics/metrics.py +++ b/python/metrics/src/hydrotools/metrics/metrics.py @@ -44,7 +44,7 @@ def mean_error( power: float = 1.0, root: bool = False ) -> float: - """Compute the mean error or deviation. Default is Mean Absolute Error. The mean error + r"""Compute the mean error or deviation. Default is Mean Absolute Error. The mean error is given by: $$ME = \frac{1}{n}\sum_{i=1}^{n}\left| y_{s,i} - y_{o,i} \right|^{p}$$ @@ -102,7 +102,7 @@ def mean_error_skill_score( power: float = 1.0, normalized: bool = False ) -> float: - """Compute a generic mean error based model skill score. The mean error skill score + r"""Compute a generic mean error based model skill score. The mean error skill score is given by: $$MESS = 1 - \frac{\sum_{i=1}^{n}\left| y_{p,i} - y_{o,i} \right|^{p}}{\sum_{i=1}^{n}\left| y_{b,i} - y_{o,i} \right|^{p}}$$ From 04c50426724ecca83887c9198ad0cabb01be95ff Mon Sep 17 00:00:00 2001 From: jarq6c Date: Tue, 19 Nov 2024 10:33:48 -0600 Subject: [PATCH 2/9] update PyPI classifier versions --- python/metrics/setup.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/metrics/setup.cfg b/python/metrics/setup.cfg index be27f038..a1cc9fc6 100644 --- a/python/metrics/setup.cfg +++ b/python/metrics/setup.cfg @@ -19,9 +19,9 @@ classifiers = Intended Audience :: Education Intended Audience :: Science/Research License :: Free To Use But Restricted - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 Topic :: Scientific/Engineering :: Hydrology Operating System :: OS Independent From 318785255f1a960a5bcebe8f929ed9928229e722 Mon Sep 17 00:00:00 2001 From: jarq6c Date: Tue, 19 Nov 2024 10:34:58 -0600 Subject: [PATCH 3/9] up minimum version --- python/metrics/setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/metrics/setup.cfg b/python/metrics/setup.cfg index a1cc9fc6..0c297653 100644 --- a/python/metrics/setup.cfg +++ b/python/metrics/setup.cfg @@ -32,7 +32,7 @@ package_dir = install_requires = numpy>=1.20.0 pandas -python_requires = >=3.7 +python_requires = >=3.9 include_package_data = True [options.packages.find] From cac30861f9cad98655610dbc4a52f6930bc3c103 Mon Sep 17 00:00:00 2001 From: jarq6c Date: Tue, 19 Nov 2024 10:35:41 -0600 Subject: [PATCH 4/9] test versions to 3.9, 3.10, 3.11 --- .github/workflows/run_metrics.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_metrics.yml b/.github/workflows/run_metrics.yml index 74315544..3d27adde 100644 --- a/.github/workflows/run_metrics.yml +++ b/.github/workflows/run_metrics.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v2 From e97618e395396c3ae84b94eabf8eeb1f490c71c6 Mon Sep 17 00:00:00 2001 From: jarq6c Date: Tue, 19 Nov 2024 10:36:43 -0600 Subject: [PATCH 5/9] bump metrics to 1.3.4 --- python/metrics/src/hydrotools/metrics/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/metrics/src/hydrotools/metrics/_version.py b/python/metrics/src/hydrotools/metrics/_version.py index 7b1e3120..f9e47b6a 100644 --- a/python/metrics/src/hydrotools/metrics/_version.py +++ b/python/metrics/src/hydrotools/metrics/_version.py @@ -1 +1 @@ -__version__ = "1.3.3" +__version__ = "1.3.4" From f22c3d1b588e91eea827b27d13dfb2cd091e5405 Mon Sep 17 00:00:00 2001 From: jarq6c Date: Tue, 19 Nov 2024 11:16:45 -0600 Subject: [PATCH 6/9] transition to pyproject.toml --- python/metrics/pyproject.toml | 44 +++++++++++++++++++++++++++++++---- python/metrics/setup.cfg | 44 ----------------------------------- 2 files changed, 39 insertions(+), 49 deletions(-) delete mode 100644 python/metrics/setup.cfg diff --git a/python/metrics/pyproject.toml b/python/metrics/pyproject.toml index f41dc8bb..19d8ce11 100644 --- a/python/metrics/pyproject.toml +++ b/python/metrics/pyproject.toml @@ -1,7 +1,41 @@ [build-system] -requires = [ - "setuptools>=42", - "wheel", - "pip" -] +requires = ["setuptools>=61"] build-backend = "setuptools.build_meta" + +[project] +name = "hydrotools.metrics" +authors = [ + {name = "Jason A. Regina", email = "jason.regina@noaa.gov"}, +] +description = "Variety of standard model evaluation metrics." +readme = "README.md" +requires-python = ">=3.9" +license = {file = "LICENSE"} +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "License :: Free To Use But Restricted", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Scientific/Engineering :: Hydrology", + "Operating System :: OS Independent" +] +dependencies = [ + "numpy>=1.20.0", + "pandas", +] +dynamic = ["version"] + +[tool.setuptools.dynamic] +version = {attr = "hydrotools.metrics._version.__version__"} + +[project.optional-dependencies] +develop = ["pytest"] + +[project.urls] +Homepage = "https://github.com/NOAA-OWP/hydrotools" +Documentation = "https://noaa-owp.github.io/hydrotools/hydrotools.metrics.html" +Repository = "https://github.com/NOAA-OWP/hydrotools/tree/main/python/metrics" +"Bug Tracker" = "https://github.com/NOAA-OWP/hydrotools/issues" diff --git a/python/metrics/setup.cfg b/python/metrics/setup.cfg deleted file mode 100644 index 0c297653..00000000 --- a/python/metrics/setup.cfg +++ /dev/null @@ -1,44 +0,0 @@ -[metadata] -name = hydrotools.metrics -version = attr: hydrotools.metrics._version.__version__ -author = Jason A. Regina -author_email = jason.regina@noaa.gov -description = Variety of standard model evaluation metrics. -long_description = file: README.md -long_description_content_type = text/markdown; charset=UTF-8 -license = USDOC -license_files = - LICENSE -url = https://github.com/NOAA-OWP/hydrotools -project_urls = - Documentation = https://noaa-owp.github.io/hydrotools/hydrotools.metrics.html - Source = https://github.com/NOAA-OWP/hydrotools/tree/main/python/metrics - Tracker = https://github.com/NOAA-OWP/hydrotools/issues -classifiers = - Development Status :: 4 - Beta - Intended Audience :: Education - Intended Audience :: Science/Research - License :: Free To Use But Restricted - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Topic :: Scientific/Engineering :: Hydrology - Operating System :: OS Independent - -[options] -packages = find_namespace: -package_dir = - =src -install_requires = - numpy>=1.20.0 - pandas -python_requires = >=3.9 -include_package_data = True - -[options.packages.find] -where = src - -[options.extras_require] -develop = - pytest - \ No newline at end of file From c20a2580e39e8d3be58796104c2bf2e1a4523c5d Mon Sep 17 00:00:00 2001 From: jarq6c Date: Tue, 19 Nov 2024 11:30:03 -0600 Subject: [PATCH 7/9] revert to old license for now --- LICENSE | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/LICENSE b/LICENSE index 046e21e0..a0230332 100644 --- a/LICENSE +++ b/LICENSE @@ -1,22 +1,7 @@ -Licensed under the Apache License, Version 2.0 (the “License”); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an “AS IS” BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either -express or implied. - -See the License for the specific language governing permission and -limitations under the License. - -- - - - - - - - - - - - - - - -“Software code created by U.S. Government employees is not subject to copyright in the -United States (17 U.S.C. §105). The United States/Department of Commerce reserves all -rights to seek and obtain copyright protection in countries other than the United States -for Software authored in its entirety by the Department of Commerce. To this end, the -Department of Commerce hereby grants to Recipient a royalty-free, nonexclusive license -to use, copy, and create derivative works of the Software outside of the United States.” +“Software code created by U.S. Government employees is not subject to copyright +in the United States (17 U.S.C. §105). The United States/Department of Commerce +reserve all rights to seek and obtain copyright protection in countries other +than the United States for Software authored in its entirety by the Department +of Commerce. To this end, the Department of Commerce hereby grants to Recipient +a royalty-free, nonexclusive license to use, copy, and create derivative works +of the Software outside of the United States.” From 945d62d4737925d35f60eb337195eda92542a692 Mon Sep 17 00:00:00 2001 From: jarq6c Date: Tue, 19 Nov 2024 11:36:28 -0600 Subject: [PATCH 8/9] bump version to 1.3.5 due for compatability --- python/metrics/src/hydrotools/metrics/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/metrics/src/hydrotools/metrics/_version.py b/python/metrics/src/hydrotools/metrics/_version.py index f9e47b6a..92857f86 100644 --- a/python/metrics/src/hydrotools/metrics/_version.py +++ b/python/metrics/src/hydrotools/metrics/_version.py @@ -1 +1 @@ -__version__ = "1.3.4" +__version__ = "1.3.5" From c9b0932a2628514b7b12490bbe00ae6fde4b6fc2 Mon Sep 17 00:00:00 2001 From: jarq6c Date: Tue, 19 Nov 2024 11:48:06 -0600 Subject: [PATCH 9/9] set minimum setuptools to 70 --- python/metrics/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/metrics/pyproject.toml b/python/metrics/pyproject.toml index 19d8ce11..9c58ff0b 100644 --- a/python/metrics/pyproject.toml +++ b/python/metrics/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=61"] +requires = ["setuptools>=70"] build-backend = "setuptools.build_meta" [project]