Skip to content

Commit

Permalink
Merge pull request #58 from neherlab/fix/marginalize
Browse files Browse the repository at this point in the history
fix: marginalize variable name
  • Loading branch information
mmolari committed Jul 12, 2023
2 parents 54c5019 + b312fd0 commit 062e122
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# PanGraph Changelog

## v0.7.1

- minor fix for multi-threaded marginalize, see [#58](https://github.com/neherlab/pangraph/pull/58).

## v0.7.0

- fasta input files are checked for duplicated records, and white lines between records are tolerated, see [#55](https://github.com/neherlab/pangraph/pull/55).
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
@@ -1,7 +1,7 @@
name = "PanGraph"
uuid = "0f9f61ca-f32c-45e1-b3bc-00138f4f8814"
authors = ["Nicholas Noll <nbnoll@eml.cc>"]
version = "0.7.0"
version = "0.7.1"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
20 changes: 10 additions & 10 deletions src/marginalize.jl
Expand Up @@ -70,27 +70,27 @@ Marginalize = Command(
pairs = [(n₁, n₂) for n₁ in names for n₂ in names if n₁ < n₂]

Threads.@threads for (name₁, name₂) in pairs
G = Graphs.copy_graph(graph)
Graphs.keeponly!(G, name₁, name₂)
Γ = Graphs.copy_graph(graph)
Graphs.keeponly!(Γ, name₁, name₂)
if reduce
changed = true
while changed
l = length(G.block)
Graphs.deparalog!(G)
Graphs.detransitive!(G)
changed = l != length(G.block)
l = length(Γ.block)
Graphs.deparalog!(Γ)
Graphs.detransitive!(Γ)
changed = l != length(Γ.block)
end
else
Graphs.detransitive!(G)
Graphs.detransitive!(Γ)
end

# recompute positions
Graphs.finalize!(G)
Graphs.finalize!(Γ)

test_flag && verify(graph, G)
test_flag && verify(graph, Γ)

open("$(output)/$(name₁)-$(name₂).json", "w") do io
marshal(io, G; fmt = :json)
marshal(io, Γ; fmt = :json)
end
end
end
Expand Down

0 comments on commit 062e122

Please sign in to comment.