-
Notifications
You must be signed in to change notification settings - Fork 0
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
Disallow repeated keys and masks #192
Conversation
net_keys = {net: (0x0, 0xf) for net in (net0, net1)} | ||
|
||
# Build the routing tables | ||
with pytest.raises(Exception) as err: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you assert the correct exception type here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you can tell I did some bad TDD here.
This LGTM, aside from the exception message and type check in the tests! As mentioned offline and in #153, the issue of N:M nets is going to need to be considered properly in the near future. |
e7965a9
to
e85c5b8
Compare
Note: The routing trees provided are assumed to be correct and continuous | ||
(not missing any hops). If this is not the case, the output is undefined. | ||
.. warning:: | ||
An exception will be raised if entries with identical keys and masks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What type of exception? (i.e. MultisourceRouteError
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
`build_routing_tables` raises an exception if multiple nets with the exact same key and mask would cause packets to become duplicated at any node; this is generally an indication that the underlying net should be being treated as a multisource net. Includes suggestions by @mossblaser.
e85c5b8
to
c275a18
Compare
Bump. |
Disallow repeated keys and masks
build_routing_tables
raises an exception if multiple nets with the exact same key and mask would cause packets to become duplicated at any node; this is generally an indication that the underlying net should be being treated as a multisource net.This is option (3) from #153.
Clearly this is a somewhat contentious change, for example it will break
nengo_spinnaker
as stands.