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 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.” diff --git a/python/metrics/pyproject.toml b/python/metrics/pyproject.toml index f41dc8bb..9c58ff0b 100644 --- a/python/metrics/pyproject.toml +++ b/python/metrics/pyproject.toml @@ -1,7 +1,41 @@ [build-system] -requires = [ - "setuptools>=42", - "wheel", - "pip" -] +requires = ["setuptools>=70"] 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 be27f038..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.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - 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.7 -include_package_data = True - -[options.packages.find] -where = src - -[options.extras_require] -develop = - pytest - \ No newline at end of file diff --git a/python/metrics/src/hydrotools/metrics/_version.py b/python/metrics/src/hydrotools/metrics/_version.py index 7b1e3120..92857f86 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.5" 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}}$$