Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def vdf_generator(diffraction_pattern, diffraction_vectors):
return VDFGenerator(diffraction_pattern, diffraction_vectors)
def test_vdf_generator_from_map(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, VDFGenerator)
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 test_vector_vdfs_without_vectors(self, diffraction_pattern):
vdfgen = VDFGenerator(diffraction_pattern)
vdfgen.get_vector_vdf_images(radius=2.)
def test_vdf_generator_init_without_vectors(self, diffraction_pattern):
vdfgen = VDFGenerator(diffraction_pattern)
assert isinstance(vdfgen.signal, ElectronDiffraction)
assert isinstance(vdfgen.vectors, type(None))