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_reduced_intensity_profile_init(RedIntData):
ri = ReducedIntensityProfile(RedIntData)
assert isinstance(ri, ReducedIntensityProfile)
def test_function_xtables(ri_model):
elements = ['Cu']
fracs = [1]
sc_component = ScatteringFitComponent(elements, fracs, N=1., C=0., type='xtables')
ri_model.append(sc_component)
ri_model.fit()
return
def test_function_lobato(ri_model):
elements = ['Cu']
fracs = [1]
sc_component = ScatteringFitComponent(elements, fracs, N=1., C=0., type='lobato')
ri_model.append(sc_component)
ri_model.fit()
return
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 diffraction_vectors_map(request):
dvm = DiffractionVectors(request.param)
dvm.axes_manager.set_signal_dimension(0)
return dvm
def test_findpeaks_runs_without_error(sample,method):
assert type(sample.find_peaks(method)) == DiffractionVectors
def test_vdf_generator_init_with_vectors(self, diffraction_pattern):
dvm = DiffractionVectors(np.array([[np.array([[1, 1],
[2, 2]]),
np.array([[1, 1],
[2, 2],
[1, 2]])],
[np.array([[1, 1],
[2, 2]]),
np.array([[1, 1],
[2, 2]])]], dtype=object))
dvm.axes_manager.set_signal_dimension(0)
vdfgen = VDFGenerator(diffraction_pattern, dvm)
assert isinstance(vdfgen.signal, ElectronDiffraction)
assert isinstance(vdfgen.vectors, DiffractionVectors)
def diffraction_pattern_one_dimension(request):
"""
1D (in navigation space) diffraction pattern <1|8,8>
"""
return ElectronDiffraction(request.param)
def test_remove_dead_pixels(self, diffraction_pattern, method):
dpr = diffraction_pattern.remove_deadpixels([[1, 2], [5, 6]], method,
inplace=False)
assert isinstance(dpr, ElectronDiffraction)