Skip to content

Commit

Permalink
Rename method -> Taxonomy.print_tree()
Browse files Browse the repository at this point in the history
  • Loading branch information
bryeng committed Apr 11, 2024
1 parent e084077 commit 9dfb651
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/timeseries/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __eq__(self, other) -> bool:

return trees_equal and entities_equal

def tree(self, *args, **kwargs) -> str:
def print_tree(self, *args, **kwargs) -> str:
# ugly! it would be preferable not to print the tree to std out
# ... but this works
import io
Expand Down
5 changes: 2 additions & 3 deletions tests/timeseries/test_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_read_flat_codes_from_klass() -> None:
@log_start_stop
def test_read_hierarchical_codes_from_klass() -> None:
energy_balance = Taxonomy(157)
ts_logger.debug(f"captured ...\n{energy_balance.tree(attr_list=['fullName'])}")
ts_logger.debug(f"captured ...\n{energy_balance.print_tree()}")

assert energy_balance.structure.root.name == "0"
assert energy_balance.structure.max_depth == 4
Expand Down Expand Up @@ -217,8 +217,7 @@ def test_hierarchical_codes_retrieved_from_klass_and_reloaded_from_json_file_are
finally:
os.remove(temp_file)

file157
# compare for leaf nodes of sub tree
# compare all leaf nodes of sub tree
k157_names = [n.name for n in klass157.structure.root.leaves]
f157_names = [n.name for n in file157.structure.root.leaves]
assert k157_names == f157_names
Expand Down

0 comments on commit 9dfb651

Please sign in to comment.