<h3 dir="auto">Describe your issue.</h3>
<p dir="auto">with scipy1.10 scipy.interpolate.RegularGridInterpolator object gives the following error message when the <strong>call</strong> method is used:</p>
<h3 dir="auto">Reproducing Code Example</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import scipy
import scipy.interpolate
import numpy as np

foo = scipy.interpolate.RegularGridInterpolator(
            [np.arange(4), np.arange(5)],
            np.zeros([4,5],&quot;f&quot;),
            bounds_error=False,
            method=&quot;linear&quot;,
            fill_value=None,
        )
print( foo(  (0,0)))
print( foo( [ (0,0), (0,0) ]))
print( foo(np.zeros([20,21,2],&quot;f&quot;)))"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">scipy</span>
<span class="pl-k">import</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">interpolate</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>

<span class="pl-s1">foo</span> <span class="pl-c1">=</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">interpolate</span>.<span class="pl-v">RegularGridInterpolator</span>(
            [<span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-c1">4</span>), <span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-c1">5</span>)],
            <span class="pl-s1">np</span>.<span class="pl-en">zeros</span>([<span class="pl-c1">4</span>,<span class="pl-c1">5</span>],<span class="pl-s">"f"</span>),
            <span class="pl-s1">bounds_error</span><span class="pl-c1">=</span><span class="pl-c1">False</span>,
            <span class="pl-s1">method</span><span class="pl-c1">=</span><span class="pl-s">"linear"</span>,
            <span class="pl-s1">fill_value</span><span class="pl-c1">=</span><span class="pl-c1">None</span>,
        )
