Skip to content

Update project settings #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ coverage.xml
*.cover
*.py,cover
.pytest_cache/
pytest.xml

# Translations
*.mo
Expand Down
10 changes: 9 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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$'
16 changes: 7 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:**
Expand Down Expand Up @@ -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:**

Expand Down Expand Up @@ -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)
Expand All @@ -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))

Expand All @@ -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:**

Expand All @@ -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:**

Expand Down Expand Up @@ -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)_
55 changes: 41 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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 \
Expand All @@ -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
15 changes: 14 additions & 1 deletion cmethods/__init__.py
Original file line number Diff line number Diff line change
@@ -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"""
Expand Down
15 changes: 14 additions & 1 deletion cmethods/core.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 14 additions & 1 deletion cmethods/distribution.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 14 additions & 1 deletion cmethods/scaling.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 14 additions & 1 deletion cmethods/static.py
Original file line number Diff line number Diff line change
@@ -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"""

Expand Down
15 changes: 14 additions & 1 deletion cmethods/types.py
Original file line number Diff line number Diff line change
@@ -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"""

Expand Down
15 changes: 14 additions & 1 deletion cmethods/utils.py
Original file line number Diff line number Diff line change
@@ -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"""

Expand Down
Loading