Skip to content

Commit

Permalink
Merge pull request popsim-consortium#241 from grahamgower/convert
Browse files Browse the repository at this point in the history
Fix migration.end_time in convert.from_msprime.
  • Loading branch information
grahamgower authored Mar 18, 2021
2 parents 7e5654a + 941d444 commit e56413b
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions demes/convert/msprime_.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,16 +320,17 @@ def from_msprime(
for k in range(num_pops):
if j == k:
continue
if prev_mm[j, k] != msp_mm[j, k] and msp_mm[j, k] != 0:
# new Migration
m = demes.AsymmetricMigration(
source=name[j],
dest=name[k],
start_time=ddb_epoch.end_time,
end_time=ddb_epoch.start_time,
rate=msp_mm[j, k],
)
migrations[(j, k)].append(m)
if prev_mm[j, k] != msp_mm[j, k]:
if msp_mm[j, k] != 0:
# new Migration
m = demes.AsymmetricMigration(
source=name[j],
dest=name[k],
start_time=ddb_epoch.end_time,
end_time=ddb_epoch.start_time,
rate=msp_mm[j, k],
)
migrations[(j, k)].append(m)
else:
# extend time span of existing Migration
if (j, k) in migrations:
Expand Down

0 comments on commit e56413b

Please sign in to comment.