Scipy.optimize Inequality Constraint - Which side of the inequality is considered? : <p>I am using the scipy.optimize module to find optimal input weights that would minimize my output. From the examples I've seen, we define the constraint with a one-sided equation; then we create a variable that's of the type 'inequality'. My question is how does the optimization package know whether the sum of the variables in my constraint need to be smaller than 1 or larger than 1?</p>

<p>...</p>

<pre><code>def constraint1(x):
    return x[0]+x[1]+x[2]+x[3]-1
</code></pre>

<p>....</p>

<pre><code>con1 = {'type': 'ineq', 'fun': constraint1}
</code></pre>

<p>link to full solution I'm using in my example:
<a href="http://apmonitor.com/che263/index.php/Main/PythonOptimization" rel="noreferrer">http://apmonitor.com/che263/index.php/Main/PythonOptimization</a></p>

<p>Thank you.</p>
