title: AttributeError: 'str' object has no attribute 'equals'
body: <p>I keep getting this error and was wondering what was triggering it. This is my function definition:</p>
  
  <pre><code>def spectMixGen(M, samp_size, source_pdf = "uniform", pdf_pars = 1,
      pure_pixels = 'no', max_purity = np.ones((1, p)), 
      no_outliers = 0, violation_extremes = [1, 1.2],
      am_modulation = [1, 1], sig_variability = [1, 1],              
      snr = 40, noise_shape = 'uniform',
      noise_pars = [0, 1, 1])
  </code></pre>
  
  <p>and this is my function call:</p>
  
  <pre><code>spectMixGen(M, N, source_pdf = 'Diri_id', pdf_pars = SHAPE_PARAMETER, 
      max_purity = MAX_PURIRY*np.ones((1,p)), no_outliers = OUTLIERS, 
      violation_extremes = [1,1.2], snr = SNR, noise_shape = 'uniform')
  </code></pre>
  
  <p>The error points to this part of my code: </p>
  
  <pre><code>if (source_pdf == "Diri_mix"):
      no_modes, cols = pdf_pars.shape
      if cols is not (p+1):
          raise ValueError("Wrong pdf parameters")
      elif (np.sum(pdf_pars[:,1] != 1)) or (np.sum(pdf_pars[:,1] &lt; 0) &gt; 0):
          raise ValueError("Wrong pdf parameters -&gt; mixing weights  do not define a probability")
  </code></pre>
  
  <p>with the message: </p>
  
  <pre><code>AttributeError: 'str' object has no attribute 'equals'
  </code></pre>
  
  <p>Can anyone explain this error? I though that the function call sets the variable source_pdf equal to a string. Is this not the case?</p>
  
  <p>Thanks </p>