def test_squeezable_logspace_nosqueeze(self): """Test creation of non-squeezed logspace. Without squeezing, results should be equal to normal ``nlogspace``. """ ref = np.array([1, 10, 100]) t = math.squeezable_logspace(1, 100, 3) assert (np.allclose(t, ref))
def test_squeezable_logspace_squeezebounds(self): """Test ValueError if squeeze is out of bounds.""" with pytest.raises(ValueError): math.squeezable_logspace(100, 1, squeeze=2.01)
def test_squeezable_logspace_fixpointbounds(self): """Test ValueError if fixpoint is out of bounds.""" with pytest.raises(ValueError): math.squeezable_logspace(100, 1, fixpoint=1.1)
def test_squeezable_logspace(self): """Test creation of squeezable logspace.""" ref = np.array([1, 3.16227766, 100]) t = math.squeezable_logspace(1, 100, 3, squeeze=0.5) assert (np.allclose(t, ref))
def test_squeezable_logspace_squeezebounds(self): """Test ValueError if squeeze is out of bounds.""" math.squeezable_logspace(100, 1, squeeze=2.01)