diff --git a/CHANGELOG.md b/CHANGELOG.md index 98143f1fa050d5c5be6e23f1f50b9443853c667c..9308304e56e534163b9deae3fc8f2ec84241ea16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ The `newick` package adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [v1.9.0] - 2023-03-14 Support round-tripping Newick with two annotations per node, one before and one after the length separator. diff --git a/README.md b/README.md index 30e6bb59c8fead785caaaeffde47bffa5c8f26eb..26cbf6941ad71c864fc341799ff78c163eda2396 100644 --- a/README.md +++ b/README.md @@ -128,14 +128,23 @@ can be accessed from the `dict` `Node.properties`: {'k1': 'v1', 'k2': 'v2'} ``` -Note that we still don't support **typed** node properties. I.e. values in `Node.properties` are -always strings. Since typed properties tend to be specific to the application writing the newick, -this level of support would require more knowledge of the creation context of the tree than can -safely be inferred from the Newick string alone. -```python ->>> newick.loads('(A,B)C[&range={1,5},support="100"];')[0].properties -{'range': '{1,5}', 'support': '"100"'} -``` +**Limitations:** + +- **Typed** node properties are not supported. I.e. values in `Node.properties` are + always strings. Since typed properties tend to be specific to the application writing the newick, + this level of support would require more knowledge of the creation context of the tree than can + safely be inferred from the Newick string alone. + ```python + >>> newick.loads('(A,B)C[&range={1,5},support="100"];')[0].properties + {'range': '{1,5}', 'support': '"100"'} + ``` +- Node annotations in comments are not completely round-trip-safe. In particular multiple comments + per node may be lumped together (using `|` as separator) when serializing a Newick node: + ```python + >>> newick.loads('(a,b)c[c1][c2]:3')[0].newick + '(a,b)c[c1|c2]:3' + ``` + ## Writing Newick diff --git a/setup.cfg b/setup.cfg index 62a8376b107158dc1a27547bccd30d61d39cb815..acb026baf5b32e5bf4ed28bfdc4e23f2bea8710b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,7 @@ [metadata] name = newick -version = 1.8.2.dev0 +version = 1.9.0 + author = Robert Forkel author_email = robert_forkel@eva.mpg.de description = A python module to read and write the Newick format diff --git a/src/newick.py b/src/newick.py index cfe4f1cc54f94a9679b68ea2413885fa8dc9ea6f..cf01b6e8e1decd0517fa81ee3a036eaadbee8acb 100644 --- a/src/newick.py +++ b/src/newick.py @@ -10,7 +10,7 @@ import pathlib import itertools import dataclasses -__version__ = "1.8.2.dev0" +__version__ = "1.9.0" QUOTE = "'" ESCAPE = {"'", "\\"}