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

Ambiguous array comparison in delinearize_vertex_weights #187

Closed
PerretB opened this issue Apr 26, 2020 · 0 comments · Fixed by #188
Closed

Ambiguous array comparison in delinearize_vertex_weights #187

PerretB opened this issue Apr 26, 2020 · 0 comments · Fixed by #188
Labels
bug Something isn't working

Comments

@PerretB
Copy link
Member

PerretB commented Apr 26, 2020

delinearize_vertex_weights fails if one of the shape is given as a numpy array:

/usr/local/lib/python3.6/dist-packages/higra/hg_utils.py in delinearize_vertex_weights(vertex_weights, graph, shape)
    201 
    202     if len(v_shape) >= len(shape):
--> 203         if shape == v_shape[:len(shape)]:
    204             return vertex_weights
    205 

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

This happens with the functions khalimsky_2_graph_4_adjacency which initializes the shape of the returned graph with a numpy array (should be normalized with normalize_shape).

@PerretB PerretB added the bug Something isn't working label Apr 26, 2020
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

Successfully merging a pull request may close this issue.

1 participant