Skip to content

Commit 23f935f

Browse files
committed
fix: condition checking for existence of merger model was inverted
1 parent 13272fb commit 23f935f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

treetime/treetime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,9 +816,9 @@ def generate_subtree(self, parent):
816816
# branches without mutations are ready to coalesce -- others have to mutate first
817817
ready_to_coalesce = [b for b in branches_alive if mutations_per_branch.get(b.name,0)==0]
818818
if hasattr(self, 'merger_model') and (self.merger_model is not None):
819-
coalescent_rate = 0.5*len(ready_to_coalesce)*dummy_coalescent_rate + mutation_rate
820-
else:
821819
coalescent_rate = self.merger_model.branch_merger_rate(t) + mutation_rate
820+
else:
821+
coalescent_rate = 0.5*len(ready_to_coalesce)*dummy_coalescent_rate + mutation_rate
822822

823823
total_mutations = np.sum([mutations_per_branch.get(b.name,0) for b in branches_alive])
824824
n_branches_w_mutations = len(branches_alive) - len(ready_to_coalesce)

0 commit comments

Comments
 (0)