diff --git a/lumispy/signals/luminescence_spectrum.py b/lumispy/signals/luminescence_spectrum.py index 1a0634e9a..aa23f4e31 100644 --- a/lumispy/signals/luminescence_spectrum.py +++ b/lumispy/signals/luminescence_spectrum.py @@ -247,7 +247,7 @@ def to_eV(self, inplace=True, jacobian=True): The intensity is converted from counts/nm (counts/µm) to counts/cm^-1 by doing a Jacobian transformation, see e.g. Mooney and Kambhampati, J. Phys. Chem. Lett. 4, 3316 (2013), doi:10.1021/jz401508t, which - ensures that integrated signals are correct also in the wavenumber + ensures that integrated signals are correct also in the wavenumber domain. If the variance of the signal is known, i.e. `metadata.Signal.Noise_properties.variance` is a signal representing the variance, a squared renormalization of the variance is performed. @@ -557,10 +557,6 @@ def remove_background_from_file(self, background=None, inplace=False, **kwargs): try: bkg_x = background_xy[0] bkg_y = background_xy[1] - if len(bkg_x) is not len(bkg_y): - raise AttributeError( - "The length of the x and y axis must match." - ) except IndexError: # pragma: no cover raise AttributeError( "Please provide a background file containing both the x and y axis." diff --git a/lumispy/tests/signals/test_luminescence_spectrum.py b/lumispy/tests/signals/test_luminescence_spectrum.py index c57d4e160..7b052f687 100644 --- a/lumispy/tests/signals/test_luminescence_spectrum.py +++ b/lumispy/tests/signals/test_luminescence_spectrum.py @@ -35,12 +35,6 @@ (LumiSpectrum(np.ones(50)), [np.zeros(50, dtype="float64")]), ] -error_backgrounds = [ - ([np.linspace(0, 49, num=10, dtype="float64"), np.ones(50)], AttributeError), - ([[1, 1], [1, 1], [1, 1]], AttributeError), - # ([np.linspace(0, 48, num=10, dtype="float64"), np.ones(50)], AttributeError), -] - class TestLumiSpectrum: def test_remove_background_from_file(self): @@ -55,9 +49,9 @@ def test_remove_background_from_file(self): def test_errors_raise(self): s = LumiSpectrum(np.ones(50)) - for bkg, error in error_backgrounds: - with pytest.raises(error): - s.remove_background_from_file(bkg) + with pytest.raises(AttributeError): + bkg = np.array([[1, 1], [1, 1], [1, 1]]) + s.remove_background_from_file(bkg) # Test that a GUI is opened if s.remove_background_from_file is passed without a background # s.remove_background_from_file() # Test double background removal