anytree icon indicating copy to clipboard operation
anytree copied to clipboard

Implement and test AscendingIter

Open mmore500 opened this issue 3 years ago • 2 comments

This iterator ascends from a starting node upwards toward the root of the tree. Iteration stops when it reaches the root. Somewhat different from the other iterators, as it will not iterate downward and/or over an entire subtree but seems to fit into the AbstractIter mold alright.

Updated tests and documentation. Hope this can be a useful addition.

mmore500 avatar Feb 23 '22 05:02 mmore500

Coverage Status

Coverage decreased (-0.003%) to 99.758% when pulling 9630cdbc76852c887a5f0355902965b9a9c2335d on mmore500:mmore500-ascending-iter into d63289b65644c6e8c9c1d83d339c2c235d9ecc31 on c0fec0de:master.

coveralls avatar Feb 23 '22 05:02 coveralls

Coverage Status

Coverage decreased (-0.05%) to 99.706% when pulling 9630cdbc76852c887a5f0355902965b9a9c2335d on mmore500:mmore500-ascending-iter into d63289b65644c6e8c9c1d83d339c2c235d9ecc31 on c0fec0de:master.

coveralls avatar Feb 23 '22 05:02 coveralls

Sorry to say. But this implementation is identical to https://anytree.readthedocs.io/en/latest/api/anytree.node.html#anytree.node.nodemixin.NodeMixin.iter_path_reverse

So i will not add this iterator, as it is redundant. Thanks for your efforts. Sorry.

c0fec0de avatar Oct 11 '23 19:10 c0fec0de