🔧 refactor(store.py): modify create_component function to include total count of each type in the metadata dictionary
The `create_component` function in `store.py` has been modified to include the total count of each type in the metadata dictionary. This change improves the structure of the metadata and provides more comprehensive information about the types and their counts in the nodes.
This commit is contained in:
parent
6f3172bc33
commit
e621243288
1 changed files with 4 additions and 1 deletions
|
|
@ -72,7 +72,10 @@ def create_component(
|
|||
# and the value is the count this type appears in the nodes
|
||||
# e.g.
|
||||
# {
|
||||
# "SomeType": 1
|
||||
# "SomeType": {
|
||||
# "count": 2
|
||||
# },
|
||||
# "total": 2
|
||||
# }
|
||||
names = [node["id"].split("-")[0] for node in component.data["nodes"]]
|
||||
metadata = {name: {"count": names.count(name)} for name in names}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue