Esempio n. 1
0
 def test_iteroutputs_empty(self):
     node = BaseCompositor(sources=[ARRAY_LAT, ARRAY_LON, ARRAY_TIME])
     outputs = node.iteroutputs(
         podpac.Coordinates([-1, -1, -1], dims=["lat", "lon", "time"]))
     np.testing.assert_array_equal(next(outputs), [[[np.nan]]])
     np.testing.assert_array_equal(next(outputs), [[[np.nan]]])
     np.testing.assert_array_equal(next(outputs), [[[np.nan]]])
     with pytest.raises(StopIteration):
         next(outputs)
Esempio n. 2
0
    def test_iteroutputs_singlethreaded(self):
        with podpac.settings:
            podpac.settings["MULTITHREADING"] = False

            node = BaseCompositor(sources=[ARRAY_LAT, ARRAY_LON, ARRAY_TIME])
            outputs = node.iteroutputs(COORDS)
            np.testing.assert_array_equal(next(outputs), LAT)
            np.testing.assert_array_equal(next(outputs), LON)
            np.testing.assert_array_equal(next(outputs), TIME)
            with pytest.raises(StopIteration):
                next(outputs)
            assert node._multi_threaded == False
Esempio n. 3
0
    def test_iteroutputs_n_threads_1(self):
        with podpac.settings:
            podpac.settings["MULTITHREADING"] = True
            podpac.settings["N_THREADS"] = 1

            n_threads_before = podpac.core.managers.multi_threading.thread_manager._n_threads_used
            node = BaseCompositor(sources=[ARRAY_LAT, ARRAY_LON, ARRAY_TIME])
            outputs = node.iteroutputs(COORDS)
            np.testing.assert_array_equal(next(outputs), LAT)
            np.testing.assert_array_equal(next(outputs), LON)
            np.testing.assert_array_equal(next(outputs), TIME)
            with pytest.raises(StopIteration):
                next(outputs)
            assert node._multi_threaded == False
            assert podpac.core.managers.multi_threading.thread_manager._n_threads_used == n_threads_before