if
statements can be merged PTC-W0048118
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)
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).",
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
Nested if
statements can be collapsed into a single if
statement by separating their condition using and
operator.
Merging collapsible if
statements increases the code's readability.
if condition1:
if condition2:
dosomething()
if condition1 and condition2:
dosomething()
DeepSource will not raise this issue when the nested if
statements have comments in between them, as it could be explaining why the nested if
is in place.