Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

writeTopologyLevel1 changes the network when printID=true #138

Open
crsl4 opened this issue Sep 6, 2020 · 2 comments
Open

writeTopologyLevel1 changes the network when printID=true #138

crsl4 opened this issue Sep 6, 2020 · 2 comments
Assignees
Labels

Comments

@crsl4
Copy link
Member

crsl4 commented Sep 6, 2020

In writeTopologyLevel1, the option of printID=true means that only branch lengths that are identifiable will be printed. The function first changes all non-identifiable branch lengths to -1, and then write the parenthetical format. This is confusing because the function is in fact modifying an argument (the network) and it does not end in !. Also, it is difficult to debug when a function that is meant to simply write the parenthetical format changes the actual network object.
An easy fix could be to do a deepcopy of the network object at the beginning of writeTopologyLevel1, but it might be worth to re-thinking the role of writeTopologyLevel1 with the update of root and non-identifiable BLs at the end of snaq!.

@crsl4 crsl4 added the to do label Sep 6, 2020
@crsl4 crsl4 self-assigned this Sep 6, 2020
@cecileane
Copy link
Member

Instead of doing a deep copy of the full network, could the vector of branch lengths be saved, e.g. [e.length for e in net.edge], so that edge lengths can be restored afterwards?

@crsl4
Copy link
Member Author

crsl4 commented Sep 7, 2020

yes, this is a good idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants