-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
floogen: Fix endpoint enum ordering and names (#90)
* floogen(graph): Sort by not sorting * floogen(pkg): Sort endpoint enum correctly * lint(floogen): Python sources * docs: Update CHANGELOG * tb(mesh): Fix endpoint enum names
- Loading branch information
Showing
8 changed files
with
21 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
# | ||
# Author: Tim Fischer <[email protected]> | ||
|
||
import re | ||
from typing import List, Tuple | ||
|
||
import networkx as nx | ||
|
@@ -287,15 +286,7 @@ def add_nodes_as_array( | |
def create_unique_ep_id(self, node) -> int: | ||
"""Return the endpoint id.""" | ||
ep_nodes = [name for name, _ in self.get_ep_nodes(with_name=True)] | ||
|
||
# Custom sorting function: extract numeric part after letters | ||
def extract_number(name): | ||
match = re.search(r"(\d+)$", name) | ||
return int(match.group(1)) if match else -1 | ||
|
||
return sorted( | ||
ep_nodes, key=lambda name: (re.sub(r"\d+$", "", name), extract_number(name)) | ||
).index(node) | ||
return ep_nodes.index(node) | ||
|
||
def get_node_id(self, node_name=None, node_obj=None): | ||
"""Return the node id.""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters