@@ -42,7 +42,7 @@ def _detect_graph_type(graph: Any) -> str:
4242 @staticmethod
4343 def _extract_nodes (
4444 graph : Any ,
45- positions : dict [Any , tuple [ float , float ] ],
45+ positions : dict [Any , Any ],
4646 node_color : str | Callable | None = None ,
4747 node_label : str | Callable | None = None ,
4848 ) -> list [Node ]:
@@ -250,7 +250,7 @@ def _expand_multigraph_edges(
250250 return edges
251251
252252 @staticmethod
253- def _get_existing_positions (graph : Any ) -> dict [Any , tuple [ float , float ] ] | None :
253+ def _get_existing_positions (graph : Any ) -> dict [Any , Any ] | None :
254254 """Extract existing 'pos' attribute from nodes.
255255
256256 Args:
@@ -271,7 +271,7 @@ def _get_existing_positions(graph: Any) -> dict[Any, tuple[float, float]] | None
271271 return positions if has_positions else None
272272
273273 @staticmethod
274- def _apply_spring_layout (graph : Any ) -> dict [Any , tuple [ float , float ] ]:
274+ def _apply_spring_layout (graph : Any ) -> dict [Any , Any ]:
275275 """Apply spring (force-directed) layout.
276276
277277 Args:
@@ -283,7 +283,7 @@ def _apply_spring_layout(graph: Any) -> dict[Any, tuple[float, float]]:
283283 return nx .spring_layout (graph )
284284
285285 @staticmethod
286- def _apply_kamada_kawai_layout (graph : Any ) -> dict [Any , tuple [ float , float ] ]:
286+ def _apply_kamada_kawai_layout (graph : Any ) -> dict [Any , Any ]:
287287 """Apply Kamada-Kawai layout.
288288
289289 Args:
@@ -296,7 +296,7 @@ def _apply_kamada_kawai_layout(graph: Any) -> dict[Any, tuple[float, float]]:
296296 ImportError: If scipy is not installed
297297 """
298298 try :
299- import scipy # noqa: F401
299+ import scipy # type: ignore[import-not-found] # noqa: F401
300300 except ImportError :
301301 raise ImportError (
302302 "Layout 'kamada_kawai' requires scipy. "
@@ -306,7 +306,7 @@ def _apply_kamada_kawai_layout(graph: Any) -> dict[Any, tuple[float, float]]:
306306 return nx .kamada_kawai_layout (graph )
307307
308308 @staticmethod
309- def _apply_spectral_layout (graph : Any ) -> dict [Any , tuple [ float , float ] ]:
309+ def _apply_spectral_layout (graph : Any ) -> dict [Any , Any ]:
310310 """Apply spectral layout.
311311
312312 Args:
@@ -319,7 +319,7 @@ def _apply_spectral_layout(graph: Any) -> dict[Any, tuple[float, float]]:
319319 ImportError: If scipy is not installed
320320 """
321321 try :
322- import scipy # noqa: F401
322+ import scipy # type: ignore[import-not-found] # noqa: F401
323323 except ImportError :
324324 raise ImportError (
325325 "Layout 'spectral' requires scipy. "
@@ -329,7 +329,7 @@ def _apply_spectral_layout(graph: Any) -> dict[Any, tuple[float, float]]:
329329 return nx .spectral_layout (graph )
330330
331331 @staticmethod
332- def _apply_circular_layout (graph : Any ) -> dict [Any , tuple [ float , float ] ]:
332+ def _apply_circular_layout (graph : Any ) -> dict [Any , Any ]:
333333 """Apply circular layout.
334334
335335 Args:
@@ -341,7 +341,7 @@ def _apply_circular_layout(graph: Any) -> dict[Any, tuple[float, float]]:
341341 return nx .circular_layout (graph )
342342
343343 @staticmethod
344- def _apply_random_layout (graph : Any ) -> dict [Any , tuple [ float , float ] ]:
344+ def _apply_random_layout (graph : Any ) -> dict [Any , Any ]:
345345 """Apply random layout.
346346
347347 Args:
@@ -353,7 +353,7 @@ def _apply_random_layout(graph: Any) -> dict[Any, tuple[float, float]]:
353353 return nx .random_layout (graph )
354354
355355 @staticmethod
356- def _apply_custom_layout (graph : Any , layout_func : Callable ) -> dict [Any , tuple [ float , float ] ]:
356+ def _apply_custom_layout (graph : Any , layout_func : Callable ) -> dict [Any , Any ]:
357357 """Apply custom layout function.
358358
359359 Args:
@@ -366,7 +366,7 @@ def _apply_custom_layout(graph: Any, layout_func: Callable) -> dict[Any, tuple[f
366366 return layout_func (graph )
367367
368368 @staticmethod
369- def _validate_positions (positions : dict [Any , tuple [ float , float ] ]) -> bool :
369+ def _validate_positions (positions : dict [Any , Any ]) -> bool :
370370 """Validate that positions don't contain NaN or inf values.
371371
372372 Args:
@@ -386,7 +386,7 @@ def _validate_positions(positions: dict[Any, tuple[float, float]]) -> bool:
386386 def _compute_layout (
387387 graph : Any ,
388388 layout : str | Callable | None = None
389- ) -> dict [Any , tuple [ float , float ] ]:
389+ ) -> dict [Any , Any ]:
390390 """Compute node positions using specified layout algorithm.
391391
392392 Args:
0 commit comments