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

if there are no edges, then raise an error for edge type in multigraph #264

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

RazinShaikh
Copy link
Contributor

I think this should raise an error but for the simple graph, the current code returns 0.

pyzx/pyzx/graph/graph_s.py

Lines 272 to 277 in e8a0de5

def edge_type(self, e):
v1,v2 = e
try:
return self.graph[v1][v2]
except KeyError:
return 0

If you want, I can change it to returning 0 for multigraph as well but that seems odd to me because 0 is the same as simple type.

@jvdwetering jvdwetering merged commit ec4bf47 into zxcalc:master Aug 6, 2024
3 checks passed
@RazinShaikh RazinShaikh deleted the multigraph-edge-type-error branch August 22, 2024 16:15
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

Successfully merging this pull request may close these issues.

2 participants