Add tests for arithmetic on arrays#692
Add tests for arithmetic on arrays#692ojwoodford wants to merge 6 commits intoJuliaSymbolics:masterfrom
Conversation
|
Is this supposed to be listed as WIP, or just add to the tests? |
WIP |
|
Thanks these should act as test for #696 |
|
I think the left hand side of julia> y[1] / y[2]
(broadcast(*, x, Ref(s)))[1] / (broadcast(*, x, Ref(s)))[2]
julia> Symbolics.scalarize(y[1] / y[2])
x[1] / x[2] |
|
@shashi Done. Are you able to approve the workflows? |
Codecov Report
@@ Coverage Diff @@
## master #692 +/- ##
==========================================
- Coverage 76.49% 8.90% -67.60%
==========================================
Files 23 23
Lines 2719 2651 -68
==========================================
- Hits 2080 236 -1844
- Misses 639 2415 +1776
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
Shouldn't @variables x[1:2] s
y = x .+ s
@test isequal(scalarize(y[1] - y[2]), x[1] - x[2])that the test throws an error. This is not the expected behaviour. |
|
The problem has been suggested in #704 |
Basic arithmetic involving arrays and scalars is broken (see #691). The goal of this PR is to fix it.
I'm new to Julia, and unfortunately understanding the internals of Symbolics.jl is beyond me. I've added some tests that catch the error. I'd love to collaborate with someone on fixes.