Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiDiGraph doesn't work #3

Open
giammy677dev opened this issue Jan 13, 2024 · 0 comments
Open

MultiDiGraph doesn't work #3

giammy677dev opened this issue Jan 13, 2024 · 0 comments

Comments

@giammy677dev
Copy link

Hi,
I'm trying to use your algorithm with a NetworkX MultiDiGraph but I obtain the following error:

MultiDiGraph with 97 nodes and 506 edges
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
line 256, in process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
line 63, in perform_simulation
side = perform_random_walk(g, start_node, other_nodes, user_nodes_side2) # get the side we endend after the random walk
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
line 22, in perform_random_walk
current_node = random.choice([
for _ in g.neighbors(current_node)])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
line 370, in choice
raise IndexError('Cannot choose from an empty sequence')
IndexError: Cannot choose from an empty sequence
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
line 48, in
rwc_score = get_rwc(G, republican_nodes, democratic_nodes, node_percentage, number_simulations)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
line 124, in get_rwc
simulation_frequencies = future.result()
^^^^^^^^^^^^^^^
line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
line 401, in __get_result
raise self._exception
IndexError: Cannot choose from an empty sequence

Process finished with exit code 1

Do you know how can I solve?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant