# Buggy code
def supercell_composite(mucape, effective_storm_helicity, effective_shear):
    r"""Calculate the supercell composite parameter.

    The supercell composite parameter is designed to identify
    environments favorable for the development of supercells,
    and is calculated using the formula developed by
    [Thompson2004]_:

    SCP = (mucape / 1000 J/kg) * (effective_storm_helicity / 50 m^2/s^2) *
          (effective_shear / 20 m/s)

    The effective_shear term is set to zero below 10 m/s and
    capped at 1 when effective_shear exceeds 20 m/s.

    Parameters
    ----------
    mucape : `pint.Quantity`
        Most-unstable CAPE
    effective_storm_helicity : `pint.Quantity`
        Effective-layer storm-relative helicity
    effective_shear : `pint.Quantity`
        Effective bulk shear

    Returns
    -------
    array-like
        supercell composite

    """
    effective_shear = np.clip(effective_shear, None, 20 * units("m/s"))
    effective_shear[effective_shear < 10 * units("m/s")] = 0 * units("m/s")
    effective_shear = effective_shear / (20 * units("m/s"))

    return (
        (mucape / (1000 * units("J/kg")))
        * (effective_storm_helicity / (50 * units("m^2/s^2")))
        * effective_shear
    ).to("dimensionless")


# Traceback (TypeError)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/usr/local/tools/anaconda3/lib/python3.6/site-packages/pint/quantity.py in __setitem__(self, key, value)
1306                                                         '`obj.magnitude[%s] = %s`' % (key, value))
-> 1307                 self._magnitude[key] = factor.magnitude
1308             else:

TypeError: 'numpy.float64' object does not support item assignment

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
<ipython-input-15-13b7a3f081c1> in <module>()
----> 1 mpcalc.significant_tornado(sucape, sblcl, tsh1km, bs6km)

/usr/local/tools/anaconda3/lib/python3.6/site-packages/metpy/calc/indices.py in significant_tornado(sbcape, sblcl, storm_helicity_1km, shear_6km)
283     sblcl = (2000. * units('meter') - sblcl) / (1000. * units('meter'))
284     shear_6km = np.clip(shear_6km, None, 30 * units('m/s'))
--> 285     shear_6km[shear_6km < 12.5 * units('m/s')] = 0 * units('m/s')
286     shear_6km = shear_6km / (20 * units('m/s'))
287

/usr/local/tools/anaconda3/lib/python3.6/site-packages/pint/quantity.py in __setitem__(self, key, value)
1311         except TypeError:
1312             raise TypeError("Neither Quantity object nor its magnitude ({0})"
-> 1313                             "supports indexing".format(self._magnitude))
1314
1315     def tolist(self):

TypeError: Neither Quantity object nor its magnitude (22.927608143881393)supports indexing

# Fixed code
def supercell_composite(mucape, effective_storm_helicity, effective_shear):
    r"""Calculate the supercell composite parameter.

    The supercell composite parameter is designed to identify
    environments favorable for the development of supercells,
    and is calculated using the formula developed by
    [Thompson2004]_:

    .. math::  \text{SCP} = \frac{\text{MUCAPE}}{1000 \text{J/kg}} *
               \frac{\text{Effective SRH}}{50 \text{m}^2/\text{s}^2} *
               \frac{\text{Effective Shear}}{20 \text{m/s}}

    The effective_shear term is set to zero below 10 m/s and
    capped at 1 when effective_shear exceeds 20 m/s.

    Parameters
    ----------
    mucape : `pint.Quantity`
        Most-unstable CAPE
    effective_storm_helicity : `pint.Quantity`
        Effective-layer storm-relative helicity
    effective_shear : `pint.Quantity`
        Effective bulk shear

    Returns
    -------
    array-like
        supercell composite

    """
    effective_shear = np.clip(atleast_1d(effective_shear), None, 20 * units("m/s"))
    effective_shear[effective_shear < 10 * units("m/s")] = 0 * units("m/s")
    effective_shear = effective_shear / (20 * units("m/s"))

    return (
        (mucape / (1000 * units("J/kg")))
        * (effective_storm_helicity / (50 * units("m^2/s^2")))
        * effective_shear
    ).to("dimensionless")