Commit 7f8570f9 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Deactivated deprecated tests.


Former-commit-id: 8ba63e5a
Former-commit-id: 550e19c3
parent 5aea564f
......@@ -16,7 +16,7 @@ from geoarray import GeoArray
from gms_preprocessing import __path__ # noqa E402 module level import not at top of file
from gms_preprocessing import set_config # noqa E402 module level import not at top of file
from gms_preprocessing.algorithms.L2B_P import ReferenceCube_Generator_OLD # noqa E402 module level import not at top of file
# from gms_preprocessing.algorithms.L2B_P import ReferenceCube_Generator_OLD # noqa E402 module level import not at top of file
from gms_preprocessing.algorithms.L2B_P import ReferenceCube_Generator # noqa E402 module level import not at top of file
from gms_preprocessing.algorithms.L2B_P import RefCube # noqa E402 module level import not at top of file
from gms_preprocessing.algorithms.L2B_P import SpectralHomogenizer # noqa E402 module level import not at top of file
......@@ -25,39 +25,39 @@ from gms_preprocessing.algorithms.L2B_P import SpectralHomogenizer # noqa E402
testdata = os.path.join(__path__[0], '../tests/data/hy_spec_data/Bavaria_farmland_LMU_Hyspex_subset.bsq')
class Test_ReferenceCube_Generator_OLD(unittest.TestCase):
"""Tests class for gms_preprocessing.algorithms.L2B_P.SpecHomo_Classifier"""
@classmethod
def setUpClass(cls):
# Testjob Landsat-8
set_config(exec_mode='Python', job_ID=26186196, db_host='geoms', reset_status=True, is_test=True)
cls.SHC = ReferenceCube_Generator_OLD([testdata, testdata, ], v=False)
def test_generate_reference_cube_L8(self):
ref_cube = self.SHC.generate_reference_cube('Landsat-8', 'OLI_TIRS', n_clusters=10, tgt_n_samples=1000)
self.assertIsInstance(ref_cube, np.ndarray)
self.assertTrue(np.any(ref_cube), msg='Reference cube for Landsat-8 is empty.')
def test_generate_reference_cube_S2A(self):
ref_cube = self.SHC.generate_reference_cube('Sentinel-2A', 'MSI', n_clusters=10, tgt_n_samples=1000)
self.assertIsInstance(ref_cube, np.ndarray)
self.assertTrue(np.any(ref_cube), msg='Reference cube for Sentinel-2A is empty.')
@unittest.SkipTest
def test_generate_reference_cube_AST(self):
ref_cube = self.SHC.generate_reference_cube('Terra', 'ASTER', n_clusters=10, tgt_n_samples=1000)
self.assertIsInstance(ref_cube, np.ndarray)
def test_multiprocessing(self):
SHC = ReferenceCube_Generator_OLD([testdata, testdata, ], v=False, CPUs=1)
ref_cube_sp = SHC.generate_reference_cube('Landsat-8', 'OLI_TIRS', n_clusters=10, tgt_n_samples=1000)
SHC = ReferenceCube_Generator_OLD([testdata, testdata, ], v=False, CPUs=None)
ref_cube_mp = SHC.generate_reference_cube('Landsat-8', 'OLI_TIRS', n_clusters=10, tgt_n_samples=1000)
self.assertTrue(np.any(ref_cube_sp), msg='Singleprocessing result is empty.')
self.assertTrue(np.any(ref_cube_mp), msg='Multiprocessing result is empty.')
# class Test_ReferenceCube_Generator_OLD(unittest.TestCase):
# """Tests class for gms_preprocessing.algorithms.L2B_P.SpecHomo_Classifier"""
#
# @classmethod
# def setUpClass(cls):
# # Testjob Landsat-8
# set_config(exec_mode='Python', job_ID=26186196, db_host='geoms', reset_status=True, is_test=True)
# cls.SHC = ReferenceCube_Generator_OLD([testdata, testdata, ], v=False)
#
# def test_generate_reference_cube_L8(self):
# ref_cube = self.SHC.generate_reference_cube('Landsat-8', 'OLI_TIRS', n_clusters=10, tgt_n_samples=1000)
# self.assertIsInstance(ref_cube, np.ndarray)
# self.assertTrue(np.any(ref_cube), msg='Reference cube for Landsat-8 is empty.')
#
# def test_generate_reference_cube_S2A(self):
# ref_cube = self.SHC.generate_reference_cube('Sentinel-2A', 'MSI', n_clusters=10, tgt_n_samples=1000)
# self.assertIsInstance(ref_cube, np.ndarray)
# self.assertTrue(np.any(ref_cube), msg='Reference cube for Sentinel-2A is empty.')
#
# @unittest.SkipTest
# def test_generate_reference_cube_AST(self):
# ref_cube = self.SHC.generate_reference_cube('Terra', 'ASTER', n_clusters=10, tgt_n_samples=1000)
# self.assertIsInstance(ref_cube, np.ndarray)
#
# def test_multiprocessing(self):
# SHC = ReferenceCube_Generator_OLD([testdata, testdata, ], v=False, CPUs=1)
# ref_cube_sp = SHC.generate_reference_cube('Landsat-8', 'OLI_TIRS', n_clusters=10, tgt_n_samples=1000)
#
# SHC = ReferenceCube_Generator_OLD([testdata, testdata, ], v=False, CPUs=None)
# ref_cube_mp = SHC.generate_reference_cube('Landsat-8', 'OLI_TIRS', n_clusters=10, tgt_n_samples=1000)
#
# self.assertTrue(np.any(ref_cube_sp), msg='Singleprocessing result is empty.')
# self.assertTrue(np.any(ref_cube_mp), msg='Multiprocessing result is empty.')
class Test_ReferenceCube_Generator(unittest.TestCase):
......@@ -117,16 +117,16 @@ class Test_ReferenceCube_Generator(unittest.TestCase):
self.assertIsInstance(refcubes[('Landsat-8', 'OLI_TIRS')], RefCube)
self.assertEqual(refcubes[('Landsat-8', 'OLI_TIRS')].data.shape, (self.tgt_n_samples, len(self.testIms), 9))
@unittest.SkipTest
def test_multiprocessing(self):
SHC = ReferenceCube_Generator_OLD([testdata, testdata, ], v=False, CPUs=1)
ref_cube_sp = SHC.generate_reference_cube('Landsat-8', 'OLI_TIRS', n_clusters=10, tgt_n_samples=1000)
SHC = ReferenceCube_Generator_OLD([testdata, testdata, ], v=False, CPUs=None)
ref_cube_mp = SHC.generate_reference_cube('Landsat-8', 'OLI_TIRS', n_clusters=10, tgt_n_samples=1000)
self.assertTrue(np.any(ref_cube_sp), msg='Singleprocessing result is empty.')
self.assertTrue(np.any(ref_cube_mp), msg='Multiprocessing result is empty.')
# @unittest.SkipTest
# def test_multiprocessing(self):
# SHC = ReferenceCube_Generator_OLD([testdata, testdata, ], v=False, CPUs=1)
# ref_cube_sp = SHC.generate_reference_cube('Landsat-8', 'OLI_TIRS', n_clusters=10, tgt_n_samples=1000)
#
# SHC = ReferenceCube_Generator_OLD([testdata, testdata, ], v=False, CPUs=None)
# ref_cube_mp = SHC.generate_reference_cube('Landsat-8', 'OLI_TIRS', n_clusters=10, tgt_n_samples=1000)
#
# self.assertTrue(np.any(ref_cube_sp), msg='Singleprocessing result is empty.')
# self.assertTrue(np.any(ref_cube_mp), msg='Multiprocessing result is empty.')
class Test_SpectralHomogenizer(unittest.TestCase):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment