peng/wave_functions.py
def _build_units(indep_units, dep_units, op):
    """Build unit math operations."""
    if (not dep_units) and (not indep_units):
        return ""
    if dep_units and (not indep_units):
        return dep_units
    if (not dep_units) and indep_units:
        return (
            remove_extra_delims("1{0}({1})".format(op, indep_units))
            if op == "/"
            else remove_extra_delims("({0})".format(indep_units))
        )
    return remove_extra_delims("({0}){1}({2})".format(dep_units, op, indep_units))
def _build_units(indep_units, dep_units, op):
    """Build unit math operations."""
    if (not dep_units) and (not indep_units):
        return ""
    if dep_units and (not indep_units):
        return dep_units
    if (not dep_units) and indep_units:
        return (
            remove_extra_delims("1{0}({1})".format(op, indep_units))
            if op == "/"
            else remove_extra_delims("({0})".format(indep_units))
        )
    return remove_extra_delims("({0}){1}({2})".format(dep_units, op, indep_units))
Build unit math operations.