zenna / Arrows.jl

14 stars 2 forks source link

MeanArrow not working with Arrays #99

Closed jburroni closed 6 years ago

jburroni commented 6 years ago

Consider the following test:

function test_mean_array()
  c = CompArrow(:c, [:x, :y], [:z])
  s = add_sub_arr!(c, MeanArrow{2}())
  (c, 1) ⥅ (s, 1)
  (c, 2) ⥅ (s, 2)
  (s, 1) ⥅ (c, 1)
  @test c([1, 2], [4,5]) == [2.5, 3.5]
end

it wil fail with the following error:

Test Failed
  Expression: c([1, 2], [4, 5]) == [2.5, 3.5]
   Evaluated: [1.0, 2.0] == [2.5, 3.5]
jburroni commented 6 years ago

@zenna: you have a suggestion for a better solution than the one presented in a14a296 and ec30f9e?