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_generate_signal():
data = np.ones((1, 10)) * np.arange(4).reshape(4, 1)
data = data.reshape(2, 2, 10)
pdf = PDFProfile(data)
assert isinstance(pdf, PDFProfile)
def test_get_pdf(reduced_intensity_profile):
pdfgen = PDFGenerator(reduced_intensity_profile)
pdf = pdfgen.get_pdf(s_cutoff=[0, 9])
assert isinstance(pdf, PDFProfile)
def test_generate_signal():
data = np.ones((1, 10)) * np.arange(4).reshape(4, 1)
data = data.reshape(2, 2, 10)
pdf = PDFProfile(data)
assert isinstance(pdf, PDFProfile)
def test_generate_signal():
data = np.ones((1, 10)) * np.arange(4).reshape(4, 1)
data = data.reshape(2, 2, 10)
pdf = PDFProfile(data)
pdf.normalise_signal()
assert np.equal(pdf, np.ones((2, 2, 10)))
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])
assert pdf is None