diff --git a/CHANGELOG.md b/CHANGELOG.md index cef72d9b..94dc9b4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.10.1] - 2023-07-27 +### Added +- [#71] Node: `path_name` to allow different node name of different dtypes; map everything to string type. + ## [0.10.0] - 2023-07-15 ### Added - [#65] Tree Search: Implement `find_relative_path` to find relative path from node. @@ -289,6 +293,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Utility Iterator: Tree traversal methods. - Workflow To Do App: Tree use case with to-do list implementation. +[0.10.1]: https://github.com/kayjan/bigtree/compare/0.10.0...0.10.1 [0.10.0]: https://github.com/kayjan/bigtree/compare/0.9.5...0.10.0 [0.9.5]: https://github.com/kayjan/bigtree/compare/0.9.4...0.9.5 [0.9.4]: https://github.com/kayjan/bigtree/compare/0.9.3...0.9.4 diff --git a/bigtree/__init__.py b/bigtree/__init__.py index 0a4ddaea..e6c80c43 100644 --- a/bigtree/__init__.py +++ b/bigtree/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.10.0" +__version__ = "0.10.1" from bigtree.binarytree.construct import list_to_binarytree from bigtree.dag.construct import dataframe_to_dag, dict_to_dag, list_to_dag diff --git a/bigtree/node/node.py b/bigtree/node/node.py index f73c7d90..e1729302 100644 --- a/bigtree/node/node.py +++ b/bigtree/node/node.py @@ -116,7 +116,7 @@ def path_name(self) -> str: """ ancestors = [self] + list(self.ancestors) sep = ancestors[-1].sep - return sep + sep.join([node.name for node in reversed(ancestors)]) + return sep + sep.join([str(node.name) for node in reversed(ancestors)]) def __pre_assign_children(self: T, new_children: List[T]) -> None: """Custom method to check before attaching children diff --git a/pyproject.toml b/pyproject.toml index 2a19bb4a..097d56ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "bigtree" description = "Tree Implementation for Python, integrated with Python list, dictionary, and pandas DataFrame." readme = "README.md" requires-python = ">=3.7" -license = "MIT" +license = {text = "MIT"} keywords = [ "tree", "bigtree", diff --git a/tests/node/test_node.py b/tests/node/test_node.py index 24f3ebf9..7c752008 100644 --- a/tests/node/test_node.py +++ b/tests/node/test_node.py @@ -260,6 +260,10 @@ def test_set_children_error(self): self.a.children = [self.b, self.b] assert str(exc_info.value) == Constants.ERROR_SET_DUPLICATE_CHILD + def test_path_name_int(self): + b = Node(1, parent=self.a) + assert b.path_name == "/a/1" + def test_go_to(self): self.a.children = [self.b, self.c] self.b.children = [self.d, self.e]