@@ -53,7 +53,7 @@ def _handle_mapping_joint_attr(
5353 }
5454 return xy , xy_callback , xy_callback_kwargs # type: ignore[return-value]
5555
56- if joint_attr .get ("tag" , None ) == "cost_matrix" and (len (joint_attr ) == 2 or joint_attr .get ("attr" ) == "obsp" ):
56+ if joint_attr .get ("tag" ) == "cost_matrix" and (len (joint_attr ) == 2 or joint_attr .get ("attr" ) == "obsp" ):
5757 joint_attr .setdefault ("cost" , "custom" )
5858 joint_attr .setdefault ("attr" , "obsp" )
5959 xy_callback = "cost-matrix"
@@ -100,9 +100,9 @@ def handle_cost(
100100 "y" : (y or y_callback ) and "cost" not in y ,
101101 }
102102 if isinstance (cost , Mapping ):
103- cost_candidates = {k : cost [k ] for k , v in cost_candidates .items () if v } # type:ignore[index,misc]
103+ cost_candidates = {k : cost [k ] for k , v in cost_candidates .items () if v } # type: ignore[index,misc]
104104 elif isinstance (cost , str ):
105- cost_candidates = {k : cost for k , v in cost_candidates .items () if v } # type:ignore[misc]
105+ cost_candidates = {k : cost for k , v in cost_candidates .items () if v } # type: ignore[misc]
106106 else :
107107 raise TypeError (f"Expected `cost` to be either `str` or `dict`, found `{ type (cost )} `." )
108108
@@ -120,9 +120,9 @@ def handle_cost(
120120 for k , v in items :
121121 xy [f"x_{ k } " ] = xy [f"y_{ k } " ] = v
122122 if "x" in cost_candidates :
123- x .update (cost_kwargs .get ("x" , cost_kwargs )) # type:ignore[call-overload]
123+ x .update (cost_kwargs .get ("x" , cost_kwargs )) # type: ignore[call-overload]
124124 if "y" in cost_candidates :
125- y .update (cost_kwargs .get ("y" , cost_kwargs )) # type:ignore[call-overload]
125+ y .update (cost_kwargs .get ("y" , cost_kwargs )) # type: ignore[call-overload]
126126 return xy , x , y
127127
128128
@@ -199,5 +199,5 @@ def handle_cost_tmp(
199199 for k , v in items :
200200 xy [f"xy_{ k } " ] = xy [f"xy_{ k } " ] = v
201201 if xx and cost_kwargs : # extract cost_kwargs explicit to x-term if possible
202- xx .update (cost_kwargs .get ("xx" , cost_kwargs )) # type:ignore[call-overload]
202+ xx .update (cost_kwargs .get ("xx" , cost_kwargs )) # type: ignore[call-overload]
203203 return xy , xx
0 commit comments