kpet123 / Network-Composition

1 stars 0 forks source link

Make dendrogram creation compatible with all graph types. #38

Open kpet123 opened 4 years ago

kpet123 commented 4 years ago

Tried with basic graph and got this error -

File "/Users/kaitlinpet/Desktop/Projects/network-composition/flaskapp/comm_det.py", line 50, in group['children'] = [x for x in group['children'] if x['children']] KeyError: 'children'

kpet123 commented 4 years ago

More about this issue:

Pretty sure it only occurs with Basic graph (all others are fine) and there is only 1 level. This is printed output from the generate_dedrogram() function when basic graph+infomap is chosen: in dendrogram partition data is {'A4': (1,), 'B4': (1,), 'E4': (1,), 'C#5': (1,), 'E5': (1,), 'A5': (1,), 'D5': (1,), 'F#5': (1,), 'D4': (1,), 'D#4': (1,), 'G#4': (1,), 'G4': (1,), 'C#6': (1,), 'G5': (1,), 'D#5': (1,), 'end': (1,), 'G#5': (1,), 'A#4': (1,), 'B5': (1,), 'F#4': (1,), 'start': (1,)} in dengrogram dictionary is {'name': 'Music Network', 'children': [{'name': 'Level 0, Group 1', 'children': []}]}