Skip to content

Commit

Permalink
Merge branch 'topic/default/check-py12-numpy2' into 'branch/default'
Browse files Browse the repository at this point in the history
Check with Python 3.12 and numpy 2.0

See merge request fluiddyn/fluidimage!113
  • Loading branch information
paugier committed Jul 25, 2024
2 parents 00fc48d + 414b435 commit a404af2
Show file tree
Hide file tree
Showing 8 changed files with 8,488 additions and 7,913 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Install apt packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-pixi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
matrix:
os: ["windows-2022", "macos-latest"]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
defaults:
run:
shell: bash -l {0}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
python-version: 3.x
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v2.19.2
env:
CIBW_SKIP: pp* cp36-* cp37-* cp38-* *-musllinux*
CIBW_ARCHS: ${{ matrix.architecture }}
Expand All @@ -49,7 +49,7 @@ jobs:
with:
python-version: 3.x
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v2.19.2
env:
CIBW_SKIP: pp* cp36-* cp37-* cp38-* *-musllinux*
CIBW_ARCHS: ${{ matrix.architecture }}
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
python-version: 3.x

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v2.19.2
env:
CIBW_SKIP: pp* cp36-* cp37-* cp38-* *-musllinux*
CIBW_ARCHS: aarch64
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
name: sdist
- uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
- run: |
pip install pip -U
ls
Expand Down
1,630 changes: 785 additions & 845 deletions pdm.lock

Large diffs are not rendered by default.

14,734 changes: 7,680 additions & 7,054 deletions pixi.lock

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ install-editable = {cmd = "pip install -e . -v --no-build-isolation --no-deps",
test = "export OMP_NUM_THREADS=1 && pytest src -v -s"

[dependencies]
python = ">=3.9,<3.11"
python = ">=3.9"
numpy = ">=1.26.3"
transonic = ">=0.6.4"
# should actually be >=0.6.2 (soon available)
fluiddyn = ">=0.6.1"
fluiddyn = ">=0.6.2"
h5netcdf = ">=1.3.0"
h5py = ">=3.10.0"
matplotlib = ">=3.5"
Expand All @@ -37,5 +36,5 @@ pythran = ">=0.15.0"
pytest = ">=8.0.0"
pytest-cov = ">=4.1.0"
coverage = ">=7.4.1"
pytest-asyncio = ">=0.23.6,<0.24"
linkify-it-py = ">=2.0.3,<2.1"
pytest-asyncio = ">=0.23.6"
linkify-it-py = ">=2.0.3"
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies = [
"rich>=13.7.1",
"textual",
]
requires-python = ">=3.9,<3.13"
requires-python = ">=3.9"
readme = "README.md"
license = {text = "CeCILL"}
keywords = [
Expand All @@ -46,6 +46,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering",
]
Expand Down Expand Up @@ -113,7 +114,8 @@ dev-doc = [
"jupyterlab",
"jupyterlab-myst",
"jupytext",
"mdformat-myst"
# cannot lock with this (2024-07)
# "mdformat-myst"
]
test = [
"pytest",
Expand Down
10 changes: 9 additions & 1 deletion src/fluidimage/works/preproc/_toolbox_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def temporal_minima(img=None, weight=1.0, window_shape=None):


@iterate_multiple_imgs
def global_threshold(img=None, minima=0.0, maxima=65535.0):
def global_threshold(img=None, minima=0, maxima=None):
"""
Trims pixel intensities which are outside the interval (minima, maxima).
Expand All @@ -276,6 +276,14 @@ def global_threshold(img=None, minima=0.0, maxima=65535.0):
"""
img_out = img.copy()
if maxima is None:
dtype = img_out.dtype
try:
info = np.iinfo(dtype)
except ValueError:
maxima = 65535
else:
maxima = info.max
img_out[img_out < minima] = minima
img_out[img_out > maxima] = maxima
return img_out
Expand Down

0 comments on commit a404af2

Please sign in to comment.