diff --git a/.gitignore b/.gitignore index 1962da0..ec4cfe6 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,7 @@ coverage.xml *.cover *.py,cover .pytest_cache/ +pytest.xml # Translations *.mo diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 43c130e..a25937d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.0 + rev: v0.11.13 hooks: - id: ruff args: @@ -29,6 +29,10 @@ repos: hooks: - id: codespell additional_dependencies: [tomli] + - repo: https://github.com/gitleaks/gitleaks + rev: v8.21.2 + hooks: + - id: gitleaks - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: @@ -85,4 +89,8 @@ repos: - --max-average=B - --max-modules=B - --max-absolute=C + - repo: https://github.com/rbubley/mirrors-prettier + rev: v3.3.3 + hooks: + - id: prettier exclude: '\.nc$|^tests/fixture/|\.ipynb$' diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c09226..ca0fb7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -136,7 +136,7 @@ **Implemented enhancements:** -- Add a command-line interface [\#82](https://github.com/btschwertfeger/python-cmethods/issues/82) +- Add a command-line interface [\#82](https://github.com/btschwertfeger/python-cmethods/issues/82) - Resolve "Add a command-line interface" [\#83](https://github.com/btschwertfeger/python-cmethods/pull/83) ([btschwertfeger](https://github.com/btschwertfeger)) **Merged pull requests:** @@ -175,7 +175,7 @@ **Closed issues:** -- The latest documentation still describes the legacy max\_scaling\_factor [\#60](https://github.com/btschwertfeger/python-cmethods/issues/60) +- The latest documentation still describes the legacy max_scaling_factor [\#60](https://github.com/btschwertfeger/python-cmethods/issues/60) **Merged pull requests:** @@ -223,7 +223,7 @@ **Merged pull requests:** -- Clarified difference between stochastic and non-stochastic climate variables in doc and readme [\#36](https://github.com/btschwertfeger/python-cmethods/pull/36) ([btschwertfeger](https://github.com/btschwertfeger)) +- Clarified difference between stochastic and non-stochastic climate variables in doc and readme [\#36](https://github.com/btschwertfeger/python-cmethods/pull/36) ([btschwertfeger](https://github.com/btschwertfeger)) - Fix typos [\#38](https://github.com/btschwertfeger/python-cmethods/pull/38) ([btschwertfeger](https://github.com/btschwertfeger)) ## [v1.0.1](https://github.com/btschwertfeger/python-cmethods/tree/v1.0.1) (2023-04-17) @@ -237,7 +237,7 @@ **Fixed bugs:** -- Multiplicative Quantile Delta Mapping is not applying scaling where the delta is infinite [\#32](https://github.com/btschwertfeger/python-cmethods/issues/32) +- Multiplicative Quantile Delta Mapping is not applying scaling where the delta is infinite [\#32](https://github.com/btschwertfeger/python-cmethods/issues/32) - Fixed PyPI repository URL [\#16](https://github.com/btschwertfeger/python-cmethods/pull/16) ([btschwertfeger](https://github.com/btschwertfeger)) - Fixed bug where division lead to nan or inf values [\#33](https://github.com/btschwertfeger/python-cmethods/pull/33) ([btschwertfeger](https://github.com/btschwertfeger)) @@ -257,7 +257,7 @@ **Breaking changes:** -- Remove the unnecessary `CMethods.py` module to access the CMethods class more easily [\#10](https://github.com/btschwertfeger/python-cmethods/issues/10) +- Remove the unnecessary `CMethods.py` module to access the CMethods class more easily [\#10](https://github.com/btschwertfeger/python-cmethods/issues/10) **Implemented enhancements:** @@ -282,7 +282,7 @@ **Breaking changes:** -- adjust\_3d forces group to be "time.month" if group is set to the default \(None\) [\#5](https://github.com/btschwertfeger/python-cmethods/issues/5) +- adjust_3d forces group to be "time.month" if group is set to the default \(None\) [\#5](https://github.com/btschwertfeger/python-cmethods/issues/5) **Implemented enhancements:** @@ -340,6 +340,4 @@ [Full Changelog](https://github.com/btschwertfeger/python-cmethods/compare/41c1837e5d23c300656c8ee2ce0079d6a8baac2f...v0.5) - - -\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* +\* _This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)_ diff --git a/Makefile b/Makefile index 0055886..52cad40 100644 --- a/Makefile +++ b/Makefile @@ -6,35 +6,47 @@ # https://github.com/btschwertfeger # -VENV := venv +UV := uv PYTHON := python +PYTEST := $(UV) run pytest TESTS := tests -PYTEST_OPTS := -vv -ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +PYTEST_OPTS := -vv --junit-xml=pytest.xml +PYTEST_COV_OPTS := $(PYTEST_OPTS) --cov=cmethods --cov-report=xml:coverage.xml --cov-report=term +## ======= M A K E F I L E - T A R G E T S ===================================== +## help Show this help message +## .PHONY: help help: @grep "^##" Makefile | sed -e "s/##//" -## build Builds python-cmethods +## ======= B U I L D I N G ===================================================== +## build Builds the package ## .PHONY: build build: $(PYTHON) -m build . +## rebuild Rebuild the package +## +.PHONY: rebuild +rebuild: clean build + +## ======= I N S T A L L A T I O N ============================================= +## install Install the package +## +.PHONY: install +install: check-uv + $(UV) pip install . + ## dev Installs the package in edit mode ## .PHONY: dev dev: @git lfs install - $(PYTHON) -m pip install -e ".[dev,test,jupyter,examples]" -r doc/requirements.txt - -## install Install the package -## -.PHONY: install -install: - $(PYTHON) -m pip install . + $(UV) pip install -e ".[dev,test,jupyter,examples]" -r doc/requirements.txt +## ======= T E S T I N G ======================================================= ## test Run the unit tests ## .PHONY: test @@ -50,13 +62,18 @@ tests: test retest: $(PYTHON) -m pytest $(PYTEST_OPTS) --lf $(TESTS) - ## wip Run tests marked as wip ## .PHONY: wip wip: $(PYTHON) -m pytest $(PYTEST_OPTS) -m "wip" $(TESTS) +## coverage Run all tests and generate the coverage report +## +.PHONY: coverage +coverage: + $(PYTEST) $(PYTEST_COV_OPTS) $(TEST_DIR) + ## doc Build the documentation ## .PHONY: doc @@ -69,7 +86,8 @@ doc: doctest: cd doc && make doctest -## pre-commit Pre-Commit +## ======= M I S C E L A N I O U S ============================================= +## pre-commit Run the pre-commit targets ## .PHONY: pre-commit pre-commit: @@ -92,7 +110,7 @@ ruff-fix: .PHONY: changelog changelog: docker run -it --rm \ - -v $(ROOT_DIR):/usr/local/src/your-app/ \ + -v $(PWD):/usr/local/src/your-app/ \ githubchangeloggenerator/github-changelog-generator \ -u btschwertfeger \ -p python-cmethods \ @@ -115,3 +133,12 @@ clean: find tests -name "__pycache__" | xargs rm -rf find cmethods -name "__pycache__" | xargs rm -rf find examples -name "__pycache__" | xargs rm -rf + +## check-uv Check if uv is installed +## +.PHONY: check-uv +check-uv: + @if ! command -v $(UV) >/dev/null; then \ + echo "Error: uv is not installed. Please visit https://github.com/astral-sh/uv for installation instructions."; \ + exit 1; \ + fi diff --git a/cmethods/__init__.py b/cmethods/__init__.py index 87eacb1..2778b2e 100644 --- a/cmethods/__init__.py +++ b/cmethods/__init__.py @@ -1,9 +1,22 @@ # -*- mode: python; coding: utf-8 -*- # # Copyright (C) 2023 Benjamin Thomas Schwertfeger -# All rights reserved. # https://github.com/btschwertfeger # +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# https://www.gnu.org/licenses/gpl-3.0.html. +# # pylint: disable=consider-using-f-string,logging-not-lazy r""" diff --git a/cmethods/core.py b/cmethods/core.py index 3c5996f..714b51b 100644 --- a/cmethods/core.py +++ b/cmethods/core.py @@ -1,9 +1,22 @@ # -*- mode: python; coding: utf-8 -*- # # Copyright (C) 2024 Benjamin Thomas Schwertfeger -# All rights reserved. # https://github.com/btschwertfeger # +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# https://www.gnu.org/licenses/gpl-3.0.html. +# """ Module providing the main function that is used to apply the implemented bias diff --git a/cmethods/distribution.py b/cmethods/distribution.py index 14737c3..b66ac6f 100644 --- a/cmethods/distribution.py +++ b/cmethods/distribution.py @@ -1,9 +1,22 @@ # -*- mode: python; coding: utf-8 -*- # # Copyright (C) 2024 Benjamin Thomas Schwertfeger -# All rights reserved. # https://github.com/btschwertfeger # +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# https://www.gnu.org/licenses/gpl-3.0.html. +# """ Module providing functions for distribution-based bias adjustments. Functions are not diff --git a/cmethods/scaling.py b/cmethods/scaling.py index 766231b..88dd165 100644 --- a/cmethods/scaling.py +++ b/cmethods/scaling.py @@ -1,9 +1,22 @@ # -*- mode: python; coding: utf-8 -*- # # Copyright (C) 2024 Benjamin Thomas Schwertfeger -# All rights reserved. # https://github.com/btschwertfeger # +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# https://www.gnu.org/licenses/gpl-3.0.html. +# """ Module providing functions for scaling-based bias adjustments. Functions are not diff --git a/cmethods/static.py b/cmethods/static.py index cb311ab..5e52cbb 100644 --- a/cmethods/static.py +++ b/cmethods/static.py @@ -1,9 +1,22 @@ # -*- mode: python; coding: utf-8 -*- # # Copyright (C) 2023 Benjamin Thomas Schwertfeger -# All rights reserved. # https://github.com/btschwertfeger # +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# https://www.gnu.org/licenses/gpl-3.0.html. +# """Module providing static information for the python-cmethods package""" diff --git a/cmethods/types.py b/cmethods/types.py index c670699..99dd322 100644 --- a/cmethods/types.py +++ b/cmethods/types.py @@ -1,9 +1,22 @@ # -*- mode: python; coding: utf-8 -*- # # Copyright (C) 2023 Benjamin Thomas Schwertfeger -# All rights reserved. # https://github.com/btschwertfeger # +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# https://www.gnu.org/licenses/gpl-3.0.html. +# """Module providing custom types""" diff --git a/cmethods/utils.py b/cmethods/utils.py index 81f27f9..f675d92 100644 --- a/cmethods/utils.py +++ b/cmethods/utils.py @@ -1,9 +1,22 @@ # -*- mode: python; coding: utf-8 -*- # # Copyright (C) 2023 Benjamin Thomas Schwertfeger -# All rights reserved. # https://github.com/btschwertfeger # +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# https://www.gnu.org/licenses/gpl-3.0.html. +# """Module providing utility functions""" diff --git a/doc/cli.rst b/doc/cli.rst index e05557e..2e592b3 100644 --- a/doc/cli.rst +++ b/doc/cli.rst @@ -1,9 +1,22 @@ .. -*- mode: rst; coding: utf-8 -*- .. .. Copyright (C) 2023 Benjamin Thomas Schwertfeger -.. All rights reserved. .. https://github.com/btschwertfeger .. +.. This program is free software: you can redistribute it and/or modify +.. it under the terms of the GNU General Public License as published by +.. the Free Software Foundation, either version 3 of the License, or +.. (at your option) any later version. +.. +.. This program is distributed in the hope that it will be useful, +.. but WITHOUT ANY WARRANTY; without even the implied warranty of +.. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. GNU General Public License for more details. +.. +.. You should have received a copy of the GNU General Public License +.. along with this program. If not, see +.. https://www.gnu.org/licenses/gpl-3.0.html. +.. Command-Line Interface ====================== diff --git a/doc/cmethods.rst b/doc/cmethods.rst index 65375da..6a5d63e 100644 --- a/doc/cmethods.rst +++ b/doc/cmethods.rst @@ -1,9 +1,22 @@ .. -*- mode: rst; coding: utf-8 -*- .. .. Copyright (C) 2023 Benjamin Thomas Schwertfeger -.. All rights reserved. .. https://github.com/btschwertfeger .. +.. This program is free software: you can redistribute it and/or modify +.. it under the terms of the GNU General Public License as published by +.. the Free Software Foundation, either version 3 of the License, or +.. (at your option) any later version. +.. +.. This program is distributed in the hope that it will be useful, +.. but WITHOUT ANY WARRANTY; without even the implied warranty of +.. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. GNU General Public License for more details. +.. +.. You should have received a copy of the GNU General Public License +.. along with this program. If not, see +.. https://www.gnu.org/licenses/gpl-3.0.html. +.. Classes and Functions ===================== diff --git a/doc/conf.py b/doc/conf.py index 5e8ccfa..f2650f8 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -1,9 +1,22 @@ # -*- mode: python; coding: utf-8 -*- # # Copyright (C) 2023 Benjamin Thomas Schwertfeger -# All rights reserved. # https://github.com/btschwertfeger # +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# https://www.gnu.org/licenses/gpl-3.0.html. +# # Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the documentation: diff --git a/doc/getting_started.rst b/doc/getting_started.rst index 2548f8d..7233077 100644 --- a/doc/getting_started.rst +++ b/doc/getting_started.rst @@ -1,9 +1,22 @@ .. -*- mode: rst; coding: utf-8 -*- .. .. Copyright (C) 2023 Benjamin Thomas Schwertfeger -.. All rights reserved. .. https://github.com/btschwertfeger .. +.. This program is free software: you can redistribute it and/or modify +.. it under the terms of the GNU General Public License as published by +.. the Free Software Foundation, either version 3 of the License, or +.. (at your option) any later version. +.. +.. This program is distributed in the hope that it will be useful, +.. but WITHOUT ANY WARRANTY; without even the implied warranty of +.. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. GNU General Public License for more details. +.. +.. You should have received a copy of the GNU General Public License +.. along with this program. If not, see +.. https://www.gnu.org/licenses/gpl-3.0.html. +.. Getting Started =============== diff --git a/doc/index.rst b/doc/index.rst index f2b4759..9ad1387 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,9 +1,22 @@ .. -*- mode: rst; coding: utf-8 -*- .. .. Copyright (C) 2023 Benjamin Thomas Schwertfeger -.. All rights reserved. .. https://github.com/btschwertfeger .. +.. This program is free software: you can redistribute it and/or modify +.. it under the terms of the GNU General Public License as published by +.. the Free Software Foundation, either version 3 of the License, or +.. (at your option) any later version. +.. +.. This program is distributed in the hope that it will be useful, +.. but WITHOUT ANY WARRANTY; without even the implied warranty of +.. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. GNU General Public License for more details. +.. +.. You should have received a copy of the GNU General Public License +.. along with this program. If not, see +.. https://www.gnu.org/licenses/gpl-3.0.html. +.. Welcome to python-cmethods's documentation! =========================================== diff --git a/doc/introduction.rst b/doc/introduction.rst index 9dec6ae..fa076ab 100644 --- a/doc/introduction.rst +++ b/doc/introduction.rst @@ -1,9 +1,22 @@ .. -*- mode: rst; coding: utf-8 -*- .. .. Copyright (C) 2023 Benjamin Thomas Schwertfeger -.. All rights reserved. .. https://github.com/btschwertfeger .. +.. This program is free software: you can redistribute it and/or modify +.. it under the terms of the GNU General Public License as published by +.. the Free Software Foundation, either version 3 of the License, or +.. (at your option) any later version. +.. +.. This program is distributed in the hope that it will be useful, +.. but WITHOUT ANY WARRANTY; without even the implied warranty of +.. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. GNU General Public License for more details. +.. +.. You should have received a copy of the GNU General Public License +.. along with this program. If not, see +.. https://www.gnu.org/licenses/gpl-3.0.html. +.. python-cmethods =============== diff --git a/doc/issues.rst b/doc/issues.rst index 6c150f4..98e78e2 100644 --- a/doc/issues.rst +++ b/doc/issues.rst @@ -1,9 +1,22 @@ .. -*- mode: rst; coding: utf-8 -*- .. .. Copyright (C) 2023 Benjamin Thomas Schwertfeger -.. All rights reserved. .. https://github.com/btschwertfeger .. +.. This program is free software: you can redistribute it and/or modify +.. it under the terms of the GNU General Public License as published by +.. the Free Software Foundation, either version 3 of the License, or +.. (at your option) any later version. +.. +.. This program is distributed in the hope that it will be useful, +.. but WITHOUT ANY WARRANTY; without even the implied warranty of +.. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. GNU General Public License for more details. +.. +.. You should have received a copy of the GNU General Public License +.. along with this program. If not, see +.. https://www.gnu.org/licenses/gpl-3.0.html. +.. Known Issues ============ diff --git a/doc/license.rst b/doc/license.rst index 9245eea..e60358b 100644 --- a/doc/license.rst +++ b/doc/license.rst @@ -1,9 +1,22 @@ .. -*- mode: rst; coding: utf-8 -*- .. .. Copyright (C) 2023 Benjamin Thomas Schwertfeger -.. All rights reserved. .. https://github.com/btschwertfeger .. +.. This program is free software: you can redistribute it and/or modify +.. it under the terms of the GNU General Public License as published by +.. the Free Software Foundation, either version 3 of the License, or +.. (at your option) any later version. +.. +.. This program is distributed in the hope that it will be useful, +.. but WITHOUT ANY WARRANTY; without even the implied warranty of +.. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. GNU General Public License for more details. +.. +.. You should have received a copy of the GNU General Public License +.. along with this program. If not, see +.. https://www.gnu.org/licenses/gpl-3.0.html. +.. .. _section-license: diff --git a/doc/links.rst b/doc/links.rst index c2de0ab..520b64b 100644 --- a/doc/links.rst +++ b/doc/links.rst @@ -1,9 +1,22 @@ .. -*- mode: rst; coding: utf-8 -*- .. .. Copyright (C) 2023 Benjamin Thomas Schwertfeger -.. All rights reserved. .. https://github.com/btschwertfeger .. +.. This program is free software: you can redistribute it and/or modify +.. it under the terms of the GNU General Public License as published by +.. the Free Software Foundation, either version 3 of the License, or +.. (at your option) any later version. +.. +.. This program is distributed in the hope that it will be useful, +.. but WITHOUT ANY WARRANTY; without even the implied warranty of +.. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. GNU General Public License for more details. +.. +.. You should have received a copy of the GNU General Public License +.. along with this program. If not, see +.. https://www.gnu.org/licenses/gpl-3.0.html. +.. .. LINKS diff --git a/doc/methods.rst b/doc/methods.rst index 6316532..5eb8a41 100644 --- a/doc/methods.rst +++ b/doc/methods.rst @@ -1,9 +1,22 @@ .. -*- mode: rst; coding: utf-8 -*- .. .. Copyright (C) 2023 Benjamin Thomas Schwertfeger -.. All rights reserved. .. https://github.com/btschwertfeger .. +.. This program is free software: you can redistribute it and/or modify +.. it under the terms of the GNU General Public License as published by +.. the Free Software Foundation, either version 3 of the License, or +.. (at your option) any later version. +.. +.. This program is distributed in the hope that it will be useful, +.. but WITHOUT ANY WARRANTY; without even the implied warranty of +.. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. GNU General Public License for more details. +.. +.. You should have received a copy of the GNU General Public License +.. along with this program. If not, see +.. https://www.gnu.org/licenses/gpl-3.0.html. +.. Bias Correction Methods ======================= diff --git a/pyproject.toml b/pyproject.toml index 9d8dc56..bf40e63 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,7 @@ maintainers = [ ] description = "A collection of bias correction techniques written in Python - for climate sciences." readme = "README.md" +license = "GPL-3.0-or-later" license-files = ["LICENSE"] requires-python = ">=3.9" dependencies = [ @@ -62,15 +63,16 @@ classifiers = [ cmethods = "cmethods:cli" [project.urls] -"Homepage" = "https://github.com/btschwertfeger/python-cmethods" +Homepage = "https://github.com/btschwertfeger/python-cmethods" "Bug Tracker" = "https://github.com/btschwertfeger/python-cmethods/issues" +Documentation = "https://python-cmethods.readthedocs.io/en/stable/" [tool.setuptools] include-package-data = false [tool.setuptools.packages.find] include = ["cmethods*"] -exclude = ["doc*", "tests*", "examples*", ".env", "venv"] +exclude = ["doc*", "tests*", "examples*", ".env", ".venv"] [tool.setuptools_scm] write_to = "cmethods/_version.py" @@ -83,7 +85,10 @@ testpaths = ["tests"] [tool.pytest.ini_options] cache_dir = ".cache/pytest" -markers = ["wip: Used to run a specific test by hand."] +markers = [ + "wip: Used to run a specific test by hand.", + "flaky: Use to retry flaky tests", +] addopts = "--maxfail=1" [tool.coverage.run] @@ -200,6 +205,7 @@ lint.select = [ "BLE", # blind-except "C4", # flake8-comprehensions "COM", # flake8-commas + "CPY", # flake8-copyright "E", # pycodestyle "F", # pyflakes "FA", # flake8-future-annotations @@ -255,6 +261,11 @@ line-length = 130 cache-dir = ".cache/ruff" lint.task-tags = ["todo", "TODO"] +[tool.ruff.lint.flake8-copyright] +author = "Benjamin Thomas Schwertfeger" +notice-rgx = "(?i)Copyright \\(C\\) \\d{4}" +min-file-size = 1024 + [tool.ruff.lint.per-file-ignores] "cmethods/types.py" = [ "A005", # Shadowing builtin diff --git a/tests/conftest.py b/tests/conftest.py index 9ac47ad..2f004aa 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,7 +10,6 @@ from __future__ import annotations import os -from functools import lru_cache from typing import Any import pytest @@ -65,7 +64,6 @@ def datasets() -> dict: } -@lru_cache(maxsize=None) @pytest.fixture def datasets_from_zarr() -> dict: return { diff --git a/tests/test_methods_different_input_shape.py b/tests/test_methods_different_input_shape.py index 9eef638..dac9217 100644 --- a/tests/test_methods_different_input_shape.py +++ b/tests/test_methods_different_input_shape.py @@ -21,7 +21,9 @@ from .helper import is_1d_rmse_better -N_QUANTILES = 100 +pytestmark = [pytest.mark.flaky] + +N_QUANTILES: int = 100 @pytest.mark.parametrize( diff --git a/tests/test_zarr_dask_compatibility.py b/tests/test_zarr_dask_compatibility.py index ef91a9a..6d5e1bb 100644 --- a/tests/test_zarr_dask_compatibility.py +++ b/tests/test_zarr_dask_compatibility.py @@ -15,6 +15,8 @@ from .helper import is_3d_rmse_better +pytestmark = [pytest.mark.flaky] + GROUP: str = "time.month" N_QUANTILES: int = 100