-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
9 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
"""UNIT TESTS FOR Algorithms. | ||
This module contains unit tests for the modopt.opt module. | ||
|
@@ -8,6 +7,7 @@ | |
Pierre-Antoine Comby <[email protected]> | ||
""" | ||
|
||
from importlib.utils import find_spec | ||
import numpy as np | ||
import numpy.testing as npt | ||
from modopt.opt import algorithms, cost, gradient, linear, proximity, reweight | ||
|
@@ -18,11 +18,7 @@ | |
) | ||
|
||
|
||
SKLEARN_AVAILABLE = True | ||
try: | ||
import sklearn | ||
except ImportError: | ||
SKLEARN_AVAILABLE = False | ||
SKLEARN_AVAILABLE = find_spec("sklearn") is not None | ||
|
||
|
||
@fixture | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
Pierre-Antoine Comby <[email protected]> | ||
""" | ||
|
||
from importlib.utils import find_spec | ||
import pytest | ||
from test_helpers import failparam, skipparam | ||
|
||
|
@@ -16,18 +17,8 @@ | |
|
||
from modopt.math import convolve, matrix, metrics, stats | ||
|
||
try: | ||
import astropy | ||
except ImportError: # pragma: no cover | ||
ASTROPY_AVAILABLE = False | ||
else: # pragma: no cover | ||
ASTROPY_AVAILABLE = True | ||
try: | ||
from skimage.metrics import structural_similarity as compare_ssim | ||
except ImportError: # pragma: no cover | ||
SKIMAGE_AVAILABLE = False | ||
else: | ||
SKIMAGE_AVAILABLE = True | ||
ASTROPY_AVAILABLE = find_spec("astropy") is not None | ||
SKIMAGE_AVAILABLE = find_spec("skimage.metrics") | ||
|
||
|
||
class TestConvolve: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
Pierre-Antoine Comby <[email protected]> | ||
""" | ||
|
||
from importlib.utils import find_spec | ||
|
||
import numpy as np | ||
import numpy.testing as npt | ||
import pytest | ||
|
@@ -16,16 +18,11 @@ | |
|
||
from test_helpers import Dummy | ||
|
||
SKLEARN_AVAILABLE = True | ||
try: | ||
import sklearn | ||
except ImportError: | ||
SKLEARN_AVAILABLE = False | ||
SKLEARN_AVAILABLE = find_spec("sklearn") is not None | ||
|
||
PYWT_AVAILABLE = True | ||
PYWT_AVAILABLE = find_spec("joblib") is not None | ||
try: | ||
import pywt | ||
import joblib | ||
except ImportError: | ||
PYWT_AVAILABLE = False | ||
|
||
|