Use iszero(?) instead of ?==zero(...) for warning when adding edge, for Symbolics Num compatibility#50
Conversation
|
This seems fine to me, did you search for other uses of the pattern |
|
I've done a really quick grep for "zero" and didn't see it used anywhere else. Thanks for the promptness! |
|
Test failures are unrelated and should be fixed by #51 |
|
Would it make sense to add Symbolics to the tests and write a small unit test so that this will not be accidentally removed in future releases? |
|
I am very unfamiliar with Symbolics otherwise I would have tested it myself but is this also a case we have to consider? SimpleWeightedGraphs.jl/src/overrides.jl Line 71 in 8128430 |
|
Honestly I don't think it's worth the addition, Symbolics is a huge and rather brittle dependency. But we can try to come up with a simpler, self-contained test. |
|
@kockahonza sorry for the delay! Can you merge the latest |
A partial fix/workaround for #49 with no downsides as far as I can tell. It is just a replacement of comparing to
zerovia==to usingiszero. Though this isn't a comprehensive change to make all things work with Num types, it at least allows their creation (and they seem to mostly work in my usage).