title: Numerical integration in Python with adaptive quadrature of vectorized function
body: <p>I'm looking for a super duper numerical quadrature function. It should have the following three properties:</p>
  
  <ul>
  <li>Adaptive - it automatically adjusts the density of sampling points to fit the integrand. This is absolutely necessary because my integrand is very nonuniform and expensive to compute.</li>
  <li>Vectorized - it calls the integrand on lists of sample points rather than one point at a time, for efficiency.</li>
  <li>Able to handle vector-valued functions - all components of the vector-valued integrand are computed at the same time for no additional cost, so it makes no sense to integrate all the components separately.</li>
  </ul>
  
  <p>In addition, it should be:</p>
  
  <ul>
  <li>2D - the integral I want to compute is a double integral over a planar region, and I want to be able to specify an overall (relative) tolerance for the whole integral and have it manage the error budget appropriately.</li>
  </ul>
  
  <p>Does anybody know of a library that has such a function? Even two or three of the four properties would be better than nothing.</p>
  
  <p>I'm using Python and SciPy, so if it already works with Python that's a bonus. (But I'm also able to write glue code to let it call my integrand if necessary.)</p>