Hi Yichao!

Here is the function from FactorOperations.jl

function FactorDropMargin(A::Factor, Remove_var::Vector{String})
    Remove_dims = indexin(Remove_var, A.var)
    if any(Remove_dims==0)
        error("Wrong variable!")
    end

    Remain_var = symdiff(A.var, Remove_var)
    Remain_dims = indexin(Remain_var, A.var)

    Factor[:FactorMargin](A, Remove_var, Remain_var, Remove_dims, 
Remain_dims) # line 85
end

runtests.jl:

@testset "Multiply and marginalize factor" begin

  A=Factor(["a", "b"],[3, 2],[0.5, 0.1, 0.3, 0.8, 0, 0.9])
  B=Factor(["b", "c"],[2, 2],[0.5, 0.1, 0.7, 0.2])
  C = FactorProduct(A, B)
  FactorDropMargin(C, ["c"]) # line 19
  FactorKeepMargin(C, ["b", "a"])
  FactorPermute(ans, [2, 1])
  FactorKeepMargin(C, ["a", "b"])

end

what I got on the REPL:

*julia> **Pkg.test("BN")*

*INFO: Testing BN*

*Test Summary:                                     | *

  Define, permute factor, and call (var, card, val) | *No tests*

*Multiply and marginalize factor: **Error During Test*

  Got an exception of type ErrorException outside of a @test

  type DataType has no field FactorMargin

   in FactorDropMargin(::BN.Factor, ::Array{String,1}) at 
/Users/Corvus/.julia/v0.5/BN/src/FactorOperations.jl:85

   in macro expansion; at /Users/Corvus/.julia/v0.5/BN/test/runtests.jl:19 
[inlined]

   in macro expansion; at ./test.jl:672 [inlined]

   in anonymous at ./<missing>:?

   in include_from_node1(::String) at ./loading.jl:488

   in include_from_node1(::String) at 
/Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?

   in process_options(::Base.JLOptions) at ./client.jl:262

   in _start() at ./client.jl:318

   in _start() at 
/Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?

*Test Summary:                   | **Error  **Total*

  Multiply and marginalize factor | *    1  **    1*

On Wednesday, November 16, 2016 at 10:02:48 PM UTC-2, Yichao Yu wrote:
>
> On Wed, Nov 16, 2016 at 6:50 PM, Kevin Liu <kvt...@gmail.com <javascript:>> 
> wrote: 
> > From this issue https://github.com/JuliaPy/PyPlot.jl/issues/157 I 
> understand 
>
> ^^ This is irrelevant unless you are using PyCall 
>
> > 
> > `Factor[:FactorMargin](A, Remove_var, Remain_var, Remove_dims, 
> Remain_dims)` 
> > (line 85 of FactorOperations.jl) should pass, as it does on Atom, but 
> not on 
> > the REPL, which throws 
> > 
> > Got an exception of type ErrorException outside of a @test 
> > 
> >   type DataType has no field FactorMargin 
> > 
> >    in FactorDropMargin(::BN.Factor, ::Array{String,1}) at 
> > /Users/Corvus/.julia/v0.5/BN/src/FactorOperations.jl:85 
>
> Impossible to tell without code. 
>
> > 
> > 
> > Help, please. 
>

Reply via email to