Skip to content

Commit

Permalink
update news
Browse files Browse the repository at this point in the history
Merge branch 'master' of https://github.com/bernhard-da/sdcHierarchies

# Conflicts:
#	NEWS.md
  • Loading branch information
bernhard-da committed Aug 16, 2023
2 parents efd6062 + 8e1fbf6 commit 0cd046c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# sdcHierarchies 0.20.0
- massive performance improvement in `hier_convert()`

# sdcHierarchies 0.19.4
- really return `NULL` in `hier_display()`

# sdcHierarchies 0.19.3
- bugfix in computation of bogus-codes

Expand Down
7 changes: 2 additions & 5 deletions R/hier_display.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ hier_display <- function(x, root = NULL) {
}

.is_valid(x)
#if (!.is_sorted(x)) {
# x <- .sort(x)
#}

if (is.null(root)) {
from <- .rootnode(x)
} else {
Expand All @@ -44,5 +40,6 @@ hier_display <- function(x, root = NULL) {
df$children <- lapply(.all_nodes(x), function(y) {
setdiff(x$leaf[x$root == y], y)
})
cli::tree(df, root = from)
print(cli::tree(df, root = from))
return(invisible(NULL))
}
10 changes: 5 additions & 5 deletions tests/testthat/test_additional.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ expect_true(.is_valid_leaf(tree = tree, leaf = "a"))
expect_error(.is_valid_leaf(tree = tree, leaf = "a1"))

# print/display method
expect_is(
hier_display(tree), c("cli_tree", "tree")
expect_identical(
hier_display(tree), NULL
)

# print, but start from a subnode
expect_is(
hier_display(tree, root = "b"), c("cli_tree", "tree")
expect_identical(
hier_display(tree, root = "b"), NULL
)

# export
Expand Down Expand Up @@ -93,7 +93,7 @@ expect_null(erg_sdc$bogus$bogus_codes)
expect_null(erg_sdc$bogus$bogus_parents)

erg_code <- hier_convert(tree, as = "code")
expect_is(hier_display(erg_code), c("cli_tree", "tree"))
expect_identical(hier_display(erg_code), NULL)

expect_is(erg_code, "character")
expect_identical(length(erg_code), 3L)
Expand Down

0 comments on commit 0cd046c

Please sign in to comment.