Skip to content

Commit f75c716

Browse files
committed
replacing pkg_resources by importlib_resources
1 parent 0b72751 commit f75c716

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

openpiv/test/test_process.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
from openpiv.pyprocess import extended_search_area_piv as piv
2-
from openpiv.pyprocess import fft_correlate_images, \
3-
correlation_to_displacement
4-
import matplotlib.pyplot as plt
5-
61
import numpy as np
7-
8-
2+
import matplotlib.pyplot as plt
93
from skimage.util import random_noise
104
from skimage import img_as_ubyte
115
from scipy.ndimage import shift as shift_img
12-
import pkg_resources as pkg
6+
# import pkg_resources as pkg
7+
from importlib_resources import files
8+
from openpiv.pyprocess import extended_search_area_piv as piv
9+
from openpiv.pyprocess import fft_correlate_images, \
10+
correlation_to_displacement
11+
1312

1413
threshold = 0.25
1514

@@ -128,8 +127,9 @@ def test_process_extended_search_area():
128127
def test_sig2noise_ratio():
129128
""" s2n ratio test """
130129
from openpiv import tools
131-
im1 = pkg.resource_filename("openpiv", "data/test1/exp1_001_a.bmp")
132-
im2 = pkg.resource_filename("openpiv", "data/test1/exp1_001_b.bmp")
130+
im1 = files('openpiv.data').joinpath('test1/exp1_001_a.bmp')
131+
im2 = files('openpiv.data').joinpath('test1/exp1_001_b.bmp')
132+
133133

134134
frame_a = tools.imread(im1)
135135
frame_b = tools.imread(im2)

0 commit comments

Comments
 (0)