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

Problem with efficiency_route #1

Open
RogerGMarch opened this issue Dec 11, 2024 · 0 comments
Open

Problem with efficiency_route #1

RogerGMarch opened this issue Dec 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@RogerGMarch
Copy link
Collaborator

Problem with efficiency_global_routed.
Problem with efficiency_local_routed.

File "/media/M2_disk/roger/ciclovies/bikenwgrowth/jobs/scripts/analysisloop.py", line 46, in
analyze_results.main(PATH, cities)
File "/media/M2_disk/roger/ciclovies/bikenwgrowth/scripts/analyze_results.py", line 100, in main
metrics, cov = calculate_metrics(Gs[networktype], Gs[networktype + "_simplified"], Gs['carall'], nnids, empty_metrics, buffer_walk, numnodepairs, debug)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/M2_disk/roger/ciclovies/bikenwgrowth/scripts/functions.py", line 1167, in calculate_metrics
simplified_G = simplify_ig(G)
^^^^^^^^^^^^^^
File "/media/M2_disk/roger/ciclovies/bikenwgrowth/scripts/functions.py", line 157, in simplify_ig
output = ig.Graph.from_networkx(simplified_graph.to_undirected())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/M2_disk/roger/miniconda3/envs/growbikenet/lib/python3.12/site-packages/igraph/io/libraries.py", line 152, in _construct_graph_from_networkx
sortd.sort(key=lambda x: x[1])
TypeError: '<' not supported between instances of 'int' and 'list'

The function is this one. It is needed to check what is happening, at the moment is set a try except block.

def simplify_ig(G):
    """Simplify an igraph with ox.simplify_graph
    """
    G_temp = G.copy()  # Avoid deep copy unless truly needed
    G_temp.es["length"] = G_temp.es["weight"]

    simplified_graph = ox.simplify_graph(nx.MultiDiGraph(G_temp.to_networkx()))
    output = ig.Graph.from_networkx(simplified_graph.to_undirected())
    output.es["weight"] = output.es["length"]
    return output
@RogerGMarch RogerGMarch added the bug Something isn't working label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant