diff --git a/.github/workflows/test_pull_requests.yml b/.github/workflows/test_pull_requests.yml index 8db48d3c6..33ca47716 100644 --- a/.github/workflows/test_pull_requests.yml +++ b/.github/workflows/test_pull_requests.yml @@ -21,7 +21,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] # see supported versions at # https://raw.githubusercontent.com/actions/python-versions/master/versions-manifest.json - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] # test only the latest 3.x on mac # test only the latest 3.x on windows exclude: @@ -85,27 +85,27 @@ jobs: echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")" shell: bash - - uses: actions/cache@v1 + - uses: actions/cache@v4 if: startsWith(runner.os, 'Linux') with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-pip-${{ steps.get-date.outputs.date }}-${{ hashFiles('setup.py') }} restore-keys: | ${{ runner.os }}-pip- - - uses: actions/cache@v1 + - uses: actions/cache@v4 if: startsWith(runner.os, 'macOS') with: path: ~/Library/Caches/pip - key: ${{ runner.os }}-pip-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-pip-${{ steps.get-date.outputs.date }}-${{ hashFiles('setup.py') }} restore-keys: | ${{ runner.os }}-pip- - - uses: actions/cache@v1 + - uses: actions/cache@v4 if: startsWith(runner.os, 'Windows') with: path: ~\AppData\Local\pip\Cache - key: ${{ runner.os }}-pip-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-pip-${{ steps.get-date.outputs.date }}-${{ hashFiles('setup.py') }} restore-keys: | ${{ runner.os }}-pip- diff --git a/changelogs/master/changed/20241202_change_scikit-image_support.md b/changelogs/master/changed/20241202_change_scikit-image_support.md new file mode 100644 index 000000000..ab62720f3 --- /dev/null +++ b/changelogs/master/changed/20241202_change_scikit-image_support.md @@ -0,0 +1,5 @@ +# Requires scikit-image >= 0.18.0 + +Changes in the tests require a different minimal +`scikit-image` version. Older versions might work +but will be untested. \ No newline at end of file diff --git a/changelogs/master/changed/20241216_change_supported_python.md b/changelogs/master/changed/20241216_change_supported_python.md new file mode 100644 index 000000000..4ae0825df --- /dev/null +++ b/changelogs/master/changed/20241216_change_supported_python.md @@ -0,0 +1 @@ +# Support Python >=3.7,<=3.12 \ No newline at end of file diff --git a/changelogs/master/changed/20241217_add_opencv4_support.md b/changelogs/master/changed/20241217_add_opencv4_support.md new file mode 100644 index 000000000..1430646de --- /dev/null +++ b/changelogs/master/changed/20241217_add_opencv4_support.md @@ -0,0 +1 @@ +# Add OpenCV4 suport \ No newline at end of file diff --git a/changelogs/master/fixed/20240918_fix_numpy_2_sctypes.md b/changelogs/master/fixed/20240918_fix_numpy_2_sctypes.md new file mode 100644 index 000000000..a121d5047 --- /dev/null +++ b/changelogs/master/fixed/20240918_fix_numpy_2_sctypes.md @@ -0,0 +1,6 @@ +# Fix broken dtypes for numpy 2.0 #856 + +`np.sctypes` was removed in the NumPy 2.0. +All occurences were replaced with a set of +the specific NumPy types. + diff --git a/changelogs/master/fixed/20241025_fix_cval_is_depreciated.md b/changelogs/master/fixed/20241025_fix_cval_is_depreciated.md new file mode 100644 index 000000000..5dd174d0b --- /dev/null +++ b/changelogs/master/fixed/20241025_fix_cval_is_depreciated.md @@ -0,0 +1,5 @@ +# Replace default (and depreciated) cval with replacement + +In `skimage.measure.block_reduce` in `imgaug.pool` the constant value is +set by depreciated `cval` variable althought replacement `pad_cval` is +available. \ No newline at end of file diff --git a/changelogs/master/fixed/20241111_fix_failing_test_seed.md b/changelogs/master/fixed/20241111_fix_failing_test_seed.md new file mode 100644 index 000000000..8c1266806 --- /dev/null +++ b/changelogs/master/fixed/20241111_fix_failing_test_seed.md @@ -0,0 +1,8 @@ +# Relax test condition for unlucky seed choice + +After trying back and forth I came to the conclusion that the +`test/augmenters/test_geometric.py:_test_image_cbaoi_alignment`fails +sindce target value is highly dependend on the seed value. With `seed=1` for `iaa.ElasticTransformation` `count_bad` goes to 0. + +This provides the conclusion even with a changed seed it cannot be granted that the test will pass for future random generators. Thus +a relaxed target value might be the better choice. \ No newline at end of file diff --git a/changelogs/master/fixed/20241127_fix_zero_sized_arrays.md b/changelogs/master/fixed/20241127_fix_zero_sized_arrays.md new file mode 100644 index 000000000..41eb8778f --- /dev/null +++ b/changelogs/master/fixed/20241127_fix_zero_sized_arrays.md @@ -0,0 +1,7 @@ +# OpenCV 3 does not support zero-sized arrays + +NumPy 1.23 can create zero-sized arrays which +cannot be handled by OpenCV in `_invert_uint8_subtract_` +in `imgaug/augmenters/arithmetic.py`. If a zero-sized +array is detected directly return it without further +processing. diff --git a/changelogs/master/fixed/20241204_fix_improved_skimage_cvals.md b/changelogs/master/fixed/20241204_fix_improved_skimage_cvals.md new file mode 100644 index 000000000..482949a3f --- /dev/null +++ b/changelogs/master/fixed/20241204_fix_improved_skimage_cvals.md @@ -0,0 +1,5 @@ +# Changed behavior of `_augment_images_by_samples` + +The cval test became obsolete for skimage > 0.19 since the piecewise +tested affine transform does not produce empty pixels anymore. The +test for cval == 0 only passed due to uint overflows. \ No newline at end of file diff --git a/changelogs/master/fixed/20241204_fix_scikit-image_warp.md b/changelogs/master/fixed/20241204_fix_scikit-image_warp.md new file mode 100644 index 000000000..ad66c7505 --- /dev/null +++ b/changelogs/master/fixed/20241204_fix_scikit-image_warp.md @@ -0,0 +1,7 @@ +# Mitigate different behavior for scikit-image's transform.warp + +Prior to `scikit-image=0.19.0` `transform.warp` converted float16 images +implicitly to float64 prior to the calculation. This has changed such +that we need to convert the image to a supported floating point format +ourselves in `_warp_affine_arr_skimage` and `_augment_images_by_samples` +in `imgaug/augmenters/geometric.py`. \ No newline at end of file diff --git a/changelogs/master/fixed/20241206_fix_skimage_determinism.md b/changelogs/master/fixed/20241206_fix_skimage_determinism.md new file mode 100644 index 000000000..84c737a76 --- /dev/null +++ b/changelogs/master/fixed/20241206_fix_skimage_determinism.md @@ -0,0 +1,15 @@ +# Create imagecorruptions fork + +Since `scikit-image >= 0.19.0` the determinism of some +functions cannot be controlled via manipulating the global +NumPy random generator seed. This results in random behavior +for tests involving `imagecorruptions` functions. +The only solutions is to add a seed parameter to the repective +functions. A corresponding upstream pull request is pending but +the changes are low such that a `imagecorruptions` fork is required. + +Another problem is the broken support of the `imagecorruptions` +main branch for older `scikit-image` versions. + +In the future versions will merge the fork into the `imgaug` codebase and +also require newer `scikit-image` versions. \ No newline at end of file diff --git a/changelogs/master/fixed/20241213_fix_add_numpy_126_support.md b/changelogs/master/fixed/20241213_fix_add_numpy_126_support.md new file mode 100644 index 000000000..10bdbaf63 --- /dev/null +++ b/changelogs/master/fixed/20241213_fix_add_numpy_126_support.md @@ -0,0 +1,3 @@ +# Add NumPy 1.26 support + +Add the support of NumPy 1.26 to `test/test_random.py`. \ No newline at end of file diff --git a/changelogs/master/fixed/20241216_fix_failing_int128_tests.md b/changelogs/master/fixed/20241216_fix_failing_int128_tests.md new file mode 100644 index 000000000..6daca563d --- /dev/null +++ b/changelogs/master/fixed/20241216_fix_failing_int128_tests.md @@ -0,0 +1,9 @@ +# Delete different test routines for float128 systems + +The test `test_unusual_channel_numbers` in +`test/augmenters/test_contrast.py` ran different test routines +depending on the float128 support of the system. + +Yet, the main reason for the different behavior is the `params.draw_samples` call in `contrast.py:71` which converts a regular python int into a numpy array of int dtype and thus resulted in different floating point rounding errors. + +This behavior was not mirrored in the expected test output and thus resulted in different outcomes on systems with different floating point support. \ No newline at end of file diff --git a/changelogs/master/fixed/20241216_fix_seed_always_as_int.md b/changelogs/master/fixed/20241216_fix_seed_always_as_int.md new file mode 100644 index 000000000..169e84c41 --- /dev/null +++ b/changelogs/master/fixed/20241216_fix_seed_always_as_int.md @@ -0,0 +1,3 @@ +# Make sure `random.seed` received int + +The multicore support was broken to to differend seed dtypes. \ No newline at end of file diff --git a/changelogs/master/improved/20241203_make_poly_test_consistent.md b/changelogs/master/improved/20241203_make_poly_test_consistent.md new file mode 100644 index 000000000..31a7c3f3d --- /dev/null +++ b/changelogs/master/improved/20241203_make_poly_test_consistent.md @@ -0,0 +1,8 @@ +# Polygon test was inconsistent + +`test_alpha_is_080` in `test/augmentables/test_polys.py` +hard-coded inconsistent behavior of `scikit-image` which +was fixed with `scikit-image >=0.18.0`. + +Until this point, the polygon left and right boundaries were handled +differently. \ No newline at end of file diff --git a/changelogs/master/refactored/20230413_replace_numpy_bool.md b/changelogs/master/refactored/20230413_replace_numpy_bool.md new file mode 100644 index 000000000..d6bf7d03f --- /dev/null +++ b/changelogs/master/refactored/20230413_replace_numpy_bool.md @@ -0,0 +1,6 @@ +# Replace numpy bool with standard bool #832 + +This commit replaces all occurences of the +dtype `np.bool` with `bool` from the python +standard library. `np.bool` is marked as +depreciated in `numpy >= 1.20`. \ No newline at end of file diff --git a/changelogs/master/refactored/20230726_replace_numpy_complex.md b/changelogs/master/refactored/20230726_replace_numpy_complex.md new file mode 100644 index 000000000..1ab7c4f9c --- /dev/null +++ b/changelogs/master/refactored/20230726_replace_numpy_complex.md @@ -0,0 +1,4 @@ +Change numpy complex types #840 + +The dtype `np.complex` is depreciated in numpy >= 1.20. +All occurrences where replaced by `np.complex128`. \ No newline at end of file diff --git a/changelogs/master/refactored/20250306_github_actions_cache_ci.md b/changelogs/master/refactored/20250306_github_actions_cache_ci.md new file mode 100644 index 000000000..a1615f0c2 --- /dev/null +++ b/changelogs/master/refactored/20250306_github_actions_cache_ci.md @@ -0,0 +1,9 @@ +# Changed github actions + +Version 1 of `actions/cache` is now depreciated. +The pipeline switched version 4. + +Since `requirements.txt` was deleted, the caching +not relies on `setup.py` instead. + +Python 3.7 is not available on `ubuntu-latest` runners. diff --git a/setup.py b/setup.py index f53304cc4..fb1d2855c 100644 --- a/setup.py +++ b/setup.py @@ -100,7 +100,6 @@ def get_install_requirements(main_requires, alternative_requires): "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10",