Releases: niemasd/TreeSwift
Releases · niemasd/TreeSwift
TreeSwift v1.1.45
- Fixed bug in
distance_between
function whenv
is an ancestor ofu
- Thanks, @shayesteh99!
TreeSwift v1.1.44
- Updated MRCA algorithm to be faster when the MRCA is relatively lower in the tree
- Before, when looking for the MRCA of n nodes, I would do a complete upward traversal for the first n-1 nodes, and on the n-th upward traversal, I would stop the moment I found a node that's been visited n times (which is the MRCA)
- Now, I use a queue to explore the tree upwards from the given nodes until finding a node that has been visited n times
TreeSwift v1.1.43
- Simplified handling
gzip
files - Fixed issue when reading Nexus files with tab-delimited (rather than space-delimited)
TRANSLATE
lines
TreeSwift v1.1.42
- Updated
Tree.extract_tree*
function behavior- Before, if the user passed in any non-
set
iterable forlabels
, it would automatically runlabels = set(labels)
to convert it to aset
- If the user passed in a string, this would result in a
set
containing the unique individual letters of the string- E.g. if
labels == 'HELLO'
, this would result inlabels == {'H', 'E', 'L', 'O'}
- E.g. if
- However, the most likely user behavior for passing in a single string as
labels
would be to do something liketree.extract_tree_without(single_label)
to try to remove just that single label- This would have resulted in converting
single_label
(a string) into a set containing the unique letters ofsingle_label
- This would have resulted in converting
- I've updated these functions to first check if
labels
is a string, and if so, runlabels = {labels}
instead (to convert it into aset
containing just that single string) - Thanks for catching this, @pekarj!
- Before, if the user passed in any non-
- The
suppress_unifurcations
warning I added in v1.1.40 would warn the user when deleting aNode
that had a non-None
label, node attributes, or edge attributes- I've updated this warning to also not warn the user when deleting a
Node
that only has the empty string as its label (and no node/edge attributes)
- I've updated this warning to also not warn the user when deleting a
TreeSwift v1.1.41
- Added
Tree.find_node()
andNode.num_nodes()
TreeSwift v1.1.40
- Added warning if
suppress_unifurcations
will delete aNode
that has a label and/ornode_params
/edge_params
- To suppress all warnings in a Python script, you can add
warnings.filterwarnings('ignore')
to the top of the script- See the relevant Python documentation for more details regarding handling warnings
- Thanks, @pekarj!
- To suppress all warnings in a Python script, you can add
TreeSwift v1.1.39
- Fixed a bug in
Tree.distance_between
when one node is the other's parent- Thanks, @yueyujiang!
TreeSwift v1.1.38
- Fixed a typo that caused infinite recursion when attempting to copy a
treeswift.Node
object (thanks, @JSdoubleL!)
TreeSwift v1.1.37
- Added
write_tree_nexus
function toTree
objects
TreeSwift v1.1.36
- Fixed bug where
node_params
andedge_params
weren't getting copied when extracting a subtree or copying a tree (thanks, @pekarj!)