<span class="pl-en">print</span>( <span class="pl-en">foo</span>(  (<span class="pl-c1">0</span>,<span class="pl-c1">0</span>)))
<span class="pl-en">print</span>( <span class="pl-en">foo</span>( [ (<span class="pl-c1">0</span>,<span class="pl-c1">0</span>), (<span class="pl-c1">0</span>,<span class="pl-c1">0</span>) ]))
<span class="pl-en">print</span>( <span class="pl-en">foo</span>(<span class="pl-s1">np</span>.<span class="pl-en">zeros</span>([<span class="pl-c1">20</span>,<span class="pl-c1">21</span>,<span class="pl-c1">2</span>],<span class="pl-s">"f"</span>)))</pre></div>
<h3 dir="auto">Error message</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;test.py&quot;, line 12, in &lt;module&gt;
    print( foo(  (0,0)))
  File &quot;/tmp/pippo/lib/python3.8/site-packages/scipy/interpolate/_rgi.py&quot;, line 336, in __call__
    result = evaluate_linear_2d(self.values,
  File &quot;_rgi_cython.pyx&quot;, line 19, in scipy.interpolate._rgi_cython.__pyx_fused_cpdef
TypeError: No matching signature found"><pre class="notranslate">Traceback (most recent call last):
  File <span class="pl-s"><span class="pl-pds">"</span>test.py<span class="pl-pds">"</span></span>, line 12, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    print( foo(  (0,0)))
  File <span class="pl-s"><span class="pl-pds">"</span>/tmp/pippo/lib/python3.8/site-packages/scipy/interpolate/_rgi.py<span class="pl-pds">"</span></span>, line 336, <span class="pl-k">in</span> __call__
    result = evaluate_linear_2d(self.values,
  File <span class="pl-s"><span class="pl-pds">"</span>_rgi_cython.pyx<span class="pl-pds">"</span></span>, line 19, <span class="pl-k">in</span> scipy.interpolate._rgi_cython.__pyx_fused_cpdef
TypeError: No matching signature found</pre></div>
<h3 dir="auto">SciPy/NumPy/Python version information</h3>
<p dir="auto">1.10.0 1.24.1 sys.version_info(major=3, minor=8, micro=10, releaselevel='final', serial=0)</p>
<h3 dir="auto">Describe your issue.</h3>
<p dir="auto">Invoking <code class="notranslate">RegularGridInterpolator</code> for a 2D interpolation problem where the data array is <code class="notranslate">float32</code> crashes.</p>
<h3 dir="auto">Reproducing Code Example</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;&quot;&quot;                                                                                                                                                               
Found our code tickled a bug.  We have a mismatched type, but probably this shouldn't crash...                                                                    
                                                                                                                                                                  
Reproducing code is copied (and reduced to 2d ) from the `scipy` tutorial:                                                                                          
                                                                                                                                                                  
https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.RegularGridInterpolator.html                                                               
&quot;&quot;&quot;

from scipy.interpolate import RegularGridInterpolator
import numpy as np

def f(x, y):
    return 2 * x**3 + 3 * y**2

x = np.linspace(1, 4, 11)
y = np.linspace(4, 7, 22)

xg, yg = np.meshgrid(x, y, indexing='ij', sparse=True)
data = f(xg, yg)

# This line tickles the issue.                                                                                                                                    
data = data.astype(np.float32)                                                                                                                                   

interp = RegularGridInterpolator((x, y), data)

pts = np.array([[2.1, 6.2],
                [3.3, 5.2]])

q = interp(pts)

print(q)  # expect [134.10469388 153.40069388]                                                                                                                    
print(f(*pts[0]), f(*pts[1]))  # 133.842 152.994"><pre class="notranslate"><span class="pl-s">"""                                                                                                                                                               </span>
<span class="pl-s">Found our code tickled a bug.  We have a mismatched type, but probably this shouldn't crash...                                                                    </span>
<span class="pl-s">                                                                                                                                                                  </span>
<span class="pl-s">Reproducing code is copied (and reduced to 2d ) from the `scipy` tutorial:                                                                                          </span>
<span class="pl-s">                                                                                                                                                                  </span>
<span class="pl-s">https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.RegularGridInterpolator.html                                                               </span>
<span class="pl-s">"""</span>

<span class="pl-k">from</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">interpolate</span> <span class="pl-k">import</span> <span class="pl-v">RegularGridInterpolator</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>

<span class="pl-k">def</span> <span class="pl-en">f</span>(<span class="pl-s1">x</span>, <span class="pl-s1">y</span>):
    <span class="pl-k">return</span> <span class="pl-c1">2</span> <span class="pl-c1">*</span> <span class="pl-s1">x</span><span class="pl-c1">**</span><span class="pl-c1">3</span> <span class="pl-c1">+</span> <span class="pl-c1">3</span> <span class="pl-c1">*</span> <span class="pl-s1">y</span><span class="pl-c1">**</span><span class="pl-c1">2</span>

<span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">1</span>, <span class="pl-c1">4</span>, <span class="pl-c1">11</span>)
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">4</span>, <span class="pl-c1">7</span>, <span class="pl-c1">22</span>)

<span class="pl-s1">xg</span>, <span class="pl-s1">yg</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">meshgrid</span>(<span class="pl-s1">x</span>, <span class="pl-s1">y</span>, <span class="pl-s1">indexing</span><span class="pl-c1">=</span><span class="pl-s">'ij'</span>, <span class="pl-s1">sparse</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
<span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-en">f</span>(<span class="pl-s1">xg</span>, <span class="pl-s1">yg</span>)

<span class="pl-c"># This line tickles the issue.                                                                                                                                    </span>
<span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-s1">data</span>.<span class="pl-en">astype</span>(<span class="pl-s1">np</span>.<span class="pl-s1">float32</span>)                                                                                                                                   

<span class="pl-s1">interp</span> <span class="pl-c1">=</span> <span class="pl-v">RegularGridInterpolator</span>((<span class="pl-s1">x</span>, <span class="pl-s1">y</span>), <span class="pl-s1">data</span>)

<span class="pl-s1">pts</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([[<span class="pl-c1">2.1</span>, <span class="pl-c1">6.2</span>],
                [<span class="pl-c1">3.3</span>, <span class="pl-c1">5.2</span>]])

<span class="pl-s1">q</span> <span class="pl-c1">=</span> <span class="pl-en">interp</span>(<span class="pl-s1">pts</span>)

<span class="pl-en">print</span>(<span class="pl-s1">q</span>)  <span class="pl-c"># expect [134.10469388 153.40069388]                                                                                                                    </span>
<span class="pl-en">print</span>(<span class="pl-en">f</span>(<span class="pl-c1">*</span><span class="pl-s1">pts</span>[<span class="pl-c1">0</span>]), <span class="pl-en">f</span>(<span class="pl-c1">*</span><span class="pl-s1">pts</span>[<span class="pl-c1">1</span>]))  <span class="pl-c"># 133.842 152.994</span></pre></div>
<h3 dir="auto">Error message</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# Traceback (most recent call last):                                                                                                                              
#   File &quot;repro_interp_issue.py&quot;, line 22, in &lt;module&gt;                                                                                                            
#     q = interp(pts)                                                                                                                                             
#   File &quot;/Users/gbwright/opt/miniconda3/envs/sp110/lib/python3.8/site-packages/scipy/interpolate/_rgi.py&quot;, line 336, in __call__                                 
#     result = evaluate_linear_2d(self.values,                                                                                                                    
#   File &quot;_rgi_cython.pyx&quot;, line 19, in scipy.interpolate._rgi_cython.__pyx_fused_cpdef                                                                           
# TypeError: No matching signature found"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> Traceback (most recent call last):                                                                                                                              </span>
<span class="pl-c"><span class="pl-c">#</span>   File "repro_interp_issue.py", line 22, in &lt;module&gt;                                                                                                            </span>
<span class="pl-c"><span class="pl-c">#</span>     q = interp(pts)                                                                                                                                             </span>
<span class="pl-c"><span class="pl-c">#</span>   File "/Users/gbwright/opt/miniconda3/envs/sp110/lib/python3.8/site-packages/scipy/interpolate/_rgi.py", line 336, in __call__                                 </span>
<span class="pl-c"><span class="pl-c">#</span>     result = evaluate_linear_2d(self.values,                                                                                                                    </span>
<span class="pl-c"><span class="pl-c">#</span>   File "_rgi_cython.pyx", line 19, in scipy.interpolate._rgi_cython.__pyx_fused_cpdef                                                                           </span>
<span class="pl-c"><span class="pl-c">#</span> TypeError: No matching signature found</span></pre></div>
<h3 dir="auto">SciPy/NumPy/Python version information</h3>
<p dir="auto">1.10.0 1.24.1 sys.version_info(major=3, minor=8, micro=15, releaselevel='final', serial=0)</p>