Closed glwagner closed 4 years ago
As discussed on #58, the problem appears to be that the node numbers of the contact network are not a simple range. The contact network is missing node 6130; as a result, while the network has 10017 nodes, the last node in the network has id 10017 (rather than 10016). This results in a the KeyError
above.
Solved by using contact_network = nx.convert_node_labels_to_integers(contact_network)
or using node numbers that are given by a simple range.
@lubo93 reports that this script:
https://github.com/dburov190/risk-networks/blob/bbae6b881f05a887e8c3cc5c8924e76be79043fa/examples/simulate_simple_epidemic_NYC.py
produces a
KeyError
that comes fromGillespie_simple_contagion
: