Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/dendropy/datamodel/treemodel/_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-

import copy
import functools
import warnings
from io import StringIO
from dendropy.utility import terminal
Expand Down Expand Up @@ -2493,6 +2494,19 @@ def reseed_at(
edges_to_invert = []
current_node = new_seed_node
while current_node:

@functools.lru_cache()
def warn_node_support_values_once():
warnings.warn("""Support value detected as a node attribute, which can cause unexpected results when rerooting.

See <https://doi.org/10.1093/molbev/msx055> for details on this issue. Consider
using the `is_assign_internal_labels_to_edges` kwarg when loading data to assign support values to edges instead of nodes.

See <https://docs.python.org/3/library/warnings.html#warning-filter> for information on how to suppress this warning with a using a filter.""")

if any("support" in attr for attr in current_node.__dict__):
warn_node_support_values_once()

if current_node._parent_node is not None:
edges_to_invert.append(current_node.edge)
current_node = current_node._parent_node
Expand Down