def test_potential(): "gravmag.prism.potential python vs cython implementation" py = _prism.potential(xp, yp, zp, model) cy = _cprism.potential(xp, yp, zp, model) diff = np.abs(py - cy) assert np.all(diff <= precision), 'max diff: %g' % (max(diff))
def test_potential_ne(): "gravmag.prism.potential python vs numexpr implementation" py = _prism.potential(xp, yp, zp, model) ne = _neprism.potential(xp, yp, zp, model) diff = np.abs(py - ne) assert np.all(diff <= precision), 'max diff: %g' % (max(diff))