ankostis / wltp

if statements can be merged PTC-W0048
Anti-pattern
Major
2 years ago2 years old
Consider merging collapsible if statements
118
119    ## Accept 2-columns if column-names were unamed.
120    #
121    elif wot.shape[1] == 2:122        if tuple(wot.columns) == (0, 1):
123            wot.columns = [w.n, w.p]
124            log.warning("Assuming the 2-column WOT to be: %s, %s", *wot.columns)
Consider merging collapsible if statements
576            # if not additional_properties and not set(cols) <= set(['v','slide']):
577            #     yield ValidationError('Unexpected columns!')
578
579            if forced_cycle.shape[1] == 1:580                if cols[0] == 1:
581                    log.warning(
582                        "Assuming the unamed single-column to be the velocity_profile(%s).",
Consider merging collapsible if statements
395                    <decors>    (dict)
396    """
397    for dmn in astuple(domain, "domain"):
398        if hasattr(fn, "_autograph"):399            if dmn in fn._autograph:
400                return fn._autograph[dmn]
401    return default