def test_domain_enforcement(): Lorentzian = LorentzianLine("Lorentzian1", (-5., 5), x0=-0.3, width=0.5, c=0.2) e_in_domain = np.linspace(-5.0, 5.0, 11) e_beyond_domain = np.linspace(-10.0, 10.0, 21) p1 = Lorentzian(e_in_domain) p2 = Lorentzian(e_beyond_domain) assert np.all(p1 == p2[Lorentzian.within_domain(e_beyond_domain)])
def test_domainenforcement(): Lorentzian = LorentzianLine("Lorentzian1", (-5., 5), x0=-0.3, width=0.5, c=0.2) F_c = F_cLine("FcLine1", (-15, 15), x0=0.0, width=0.02, A=350.0, q=0.023, c=0.0, weight=1.0) e_in_domain = np.linspace(-5.0, 5.0, 11) e_beyond_domain = np.linspace(-10.0, 10.0, 21) pL1 = Lorentzian(e_in_domain) pL2 = Lorentzian(e_beyond_domain) pF1 = F_c(e_in_domain) pF2 = F_c(e_beyond_domain) assert np.all(pL1 == pL2[Lorentzian.within_domain(e_beyond_domain)]) assert np.all(pF1 == pF2[Lorentzian.within_domain(e_beyond_domain)])