Verified Commit 179c4ecd authored by Yunus Sevinchan's avatar Yunus Sevinchan
Browse files

Address remaining linter warnings: bare excepts, unused names

parent 63b0b814
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -24,5 +24,5 @@ def _deepcopy(obj: Any) -> Any:
    """
    try:
        return _pickle.loads(_pickle.dumps(obj))
    except:
    except Exception:
        return copy.deepcopy(obj)
+3 −3
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ class Placeholder:
        equal; specifically, this makes instances of subclasses always unequal
        to instances of this base class.
        """
        if type(other) == type(self):
        if type(other) is type(self):
            return self._data == other._data
        return False

@@ -290,7 +290,7 @@ class PositionalArgument(PlaceholderWithFallback):
            # Need an integer conversion to accept YAML string dumps
            try:
                pos = int(pos)
            except:
            except Exception:
                raise TypeError(
                    "PositionalArgument requires an int-convertible argument, "
                    f"got {type(pos)} with value {repr(pos)}!"
@@ -523,7 +523,7 @@ class DAGNode(DAGReference):
            # Need an integer conversion to accept YAML string dumps
            try:
                idx = int(idx)
            except:
            except Exception:
                raise TypeError(
                    "DAGNode requires an int-convertible argument, got "
                    f"{type(idx)} with value {repr(idx)}!"
+3 −3
Original line number Diff line number Diff line
@@ -1485,9 +1485,9 @@ class TransformationDAG:
        is_normal_tag = lambda obj: (
            isinstance(obj, DAGTag) and obj.name not in self.SPECIAL_TAGS
        )
        is_special_tag = lambda obj: (
            isinstance(obj, DAGTag) and obj.name in self.SPECIAL_TAGS
        )
        # is_special_tag = lambda obj: (
        #     isinstance(obj, DAGTag) and obj.name in self.SPECIAL_TAGS
        # )
        is_arg = lambda obj: isinstance(obj, _Arg)
        is_kwarg = lambda obj: isinstance(obj, _Kwarg)

+1 −1
Original line number Diff line number Diff line
@@ -329,7 +329,7 @@ class GraphGroup(BaseDataGroup):
        if not any([isinstance(data, t) for t in self._ALLOWED_CONT_TYPES]):
            try:
                data = XrDataContainer(name=name, data=data)
            except:
            except Exception:
                _allowed_types = ", ".join(
                    [str(t) for t in self._ALLOWED_CONT_TYPES]
                )
+1 −1
Original line number Diff line number Diff line
@@ -1233,7 +1233,7 @@ class PlotHelper:
        # Go over all possible coordinates
        for ax_coords in self.coords_iter(match="all"):
            # Store a copy of the base configuration for these coordinates
            cfg[ax_coords] = copy.deepcopy(self._base_cfg)
            cfg[ax_coords] = copy.deepcopy(base_cfg)

            # Go over the list of updates and apply them
            for ax_key, update_params in self._axis_specific_updates.items():