mnets / pymnet

The original library for analyzing multilayer networks.
https://mnets.github.io/pymnet/
GNU General Public License v3.0
118 stars 24 forks source link

[REVIEW] Error in Tutorial: Network types: Multiplex networks #25

Closed ClaudMor closed 3 weeks ago

ClaudMor commented 4 weeks ago

Dear authors,

In the tutorial section about multiplex networks, after defining the 2-aspect multiplex network conet you try to add a layer to its third aspect, which results in an error.

conet = MultiplexNetwork(couplings=['categorical','ordinal'])
conet.add_node('node')
conet.add_layer('a',1)
conet.add_layer('b',1)
conet.add_layer(1,2)
conet.add_layer(2,2)
conet.add_layer(3,3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\claud\anaconda3\envs\pymnet_review\Lib\site-packages\pymnet\net.py", line 997, in add_layer
    if layer not in self.slices[aspect]:
                    ~~~~~~~~~~~^^^^^^^^
IndexError: list index out of range