diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8474ad3..d7a6ce8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [ "3.11", "3.15-dev" ] + python-version: [ "3.11", "3.15" ] os: [ windows-latest, ubuntu-latest, macos-latest ] fail-fast: false @@ -36,6 +36,6 @@ jobs: - name: Tests run: | - python -m pytest -s -rxs -v gsw/tests + python -m pytest -s -rxs -v -W error gsw/tests permissions: actions: none \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7175202..b738f26 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: - --ignore-words-list=nin,preformed,wih,pres, - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.30.3 + rev: v2.30.6 hooks: - id: pyproject-fmt @@ -31,7 +31,7 @@ repos: - id: ruff - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.31.1 + rev: v1.32.0 hooks: - id: zizmor diff --git a/gsw/_utilities.py b/gsw/_utilities.py index f508699..ca1b429 100644 --- a/gsw/_utilities.py +++ b/gsw/_utilities.py @@ -51,7 +51,13 @@ def wrapper(*args, **kwargs): ) where = ~mask - new_kwargs = {"where": where} + # Values under the mask are left uninitialized, which is fine for masked + # arrays; passing out=None explicitly avoids numpy's "'where' used + # without 'out'" warning. Multi-output ufuncs need one None per output. + nout = len(f.types[0].split("->")[1]) if hasattr(f, "types") else 1 + out = None if nout == 1 else (None,) * nout + + new_kwargs = {"where": where, "out": out} new_kwargs.update( **kwargs ) # Allow user override of the where kwarg if they passed it in. diff --git a/pyproject.toml b/pyproject.toml index bd7dbbd..5f3577c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,3 +103,8 @@ ignore = [ "tools", "tools/*", ] + +[tool.pytest] +ini_options.filterwarnings = [ + "error:::gsw.*", +]