From 9187dbbb3bc601103c3bb8ab539078a4a2e65f8c Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Fri, 15 Mar 2024 18:05:32 +0100 Subject: [PATCH] Update deprecated import statement for scipy filters 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, ``` Signed-off-by: Stefan Weil --- kraken/pageseg.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kraken/pageseg.py b/kraken/pageseg.py index c29742620..12fe28d02 100644 --- a/kraken/pageseg.py +++ b/kraken/pageseg.py @@ -25,8 +25,7 @@ import numpy as np import PIL -from scipy.ndimage.filters import (gaussian_filter, maximum_filter, - uniform_filter) +from scipy.ndimage import gaussian_filter, maximum_filter, uniform_filter from kraken.containers import BBoxLine, Segmentation from kraken.lib import morph, sl