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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #50 +/- ##
==========================================
- Coverage 95.16% 95.14% -0.03%
==========================================
Files 9 9
Lines 476 474 -2
==========================================
- Hits 453 451 -2
Misses 23 23 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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).