Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Store the distribution packages
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
# upload artifacts with the oldest supported version
if: runner.os == 'linux' && inputs.python-version == '3.9'
if: runner.os == 'linux' && inputs.python-version == '3.11'
with:
name: python-package-distributions
path: dist/
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
Expand All @@ -57,7 +57,7 @@ jobs:
os: ubuntu-latest
python-version: "3.11"

## Run the unit tests for Python 3.9 until 3.14 and upload the
## Run the unit tests for Python 3.11 until 3.15 and upload the
## coverage statistics to codecov
##
Test:
Expand All @@ -68,7 +68,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
Expand Down
10 changes: 5 additions & 5 deletions .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.14.4
rev: v0.17.3
hooks:
- id: ruff
args:
Expand All @@ -25,12 +25,12 @@ repos:
# - --install-types
# - --non-interactive
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
rev: v2.4.3
hooks:
- id: codespell
additional_dependencies: [tomli]
- repo: https://github.com/gitleaks/gitleaks
rev: v8.29.0
rev: v8.30.1
hooks:
- id: gitleaks
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down Expand Up @@ -77,7 +77,7 @@ repos:
- id: isort
args: [--profile=black]
- repo: https://github.com/PyCQA/bandit
rev: 1.8.6
rev: 1.9.4
hooks:
- id: bandit
exclude: "^tests/.*|examples/.*"
Expand All @@ -90,7 +90,7 @@ repos:
- --max-modules=B
- --max-absolute=C
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.6.2
rev: v3.9.10
hooks:
- id: prettier
exclude: '\.nc$|^tests/fixture/|\.ipynb$'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div align="center">

[![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com/btschwertfeger/python-cmethods)
[![Generic badge](https://img.shields.io/badge/python-3.9_|_3.10_|_3.11|_3.12|_3.13-blue.svg)](https://shields.io/)
[![Generic badge](https://img.shields.io/badge/python-3.11_|_3.12_|_3.13_|_3.14_|_3.15-blue.svg)](https://shields.io/)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-orange.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![PyPI Downloads](https://pepy.tech/badge/python-cmethods)](https://pepy.tech/project/python-cmethods)

Expand Down
12 changes: 6 additions & 6 deletions cmethods/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,21 @@
__all__ = ["adjust"]


def print_version(
def print_version( # ruff: ignore[non-empty-init-module]
ctx: Context,
param: Any, # noqa: ARG001
param: Any, # ruff: ignore[unused-function-argument]
value: Any,
) -> None:
"""Prints the version of the package"""
if not value or ctx.resilient_parsing:
return
from importlib.metadata import version # noqa: PLC0415
from importlib.metadata import version # ruff: ignore[import-outside-top-level]

echo(version("python-cmethods"))
ctx.exit()


@command(
@command( # ruff: ignore[non-empty-init-module]
context_settings={
"auto_envvar_prefix": "CMETHODS",
"help_option_names": ["-h", "--help"],
Expand Down Expand Up @@ -147,7 +147,7 @@ def print_version(
"--output",
required=True,
type=str,
callback=lambda _, __, value: (value if value.endswith(".nc") else f"{value}.nc"),
callback=lambda _, __, value: value if value.endswith(".nc") else f"{value}.nc",
help="Output file name",
)
@option_group(
Expand Down Expand Up @@ -189,7 +189,7 @@ def cli(**kwargs) -> None:
)
log = logging.getLogger(__name__)
log.info("Loading data sets ...")
try:
try: # ruff: ignore[too-many-statements-in-try-clause]
for key, message in zip(
("obs", "simh", "simp"),
(
Expand Down
6 changes: 3 additions & 3 deletions cmethods/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ def _add_cmethods_metadata(
:return: Result with added metadata
"""
try:
from importlib.metadata import version # noqa: PLC0415
from importlib.metadata import version # ruff: ignore[import-outside-top-level]

pkg_version = version("python-cmethods")
except Exception: # noqa: BLE001
except Exception: # ruff: ignore[blind-except]
pkg_version = "unknown"

attrs_to_add = {
Expand Down Expand Up @@ -190,7 +190,7 @@ def adjust(
kwargs["adjust_called"] = True
ensure_xr_dataarray(obs=obs, simh=simh, simp=simp)

if method == "detrended_quantile_mapping": # noqa: PLR2004
if method == "detrended_quantile_mapping": # ruff: ignore[magic-value-comparison]
raise ValueError(
"This function is not available for detrended quantile mapping."
" Please use cmethods.CMethods.detrended_quantile_mapping",
Expand Down
2 changes: 1 addition & 1 deletion cmethods/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self: UnknownMethodError, method: str, available_methods: list):

def check_adjust_called(
function_name: str,
adjust_called: Optional[bool] = None, # noqa: FBT001
adjust_called: Optional[bool] = None, # ruff: ignore[boolean-type-hint-positional-argument]
) -> None:
"""
Displays a user warning in case a correction function was not called via
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
rst_epilog += f.read()


def setup(app) -> None: # noqa: ARG001
def setup(app) -> None: # ruff: ignore[unused-function-argument]
copyfile(join("..", "examples", "examples.ipynb"), "examples.ipynb")


Expand Down
2 changes: 1 addition & 1 deletion doc/links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
:target: https://github.com/btschwertfeger/python-cmethods
.. |License badge| image:: https://img.shields.io/badge/License-GPLv3-orange.svg
:target: https://www.gnu.org/licenses/gpl-3.0
.. |PyVersions badge| image:: https://img.shields.io/badge/python-3.9_|_3.10_|_3.11|_3.12|_3.13-blue.svg
.. |PyVersions badge| image:: https://img.shields.io/badge/python-3.11_|_3.12_|_3.13_|_3.14_|_3.15-blue.svg
:target: https://github.com/btschwertfeger/python-cmethods
.. |Downloads badge| image:: https://static.pepy.tech/personalized-badge/python-cmethods?period=total&units=abbreviation&left_color=grey&right_color=orange&left_text=downloads
:target: https://pepy.tech/project/python-cmethods
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ keywords = [
]
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
"Topic :: Scientific/Engineering",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_zarr_dask_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_3d_scaling_zarr(
datasets_from_zarr: xr.Dataset,
method: str,
kind: str,
dask_cluster: Any, # noqa: ARG001
dask_cluster: Any, # ruff: ignore[unused-function-argument]
) -> None:
variable: str = "tas" if kind == "+" else "pr"
obsh: xr.DataArray = datasets_from_zarr[kind]["obsh"][variable]
Expand Down Expand Up @@ -79,7 +79,7 @@ def test_3d_distribution_zarr(
datasets_from_zarr: dict,
method: str,
kind: str,
dask_cluster: Any, # noqa: ARG001
dask_cluster: Any, # ruff: ignore[unused-function-argument]
) -> None:
variable: str = "tas" if kind == "+" else "pr"
obsh: XRData_t = datasets_from_zarr[kind]["obsh"][variable]
Expand Down