<h3 dir="auto">Describe your issue.</h3>
<p dir="auto">"scipy.optimize.shgo" bug in handling multi-dimensional variables.<br>
My obj is a function of a two-dimensional variable. As the error message shows below,  'shgo' seems can't handle (m,) shape variables.<br>
However, even after I have changed "if g(self.x_a, *args) &lt; 0.0:" to  "if any(g(self.x_a, *args) &lt; 0.0):", there is still an error which leads to a failure result with the msg:<br>
'Failed to find a feasible minimizer point. Lowest sampling point = None'</p>
<p dir="auto">My obj and constraint functions work well with other solvers such as  opt.minimize,  opt.differential_evolution.<br>
Besides, if I reduce the dimension of my variable to a scalar, it also works fine.</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="obj=lambda x: ObjL(np.block([ np.ones([PKzM.shape[0],1])*x[0], 
                             np.ones([PKzM.shape[0],1])*x[1],
                             PKzM ]), # shape: (n,3)
                   PCM, VKM, VCM, rM)

...

res = opt.shgo(obj, bounds, constraints=cons, options={'f_tol':1e-3},
                        callback=print_xk)"><pre class="notranslate"><span class="pl-s1">obj</span><span class="pl-c1">=</span><span class="pl-k">lambda</span> <span class="pl-s1">x</span>: <span class="pl-v">ObjL</span>(<span class="pl-s1">np</span>.<span class="pl-en">block</span>([ <span class="pl-s1">np</span>.<span class="pl-en">ones</span>([<span class="pl-v">PKzM</span>.<span class="pl-s1">shape</span>[<span class="pl-c1">0</span>],<span class="pl-c1">1</span>])<span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">0</span>], 
                             <span class="pl-s1">np</span>.<span class="pl-en">ones</span>([<span class="pl-v">PKzM</span>.<span class="pl-s1">shape</span>[<span class="pl-c1">0</span>],<span class="pl-c1">1</span>])<span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">1</span>],
                             <span class="pl-v">PKzM</span> ]), <span class="pl-c"># shape: (n,3)</span>
                   <span class="pl-v">PCM</span>, <span class="pl-v">VKM</span>, <span class="pl-v">VCM</span>, <span class="pl-s1">rM</span>)

...

