Skip to content

Commit 2615430

Browse files
authoredJul 24, 2023
fix model printing (#53)
1 parent 096da66 commit 2615430

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed
 

Diff for: ‎src/Core.jl

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,19 @@ $(TYPEDEF)
1919
2020
### Fields
2121
* `nvars` is the number of variables,
22-
* `nclique` is the number of cliques,
2322
* `cards` is a vector of cardinalities for variables,
2423
* `factors` is a vector of factors,
2524
"""
2625
struct UAIModel{ET, FT <: Factor{ET}}
2726
nvars::Int
28-
nclique::Int
2927
cards::Vector{Int}
3028
factors::Vector{FT}
3129
end
3230

3331
Base.show(io::IO, ::MIME"text/plain", uai::UAIModel) = Base.show(io, uai)
3432
function Base.show(io::IO, uai::UAIModel)
35-
println(io, "UAIModel(nvars = $(uai.nvars), nclique = $(uai.nclique))")
36-
println(io, " variables :")
33+
println(io, "UAIModel(nvars = $(uai.nvars), nfactors = $(length(uai.factors))")
34+
println(io, " cards : $(uai.cards)")
3735
println(io, " factors : ")
3836
for (k, f) in enumerate(uai.factors)
3937
print(io, " $(summary(f))")

Diff for: ‎src/utils.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function read_model_from_string(str::AbstractString; factor_eltype = Float64)::U
5959
# Wrap the tables with their corresponding scopes in an array of Factor type
6060
factors = [Factor{factor_eltype, length(scope)}(Tuple(scope), table) for (scope, table) in zip(scopes_sorted, tables_sorted)]
6161

62-
return UAIModel(nvars, ntables, cards, factors)
62+
return UAIModel(nvars, cards, factors)
6363
end
6464

6565
"""
@@ -304,4 +304,4 @@ function get_artifact_path(artifact_name::String)
304304
Pkg.ensure_artifact_installed(artifact_name, artifact_toml)
305305
artifact_hash = Pkg.Artifacts.artifact_hash(artifact_name, artifact_toml)
306306
return Pkg.Artifacts.artifact_path(artifact_hash)
307-
end
307+
end

0 commit comments

Comments
 (0)
Please sign in to comment.