mittagessen / kraken

OCR engine for all the languages
http://kraken.re
Apache License 2.0
673 stars 125 forks source link

Update deprecated import statement for scipy filters #577

Closed stweil closed 3 months ago

stweil commented 3 months ago

This fixes some runtime warnings:

venv3.11/lib/python3.11/site-packages/kraken/pageseg.py:28
  venv3.11/lib/python3.11/site-packages/kraken/pageseg.py:28: DeprecationWarning: Please use `gaussian_filter` from the `scipy.ndimage` namespace, the `scipy.ndimage.filters` namespace is deprecated.
    from scipy.ndimage.filters import (gaussian_filter, maximum_filter,

venv3.11/lib/python3.11/site-packages/kraken/pageseg.py:28
  venv3.11/lib/python3.11/site-packages/kraken/pageseg.py:28: DeprecationWarning: Please use `maximum_filter` from the `scipy.ndimage` namespace, the `scipy.ndimage.filters` namespace is deprecated.
    from scipy.ndimage.filters import (gaussian_filter, maximum_filter,

venv3.11/lib/python3.11/site-packages/kraken/pageseg.py:28
  venv3.11/lib/python3.11/site-packages/kraken/pageseg.py:28: DeprecationWarning: Please use `uniform_filter` from the `scipy.ndimage` namespace, the `scipy.ndimage.filters` namespace is deprecated.
    from scipy.ndimage.filters import (gaussian_filter, maximum_filter,
stweil commented 3 months ago

I noticed this when running pytest tests/test_pageseg.py (which passes, so why is it excluded in the GitHub test action?).

The patch was tested successfully with Python 3.8 and Python 3.11.

mittagessen commented 3 months ago

On 24/03/15 10:27AM, Stefan Weil wrote:

I noticed this when running pytest tests/test_pageseg.py (which passes, so why is it excluded in the GitHub test actions?).

The patch was tested successfully with Python 3.8 and Python 3.11.

They failed at one point, I think.

stweil commented 3 months ago

Indeed, you wrote "skip legacy pageseg tests, they core dump on CI" nearly two years ago. The test no longer core dumps, so pull request #579 enables it again.

stweil commented 3 months ago

The old import statement was already deprecated two years ago, see the release notes for 1.8.0. Therefore the change should be safe for all recent releases of kraken which require scipy 1.10.