def test_calculate_structure_factor_raises(self, ferrite_phase): rlp = ReciprocalLatticePoint(phase=ferrite_phase, hkl=[1, 0, 0]) with pytest.raises(ValueError, match="method=man must be among"): rlp.calculate_structure_factor(method="man") with pytest.raises(ValueError, match="'voltage' parameter must be set when"): rlp.calculate_structure_factor(method="doyleturner")
def test_calculate_structure_factor( self, ferrite_phase, method, voltage, hkl, desired_factor ): rlp = ReciprocalLatticePoint(phase=ferrite_phase, hkl=hkl) rlp.calculate_structure_factor(method=method, voltage=voltage) assert np.allclose(rlp.structure_factor, desired_factor)