TensorBFS / TensorInference.jl

Probabilistic inference using contraction of tensor networks
https://tensorbfs.github.io/TensorInference.jl/
MIT License
18 stars 2 forks source link

fix model printing #53

Closed GiggleLiu closed 1 year ago

GiggleLiu commented 1 year ago

I notice that there are some printing issue is the current documentation. Which will be fixed by this PR. I also removed the nclique field of the UAIModel type, which is not used anywhere in the code.

Before the fix

The variables are not shown image

After the fix

julia> using TensorInference

julia> model = read_model_file(pkgdir(TensorInference, "examples", "asia", "asia.uai"))
UAIModel(nvars = 8, nfactors = 8
 cards : [2, 2, 2, 2, 2, 2, 2, 2]
 factors : 
  Factor(1), size = (2,)
  Factor(1, 2), size = (2, 2)
  Factor(3), size = (2,)
  Factor(3, 4), size = (2, 2)
  Factor(3, 5), size = (2, 2)
  Factor(2, 4, 6), size = (2, 2, 2)
  Factor(6, 7), size = (2, 2)
  Factor(5, 6, 8), size = (2, 2, 2)
codecov[bot] commented 1 year ago

Codecov Report

Merging #53 (1e4bacf) into main (79797ea) will increase coverage by 0.51%. The diff coverage is 82.22%.

@@            Coverage Diff             @@
##             main      #53      +/-   ##
==========================================
+ Coverage   81.07%   81.59%   +0.51%     
==========================================
  Files           9        9              
  Lines         502      489      -13     
==========================================
- Hits          407      399       -8     
+ Misses         95       90       -5     
Impacted Files Coverage Δ
src/TensorInference.jl 100.00% <ø> (+25.00%) :arrow_up:
src/Core.jl 46.29% <22.22%> (-7.23%) :arrow_down:
src/mmap.jl 71.18% <86.66%> (ø)
src/map.jl 100.00% <100.00%> (ø)
src/mar.jl 94.64% <100.00%> (ø)
src/sampling.jl 98.75% <100.00%> (ø)
src/utils.jl 89.68% <100.00%> (+0.42%) :arrow_up: