Loading dantro/_copy.py +1 −1 Original line number Diff line number Diff line Loading @@ -24,5 +24,5 @@ def _deepcopy(obj: Any) -> Any: """ try: return _pickle.loads(_pickle.dumps(obj)) except: except Exception: return copy.deepcopy(obj) dantro/_dag_utils.py +3 −3 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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)}!" Loading Loading @@ -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)}!" Loading dantro/dag.py +3 −3 Original line number Diff line number Diff line Loading @@ -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) Loading dantro/groups/graph.py +1 −1 Original line number Diff line number Diff line Loading @@ -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] ) Loading dantro/plot/plot_helper.py +1 −1 Original line number Diff line number Diff line Loading @@ -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(): Loading Loading
dantro/_copy.py +1 −1 Original line number Diff line number Diff line Loading @@ -24,5 +24,5 @@ def _deepcopy(obj: Any) -> Any: """ try: return _pickle.loads(_pickle.dumps(obj)) except: except Exception: return copy.deepcopy(obj)
dantro/_dag_utils.py +3 −3 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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)}!" Loading Loading @@ -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)}!" Loading
dantro/dag.py +3 −3 Original line number Diff line number Diff line Loading @@ -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) Loading
dantro/groups/graph.py +1 −1 Original line number Diff line number Diff line Loading @@ -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] ) Loading
dantro/plot/plot_helper.py +1 −1 Original line number Diff line number Diff line Loading @@ -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(): Loading