'Scipy.optimize Inequality Constraint - Which side of the inequality is considered?

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?

...

def constraint1(x):
    return x[0]+x[1]+x[2]+x[3]-1

....

con1 = {'type': 'ineq', 'fun': constraint1}

link to full solution I'm using in my example: http://apmonitor.com/che263/index.php/Main/PythonOptimization



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source