MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / test_fit_spectrum_fail

Function test_fit_spectrum_fail

pyxrf/core/tests/test_fitting.py:558–567  ·  view source on GitHub ↗

r""" Test _fit_nnls for supported cases of failure

()

Source from the content-addressed store, hash-verified

556
557
558def test_fit_spectrum_fail():
559 r"""
560 Test _fit_nnls for supported cases of failure
561 """
562 n_pts, n_refs, n_pixels = 10, 3, 5
563
564 spectra = np.zeros(shape=[n_pts - 1, n_pixels]) # Wrong number of data points
565 data_input = np.zeros(shape=[n_pts, n_refs])
566 with pytest.raises(AssertionError, match="number of spectrum points in data .+ do not match"):
567 fit_spectrum(spectra, data_input)

Callers

nothing calls this directly

Calls 1

fit_spectrumFunction · 0.90

Tested by

no test coverage detected