<span class="pl-s1">res</span> <span class="pl-c1">=</span> <span class="pl-s1">opt</span>.<span class="pl-en">shgo</span>(<span class="pl-s1">obj</span>, <span class="pl-s1">bounds</span>, <span class="pl-s1">constraints</span><span class="pl-c1">=</span><span class="pl-s1">cons</span>, <span class="pl-s1">options</span><span class="pl-c1">=</span>{<span class="pl-s">'f_tol'</span>:<span class="pl-c1">1e-3</span>},
                        <span class="pl-s1">callback</span><span class="pl-c1">=</span><span class="pl-s1">print_xk</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;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py&quot;, line 631, in __getitem__
    return self.cache[x]
KeyError: (0, 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo.py&quot;, line 426, in shgo
    shc.construct_complex()
  File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo.py&quot;, line 751, in construct_complex
    self.iterate()
  File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo.py&quot;, line 894, in iterate
    self.iterate_complex()
  File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo.py&quot;, line 916, in iterate_hypercube
    self.HC = Complex(self.dim, self._raw_func, self.args,
  File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py&quot;, line 25, in __init__
    self.n_cube(dim, symmetry=symmetry)
  File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py&quot;, line 76, in n_cube
    self.C0.add_vertex(self.V[origintuple])
  File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py&quot;, line 635, in __getitem__
    xval = Vertex(x, bounds=self.bounds,
  File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py&quot;, line 552, in __init__
    if g(self.x_a, *args) &lt; 0.0:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()"><pre class="notranslate">Traceback (most recent call last):
  File <span class="pl-s"><span class="pl-pds">"</span>C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py<span class="pl-pds">"</span></span>, line 631, <span class="pl-k">in</span> __getitem__
    <span class="pl-k">return</span> self.cache[x]
KeyError: (0, 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File <span class="pl-s"><span class="pl-pds">"</span>&lt;string&gt;<span class="pl-pds">"</span></span>, line 1, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
  File <span class="pl-s"><span class="pl-pds">"</span>C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo.py<span class="pl-pds">"</span></span>, line 426, <span class="pl-k">in</span> shgo
    <span class="pl-en">shc.construct_complex</span>()
  File <span class="pl-s"><span class="pl-pds">"</span>C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo.py<span class="pl-pds">"</span></span>, line 751, <span class="pl-k">in</span> construct_complex
    <span class="pl-en">self.iterate</span>()
  File <span class="pl-s"><span class="pl-pds">"</span>C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo.py<span class="pl-pds">"</span></span>, line 894, <span class="pl-k">in</span> iterate
    <span class="pl-en">self.iterate_complex</span>()
  File <span class="pl-s"><span class="pl-pds">"</span>C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo.py<span class="pl-pds">"</span></span>, line 916, <span class="pl-k">in</span> iterate_hypercube
    self.HC = Complex(self.dim, self._raw_func, self.args,
  File <span class="pl-s"><span class="pl-pds">"</span>C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py<span class="pl-pds">"</span></span>, line 25, <span class="pl-k">in</span> __init__
    self.n_cube(dim, symmetry=symmetry)
  File <span class="pl-s"><span class="pl-pds">"</span>C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py<span class="pl-pds">"</span></span>, line 76, <span class="pl-k">in</span> n_cube
    self.C0.add_vertex(self.V[origintuple])
  File <span class="pl-s"><span class="pl-pds">"</span>C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py<span class="pl-pds">"</span></span>, line 635, <span class="pl-k">in</span> __getitem__
    xval = Vertex(x, bounds=self.bounds,
  File <span class="pl-s"><span class="pl-pds">"</span>C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py<span class="pl-pds">"</span></span>, line 552, <span class="pl-k">in</span> __init__
    <span class="pl-k">if</span> g(self.x_a, <span class="pl-k">*</span>args) <span class="pl-k">&lt;</span> 0.0:
ValueError: The truth value of an array with more than one element is ambiguous. Use <span class="pl-en">a.any</span>() or <span class="pl-en">a.all</span>()</pre></div>
<h3 dir="auto">SciPy/NumPy/Python version and system information</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="scipy version: '1.10.0'"><pre class="notranslate">scipy version: <span class="pl-s"><span class="pl-pds">'</span>1.10.0<span class="pl-pds">'</span></span></pre></div>
<p dir="auto">The <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.shgo.html" rel="nofollow">documentation </a> seems to impy that constraints can be vector function. However, when I tried to modify the basic example given there to work with one inequaity constraint that returns a 2-dimensional vector instead of two scalar constraints, I got an error.</p>
<p dir="auto">Here is my code:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="def f(x):  # (cattle-feed)
    return 24.55*x[0] + 26.75*x[1] + 39*x[2] + 40.50*x[3]

def g1(x):
    return 2.3*x[0] + 5.6*x[1] + 11.1*x[2] + 1.3*x[3] - 5  # &gt;=0

def g2(x):
    return (12*x[0] + 11.9*x[1] +41.8*x[2] + 52.1*x[3] - 21
            - 1.645 * np.sqrt(0.28*x[0]**2 + 0.19*x[1]**2
                            + 20.5*x[2]**2 + 0.62*x[3]**2)
            ) # &gt;=0

def h1(x):
    return x[0] + x[1] + x[2] + x[3] - 1  # == 0

cons = ({'type': 'ineq', 'fun': g1},
        {'type': 'ineq', 'fun': g2},
        {'type': 'eq', 'fun': h1})
bounds = [(0, 1.0),]*4
res = shgo(f, bounds, iters=3, constraints=cons)

def double_g_fun(x):
    return np.array([g1(x), g2(x)])

new_cons = ({'type': 'ineq', 'fun':double_g_fun},
           {'type': 'eq', 'fun': h1})

new_res = shgo(f, bounds, iters=3, constraints=new_cons)`"><pre class="notranslate"><span class="pl-k">def</span> <span class="pl-en">f</span>(<span class="pl-s1">x</span>):  <span class="pl-c"># (cattle-feed)</span>
    <span class="pl-k">return</span> <span class="pl-c1">24.55</span><span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">0</span>] <span class="pl-c1">+</span> <span class="pl-c1">26.75</span><span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">1</span>] <span class="pl-c1">+</span> <span class="pl-c1">39</span><span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">2</span>] <span class="pl-c1">+</span> <span class="pl-c1">40.50</span><span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">3</span>]

<span class="pl-k">def</span> <span class="pl-en">g1</span>(<span class="pl-s1">x</span>):
    <span class="pl-k">return</span> <span class="pl-c1">2.3</span><span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">0</span>] <span class="pl-c1">+</span> <span class="pl-c1">5.6</span><span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">1</span>] <span class="pl-c1">+</span> <span class="pl-c1">11.1</span><span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">2</span>] <span class="pl-c1">+</span> <span class="pl-c1">1.3</span><span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">3</span>] <span class="pl-c1">-</span> <span class="pl-c1">5</span>  <span class="pl-c"># &gt;=0</span>

<span class="pl-k">def</span> <span class="pl-en">g2</span>(<span class="pl-s1">x</span>):
    <span class="pl-k">return</span> (<span class="pl-c1">12</span><span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">0</span>] <span class="pl-c1">+</span> <span class="pl-c1">11.9</span><span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">1</span>] <span class="pl-c1">+</span><span class="pl-c1">41.8</span><span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">2</span>] <span class="pl-c1">+</span> <span class="pl-c1">52.1</span><span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">3</span>] <span class="pl-c1">-</span> <span class="pl-c1">21</span>
            <span class="pl-c1">-</span> <span class="pl-c1">1.645</span> <span class="pl-c1">*</span> <span class="pl-s1">np</span>.<span class="pl-en">sqrt</span>(<span class="pl-c1">0.28</span><span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">0</span>]<span class="pl-c1">**</span><span class="pl-c1">2</span> <span class="pl-c1">+</span> <span class="pl-c1">0.19</span><span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">1</span>]<span class="pl-c1">**</span><span class="pl-c1">2</span>
                            <span class="pl-c1">+</span> <span class="pl-c1">20.5</span><span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">2</span>]<span class="pl-c1">**</span><span class="pl-c1">2</span> <span class="pl-c1">+</span> <span class="pl-c1">0.62</span><span class="pl-c1">*</span><span class="pl-s1">x</span>[<span class="pl-c1">3</span>]<span class="pl-c1">**</span><span class="pl-c1">2</span>)
            ) <span class="pl-c"># &gt;=0</span>

<span class="pl-k">def</span> <span class="pl-en">h1</span>(<span class="pl-s1">x</span>):
    <span class="pl-k">return</span> <span class="pl-s1">x</span>[<span class="pl-c1">0</span>] <span class="pl-c1">+</span> <span class="pl-s1">x</span>[<span class="pl-c1">1</span>] <span class="pl-c1">+</span> <span class="pl-s1">x</span>[<span class="pl-c1">2</span>] <span class="pl-c1">+</span> <span class="pl-s1">x</span>[<span class="pl-c1">3</span>] <span class="pl-c1">-</span> <span class="pl-c1">1</span>  <span class="pl-c"># == 0</span>

<span class="pl-s1">cons</span> <span class="pl-c1">=</span> ({<span class="pl-s">'type'</span>: <span class="pl-s">'ineq'</span>, <span class="pl-s">'fun'</span>: <span class="pl-s1">g1</span>},
        {<span class="pl-s">'type'</span>: <span class="pl-s">'ineq'</span>, <span class="pl-s">'fun'</span>: <span class="pl-s1">g2</span>},
        {<span class="pl-s">'type'</span>: <span class="pl-s">'eq'</span>, <span class="pl-s">'fun'</span>: <span class="pl-s1">h1</span>})
<span class="pl-s1">bounds</span> <span class="pl-c1">=</span> [(<span class="pl-c1">0</span>, <span class="pl-c1">1.0</span>),]<span class="pl-c1">*</span><span class="pl-c1">4</span>
<span class="pl-s1">res</span> <span class="pl-c1">=</span> <span class="pl-en">shgo</span>(<span class="pl-s1">f</span>, <span class="pl-s1">bounds</span>, <span class="pl-s1">iters</span><span class="pl-c1">=</span><span class="pl-c1">3</span>, <span class="pl-s1">constraints</span><span class="pl-c1">=</span><span class="pl-s1">cons</span>)

<span class="pl-k">def</span> <span class="pl-en">double_g_fun</span>(<span class="pl-s1">x</span>):
    <span class="pl-k">return</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-en">g1</span>(<span class="pl-s1">x</span>), <span class="pl-en">g2</span>(<span class="pl-s1">x</span>)])

<span class="pl-s1">new_cons</span> <span class="pl-c1">=</span> ({<span class="pl-s">'type'</span>: <span class="pl-s">'ineq'</span>, <span class="pl-s">'fun'</span>:<span class="pl-s1">double_g_fun</span>},
           {<span class="pl-s">'type'</span>: <span class="pl-s">'eq'</span>, <span class="pl-s">'fun'</span>: <span class="pl-s1">h1</span>})

<span class="pl-s1">new_res</span> <span class="pl-c1">=</span> <span class="pl-en">shgo</span>(<span class="pl-s1">f</span>, <span class="pl-s1">bounds</span>, <span class="pl-s1">iters</span><span class="pl-c1">=</span><span class="pl-c1">3</span>, <span class="pl-s1">constraints</span><span class="pl-c1">=</span><span class="pl-s1">new_cons</span>)`</pre></div>
<p dir="auto">And here is the error message:</p>
<div class="highlight highlight-text-python-traceback notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="KeyError                                  Traceback (most recent call last)
~\anaconda3\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py in __getitem__(self, x, indexed)
    629         try:
--&gt; 630             return self.cache[x]
    631         except KeyError:

KeyError: (0, 0, 0, 0)

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_16320/2455765945.py in &lt;module&gt;
      9 #         {'type': 'eq', 'fun': h1})
     10 # bounds = [(0, 1.0),]*4
---&gt; 11 new_res = shgo(f, bounds, iters=3, constraints=new_cons)

~\anaconda3\lib\site-packages\scipy\optimize\_shgo.py in shgo(func, bounds, args, constraints, n, iters, callback, minimizer_kwargs, options, sampling_method)
    417 
    418     # Run the algorithm, process results and test success
--&gt; 419     shc.construct_complex()
    420 
    421     if not shc.break_routine:

~\anaconda3\lib\site-packages\scipy\optimize\_shgo.py in construct_complex(self)
    731                 break
    732             # Iterate complex, process minimisers
--&gt; 733             self.iterate()
    734             self.stopping_criteria()
    735 

~\anaconda3\lib\site-packages\scipy\optimize\_shgo.py in iterate(self)
    874 
    875     def iterate(self):
--&gt; 876         self.iterate_complex()
    877 
    878         # Build minimizer pool

~\anaconda3\lib\site-packages\scipy\optimize\_shgo.py in iterate_hypercube(self)
    893         if self.n_sampled == 0:
    894             # Initial triangulation of the hyper-rectangle
--&gt; 895             self.HC = Complex(self.dim, self.func, self.args,
    896                               self.symmetry, self.bounds, self.g_cons,
    897                               self.g_args)

~\anaconda3\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py in __init__(self, dim, func, func_args, symmetry, bounds, g_cons, g_args)
     23 
     24         # Generate n-cube here:
---&gt; 25         self.n_cube(dim, symmetry=symmetry)
     26 
     27         # TODO: Assign functions to a the complex instead

~\anaconda3\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py in n_cube(self, dim, symmetry, printout)
     74         else:
     75             self.C0 = Cell(0, 0, origin, supremum)  # Initial cell object
---&gt; 76             self.C0.add_vertex(self.V[origintuple])
     77             self.C0.add_vertex(self.V[supremumtuple])
     78 

~\anaconda3\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py in __getitem__(self, x, indexed)
    632             if indexed:
    633                 self.index += 1
--&gt; 634                 xval = Vertex(x, bounds=self.bounds,
    635                               func=self.func, func_args=self.func_args,
    636                               g_cons=self.g_cons,

~\anaconda3\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py in __init__(self, x, bounds, func, func_args, g_cons, g_cons_args, nn, index)
    550             if g_cons is not None:
    551                 for g, args in zip(g_cons, g_cons_args):
--&gt; 552                     if g(self.x_a, *args) &lt; 0.0:
    553                         self.f = np.inf
    554                         self.feasible = False

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()"><pre class="notranslate">KeyError                                  Traceback (most recent call last)
~\anaconda3\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py in __getitem__(self, x, indexed)
    <span class="pl-c1">629</span>         <span class="pl-k">try</span>:
--&gt; 630             return self.cache[x]
    <span class="pl-c1">631</span>         <span class="pl-k">except</span> <span class="pl-c1">KeyError</span>:

<span class="pl-en">KeyError</span>: <span class="pl-s">(0, 0, 0, 0)</span>

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_16320/2455765945.py in &lt;module&gt;
      <span class="pl-c1">9</span> <span class="pl-c"><span class="pl-c">#</span>         {'type': 'eq', 'fun': h1})</span>
     <span class="pl-c1">10</span> <span class="pl-c"><span class="pl-c">#</span> bounds = [(0, 1.0),]*4</span>
---&gt; 11 new_res = shgo(f, bounds, iters=3, constraints=new_cons)

~\anaconda3\lib\site-packages\scipy\optimize\_shgo.py in shgo(func, bounds, args, constraints, n, iters, callback, minimizer_kwargs, options, sampling_method)
    <span class="pl-c1">417</span> 
    <span class="pl-c1">418</span>     <span class="pl-c"><span class="pl-c">#</span> Run the algorithm, process results and test success</span>
--&gt; 419     shc.construct_complex()
    <span class="pl-c1">420</span> 
    <span class="pl-c1">421</span>     <span class="pl-k">if</span> <span class="pl-k">not</span> shc.break_routine:

~\anaconda3\lib\site-packages\scipy\optimize\_shgo.py in construct_complex(self)
    <span class="pl-c1">731</span>                 <span class="pl-k">break</span>
    <span class="pl-c1">732</span>             <span class="pl-c"><span class="pl-c">#</span> Iterate complex, process minimisers</span>
--&gt; 733             self.iterate()
    <span class="pl-c1">734</span>             <span class="pl-c1">self</span>.stopping_criteria()
    <span class="pl-c1">735</span> 

~\anaconda3\lib\site-packages\scipy\optimize\_shgo.py in iterate(self)
    <span class="pl-c1">874</span> 
    <span class="pl-c1">875</span>     <span class="pl-k">def</span> <span class="pl-en">iterate</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):
--&gt; 876         self.iterate_complex()
    <span class="pl-c1">877</span> 
    <span class="pl-c1">878</span>         <span class="pl-c"><span class="pl-c">#</span> Build minimizer pool</span>

~\anaconda3\lib\site-packages\scipy\optimize\_shgo.py in iterate_hypercube(self)
    <span class="pl-c1">893</span>         <span class="pl-k">if</span> <span class="pl-c1">self</span>.n_sampled <span class="pl-k">==</span> <span class="pl-c1">0</span>:
    <span class="pl-c1">894</span>             <span class="pl-c"><span class="pl-c">#</span> Initial triangulation of the hyper-rectangle</span>
--&gt; 895             self.HC = Complex(self.dim, self.func, self.args,
    <span class="pl-c1">896</span>                               <span class="pl-c1">self</span>.symmetry, <span class="pl-c1">self</span>.bounds, <span class="pl-c1">self</span>.g_cons,
    <span class="pl-c1">897</span>                               <span class="pl-c1">self</span>.g_args)

~\anaconda3\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py in __init__(self, dim, func, func_args, symmetry, bounds, g_cons, g_args)
     <span class="pl-c1">23</span> 
     <span class="pl-c1">24</span>         <span class="pl-c"><span class="pl-c">#</span> Generate n-cube here:</span>
---&gt; 25         self.n_cube(dim, symmetry=symmetry)
     <span class="pl-c1">26</span> 
     <span class="pl-c1">27</span>         <span class="pl-c"><span class="pl-c">#</span> <span class="pl-k">TODO</span>: Assign functions to a the complex instead</span>

~\anaconda3\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py in n_cube(self, dim, symmetry, printout)
     <span class="pl-c1">74</span>         <span class="pl-k">else</span>:
     <span class="pl-c1">75</span>             <span class="pl-c1">self</span>.C0 <span class="pl-k">=</span> Cell(<span class="pl-c1">0</span>, <span class="pl-c1">0</span>, origin, supremum)  <span class="pl-c"><span class="pl-c">#</span> Initial cell object</span>
---&gt; 76             self.C0.add_vertex(self.V[origintuple])
     <span class="pl-c1">77</span>             <span class="pl-c1">self</span>.C0.add_vertex(<span class="pl-c1">self</span>.V[supremumtuple])
     <span class="pl-c1">78</span> 

~\anaconda3\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py in __getitem__(self, x, indexed)
    <span class="pl-c1">632</span>             <span class="pl-k">if</span> indexed:
    <span class="pl-c1">633</span>                 <span class="pl-c1">self</span>.index <span class="pl-k">+=</span> <span class="pl-c1">1</span>
--&gt; 634                 xval = Vertex(x, bounds=self.bounds,
    <span class="pl-c1">635</span>                               func<span class="pl-k">=</span><span class="pl-c1">self</span>.func, func_args<span class="pl-k">=</span><span class="pl-c1">self</span>.func_args,
    <span class="pl-c1">636</span>                               g_cons<span class="pl-k">=</span><span class="pl-c1">self</span>.g_cons,

~\anaconda3\lib\site-packages\scipy\optimize\_shgo_lib\triangulation.py in __init__(self, x, bounds, func, func_args, g_cons, g_cons_args, nn, index)
    <span class="pl-c1">550</span>             <span class="pl-k">if</span> g_cons <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span>:
    <span class="pl-c1">551</span>                 <span class="pl-k">for</span> g, args <span class="pl-k">in</span> <span class="pl-c1">zip</span>(g_cons, g_cons_args):
--&gt; 552                     if g(self.x_a, *args) &lt; 0.0:
    <span class="pl-c1">553</span>                         <span class="pl-c1">self</span>.f <span class="pl-k">=</span> np.inf
    <span class="pl-c1">554</span>                         <span class="pl-c1">self</span>.feasible <span class="pl-k">=</span> <span class="pl-c1">False</span>

<span class="pl-en">ValueError</span>: <span class="pl-s">The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()</span></pre></div>