Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_pdf_gen_init(reduced_intensity_profile):
pdfgen = PDFGenerator(reduced_intensity_profile)
assert isinstance(pdfgen, PDFGenerator)
def test_pdf_gen_init(reduced_intensity_profile):
pdfgen = PDFGenerator(reduced_intensity_profile)
assert isinstance(pdfgen, PDFGenerator)
def test_s_limits(reduced_intensity_profile):
pdfgen = PDFGenerator(reduced_intensity_profile)
pdf = pdfgen.get_pdf(s_cutoff=[0, 12])
pdf2 = pdfgen.get_pdf(s_cutoff=[0, 10])
assert np.array_equal(pdf.data, pdf2.data)
def test_signal_size():
spectrum = np.array([5., 4., 3., 2., 2., 1., 1., 1., 0., 0.])
ri = ReducedIntensityProfile(spectrum)
pdfgen = PDFGenerator(ri)
pdf = pdfgen.get_pdf(s_cutoff=[0, 10])
assert isinstance(pdf, PDFProfile)
ri = ReducedIntensityProfile([spectrum])
pdfgen = PDFGenerator(ri)
pdf = pdfgen.get_pdf(s_cutoff=[0, 10])
assert isinstance(pdf, PDFProfile)
ri = ReducedIntensityProfile([[spectrum]])
pdfgen = PDFGenerator(ri)
pdf = pdfgen.get_pdf(s_cutoff=[0, 10])
assert isinstance(pdf, PDFProfile)
ri = ReducedIntensityProfile([[[spectrum]]])
pdfgen = PDFGenerator(ri)
pdf = pdfgen.get_pdf(s_cutoff=[0, 10])
def test_get_pdf(reduced_intensity_profile):
pdfgen = PDFGenerator(reduced_intensity_profile)
pdf = pdfgen.get_pdf(s_cutoff=[0, 9])
assert isinstance(pdf, PDFProfile)