11package edg_ide .edgir_graph
22
3+ import edg .EdgirUtils .SimpleLibraryPath
34import edgir .elem .elem
45import edgir .ref .ref .LibraryPath
56import edg .wir .DesignPath
@@ -8,7 +9,7 @@ import edg_ide.edgir_graph.EdgirGraph.EdgirEdge
89/** Removes links (as edges - must run AFTER collapse - prevents weird interactions with bridge removal) that are
910 * "high-fanout", based on the link type allowlist and parameterized number of sink connections.
1011 */
11- class RemoveHighFanoutEdgeTransform (minConnects : Int , allowedLinkTypes : Set [LibraryPath ]) {
12+ class RemoveHighFanoutEdgeTransform (minConnects : Int , allowedLinkTypeSimple : Set [String ]) {
1213 def apply (node : EdgirGraph .EdgirNode ): EdgirGraph .EdgirNode = {
1314 val highFanoutLinks = node.edges
1415 .collect { case EdgirEdge (EdgeLinkWrapper (linkPath, linkLike), source, target) =>
@@ -24,7 +25,8 @@ class RemoveHighFanoutEdgeTransform(minConnects: Int, allowedLinkTypes: Set[Libr
2425 (linkPath, link, linkLike, source, target) // extract elaborated link
2526 }
2627 .collect {
27- case (linkPath, link, linkLike, source, target) if allowedLinkTypes.contains(link.getSelfClass) =>
28+ case (linkPath, link, linkLike, source, target)
29+ if allowedLinkTypeSimple.contains(link.getSelfClass.toSimpleString) =>
2830 (linkPath, linkLike, source, target) // filter by type
2931 }
3032 .groupBy(_._1)
0 commit comments