jeetsukumaran/DendroPy

Support values written as quoted node labels since >4.6.1

alpae opened this issue · 4 comments

Describe the bug
Handling of reading newick trees with support values (numeric values as internal node names) somehow changes after release 4.6.1.

Expected behavior
reading and writing a newick tree should result in the same representation.
This was also the behavior for Dendropy <= 4.6.1

To Reproduce

nw_str = "(A:0.36827875,B:0.186986942,(C:0.156890492,D:0.175861009)1.000:0.163375071);"
tree = dendropy.Tree.get(data=nw_str,schema="newick")
assert nw_str == tree.as_string("newick").strip()

Computational environment

  • OS: linux / macosx
  • Python version 3.11
  • DendroPy version >4.6.2

Additional context
Add any other context about the problem here.

Hi @alpae , thanks for the report! I’ll look into this shortly and follow up

The output string in this case is

(A:0.36827875,B:0.186986942,(C:0.156890492,D:0.175861009)'1.000':0.163375071);

with 1.000 quoted

Seems potentially related to #144

Hi @alpae --- found the issue and fixed. (Nexus and Newick serialization share logic, and Nexus is more eager about quoting certain characters than Newick). I just tagged v5.0.1 with the bug fix, which should release onto PyPI in about half an hour.

Thank you for the report!