title: scipy constrain non-x0 argument
body: <p>Let's say I have the following function:</p>
  
  <pre><code>import scipy
  def fitness(w, assets, rf=0., dt='2016-12-30'):
      mu = float(ptf_mean(assets,w,dt))
      sigma  = float(ptf_var(assets,w,dt)) 
  
      sigma_sum = sigma.sum()
  
      util = -(mu - rf) / (sigma)   
      return util 
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>b_ = [(0.,1.) for i in range(2)]
  c_ = ({'type':'eq', 'fun': lambda w: sum(w)-1. }) 
  optimized = scipy.optimize.minimize(fitness, np.matrix([1.,0.]), (assets, rf, dt), 
              method='SLSQP', constraints=c_,bounds=b_) 
  </code></pre>
  
  <p>Now, let's say I want to constrain on <code>sigma_sum</code>. How could I go about doing that? All constraint examples I have seen in the docs only vary <code>x0</code> or <code>w</code> in my example.</p>
  
  <p>I am leaving out defining <code>assets</code>, <code>rf</code> and <code>dt</code> as thye are not really related to the problem, but assume the code compilsed.</p>
  
  <p>Thank you!</p>