Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing the incompatibilities with the different python version #73

Merged
merged 4 commits into from
Nov 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion modopt/math/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@

import numpy as np
from scipy.ndimage import uniform_filter, gaussian_filter
import sys

try:
from skimage.metrics import structural_similarity as compare_ssim
if sys.version_info.minor == 5:
from skimage.measure import compare_ssim
elif sys.version_info.minor > 5:
from skimage.metrics import structural_similarity as compare_ssim
except ImportError: # pragma: no cover
import_skimage = False
else:
Expand Down
6 changes: 5 additions & 1 deletion modopt/tests/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from unittest import TestCase, skipIf, skipUnless
import numpy as np
import numpy.testing as npt
import sys
from modopt.math import *
try:
import astropy
Expand All @@ -19,7 +20,10 @@
else: # pragma: no cover
import_astropy = True
try:
from skimage.metrics import structural_similarity
if sys.version_info.minor == 5:
from skimage.measure import compare_ssim
elif sys.version_info.minor > 5:
from skimage.metrics import structural_similarity as compare_ssim
except ImportError: # pragma: no cover
import_skimage = False
else:
Expand Down