Skip to content

Commit

Permalink
Added numpy and linted with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
cvanelteren committed Sep 26, 2023
1 parent 813a55f commit d169a5d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion networkx/drawing/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -1249,8 +1249,10 @@ def arc_layout(G: nx.Graph, subset_key="layer", radius=1, rotation=0) -> dict:
>>> G = nx.multipartite_graph(*subset_sizes)
>>> pos = nx.arf_layout(G, subset_key = "layer")
"""
import numpy as np

attrs = nx.get_node_attributes(G, subset_key)
categories = {v for v in attrs.values()}
categories = set(attrs.values())
angles = np.linspace(0, 2 * np.pi, len(categories), 0) + rotation
pos = {}
for category, angle in zip(categories, angles):
Expand Down

0 comments on commit d169a5d

Please sign in to comment.