Changelog
Version 0.9.1
Clarify documentation and docstrings.
Version 0.9.0
Instances of
NodeandBaseNodeare hashable now. They can be stored in aset.The
__eq__methods ofNodeandBaseNodenow compare by identity. To compare nodes the old way, usenode.similar_to(other_node).Add
equalsmethod onNodeto compare nodes by value. This method is stricter thansimilar_to, because it requiresselfandotherto have the same identifier.Remove
similar_tomethod fromBaseNodeto simplify subclassing.
Version 0.8.8
Upgrade to abstracttree 0.2.0.
When using
for node, item in tree.preorder(), thenitem.indexis now equal toNoneforroot.Native implementations of
node.rootandnode.is_leafshould speed up these operations.Add support for python 3.10
Version 0.8.7
Fix bug in node.compare:
Old erroneous behaviour: Return
Noneif both roots have the same data.New correct behaviour: Only return
Noneif roots have the same data and there are no differences further down. Otherwise, a difference tree should be returned.
Version 0.8.6
Fix bug caused by moving everything to src-directory.
Version 0.8.5
Add method
n1.similar_to(n2)to compare nodes by value and structure. In a future version, the behaviour ofn1 == n2might change to compare by identity.
Version 0.8.4
Make
to_dotworkFix bug in
updatemethod.Add parameter
check_looptoadd_child, so it can now be disabled.
Version 0.8.2
TreeMixin.to_dotshould produce dot-file, not an image.
Version 0.8.1
node.identifier = node.identifierno longer raises a DuplicateChildError. It has now become a no-op.
Version 0.8.0
Package is now based on AbstractTree. The API has been revamped:
Methods
tree.iter_nodesand similar renamed toiter(tree.nodes)Methods
tree.count_nodesand similar renamed totree.nodes.count()Method
Node.to_image()now returnsbytes. UseNode.to_pillowto get an image.littletree.export.*is gone. Useabstracttree.export.*orTreeMixin.*instead.Methods
add_child,add_childrenandremove_childhave been added toBaseNode.Change transform to match abstract signature:
Possible to change identifier when transforming
Function takes just a node as argument.
Routehas a slightly different api.
Rename
NodeMixintoTreeMixinMove
BaseNode.path.totoTreeMixin.to.
Version 0.6.2
Make better use of NodeMixin
Make sure most exporter work directly on NodeMixin
Move exporter functions (from Node) directly to NodeMixin.
Version 0.6.1
Remove
PathToclass.Add class
Routewhich is a generic version of the oldPathToclass.
Version 0.6.0
Add
NodeMixinclass, which provides something even more basic thanBaseNode.Add parameters
keepanddeeptotree.copy(). So a pruned copy can be made by doingtree.copy(keep=MaxDepth(3)).Calling
iter_leaveson a node that is a leaf now correctly yields an iterable containing just that Node.Fix
iter_siblingsto use identity instead of equality.Methods
sort_children,updateandclearno longer returnself, but None.
Version 0.5.1
Remove dataclasses (slots). Doesn’t work until python3.10.
Improve RowSerializer for pandas dataframe.
Add newlines to output of
node.to_dot()andnode.to_mermaid().
Version 0.5.0
Add
NetworkXSerializerfor conversion to and from networkx.Faster implementation of
__eq__for deep trees.Two trees can now be equal (
==) if their roots have a different identifier.Replace argument
str_factorybyformatterintree.show()andtree.to_string. If passed a string, it will be applied asformatter.format(node=node).
Version 0.4.1
Fix bug in tree.compare method
Version 0.4.0
Improve DotExporter
Rename
name_factorytonode_name.Derive file type from file extension if possible. Fall back on png.
Add
graph_attributes.Make attribute handling more intelligent. Distinguish static and dynamic properties.
Add parameter
directed(default: True).Remove whitespace around arrows for compacter file size.
Add MermaidExporter. Similar to DotExporter, but supported by GitHub.
Make
tree.childrenwritable for more compatibility with anytree/bigtreeAdd parameters
backendandnode_labeltotree.to_image()
Version 0.3.0
Remove
tree.show(img=True). Usetree.to_image().show()instead.New method
tree.transform()that creates a modified or pruned copy of a tree.New method
tree.compare()that compares different trees to each other.Rewrite
copy()in terms of transform. Usetree.copy()for shallow copy. Usetree.copy({})for deep copy.Remove style
minimal, but add stylelistfortree.show().Add option
escape_commentsto newick serializer to escape newick modifiers in node data.For now use
distanceandcommentinstead ofdistance_fieldandcomment_fieldin NewickSerializer.Changed default format of
to_dictto containidentifier.Rewrite RowSerializer
Refactor RelationSerializer
Version 0.2.3
Streamline
DotExporter. Create temporary files in memory. Add optionas_bytestoto_image(). Remove unused parameterseparator.Add more default styles to
StringExporter. Some have been renamed.consthas been renamed tosquare.Simplify signature of
from_newick. It accepts a string. For files a Path or file object should be passed.Add
tree.show()for quickly rendering a tree to console. Same asprint(tree.to_string()).
Version 0.2.2
Make dictserialization work on large trees.
Version 0.2.1
Improve newick serialization. It’s much faster now and works on big trees.
Because of how it is implemented, it now also works on preorder format
A(b, c), even though the standard form is(b, c)A.
Version 0.2.0
Add
node.path.toRemove
node.height(). Tutorial shows alternative one-liner.Fix bug in post-order iteration
Fix bug in
copyanddeepcopyAdd support for serializing to and from Newick format