insightsengineering / teal.data

Data model for teal applications
https://insightsengineering.github.io/teal.data/
Other
9 stars 8 forks source link

improve label functions #244

Closed chlebowa closed 10 months ago

chlebowa commented 10 months ago

Rewrote col_labels, col_;labels<- and col_relabel. All existing unit tests pass.

This is only a suggestion, the functions do their job properly. They have been copied from formatters, which is an argument against these changes.

github-actions[bot] commented 10 months ago

badge

Code Coverage Summary

Filename                         Stmts    Miss  Cover    Missing
-----------------------------  -------  ------  -------  -------------------
R/cdisc_data.R                       1       1  0.00%    37
R/default_cdisc_join_keys.R         11      11  0.00%    17-35
R/deprecated.R                      69      69  0.00%    16-356
R/dummy_function.R                   5       5  0.00%    16-23
R/formatters_var_labels.R           36      11  69.44%   59, 68-79
R/join_key.R                        38       0  100.00%
R/join_keys-c.R                     12       0  100.00%
R/join_keys-extract.R              128       0  100.00%
R/join_keys-names.R                 15       0  100.00%
R/join_keys-parents.R               30       0  100.00%
R/join_keys-print.R                 45       0  100.00%
R/join_keys-utils.R                 73       3  95.89%   33-36
R/join_keys.R                       21       0  100.00%
R/teal_data-class.R                 25       1  96.00%   70
R/teal_data-datanames.R             10       0  100.00%
R/teal_data-get_code.R              15       1  93.33%   57
R/teal_data-show.R                   4       4  0.00%    13-18
R/teal_data.R                       22       9  59.09%   32, 41-47, 50
R/testhat-helpers.R                 26       0  100.00%
R/topological_sort.R                32       0  100.00%
R/utils-get_code_dependency.R      110       1  99.09%   43
R/utils.R                           14       0  100.00%
R/verify.R                          42      11  73.81%   66, 96-100, 103-107
R/zzz.R                             10      10  0.00%    4-16
TOTAL                              794     137  82.75%

Diff against main

Filename                     Stmts    Miss  Cover
-------------------------  -------  ------  -------
R/formatters_var_labels.R      -15     -40  +69.44%
TOTAL                          -15     -40  +4.62%

Results for commit: 7bcdbb39b8b4a56f97b41142c631db8adbbee285

Minimum allowed coverage is 80%

:recycle: This comment has been updated with latest results

github-actions[bot] commented 10 months ago

Unit Tests Summary

  1 files   15 suites   1s :stopwatch: 176 tests 174 :white_check_mark: 2 :zzz: 0 :x: 257 runs  255 :white_check_mark: 2 :zzz: 0 :x:

Results for commit 7bcdbb39.

github-actions[bot] commented 10 months ago

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
formatters_var_labels 👶 $+0.04$ $+8$ $0$ $0$ $0$
Additional test case details | Test Suite | $Status$ | Time on `main` | $±Time$ | Test Case | |:-----|:----:|:----:|:----:|:-----| | formatters_var_labels | 👶 | | $+0.01$ | col_labels_accepts_an_empty_data.frame | | formatters_var_labels | 👶 | | $+0.00$ | col_labels_returns_a_named_vector_of_NA_when_fill_FALSE_and_there_are_no_labels | | formatters_var_labels | 👶 | | $+0.00$ | col_labels_returns_a_vector_of_column_names_when_fill_TRUE_and_there_are_no_labels | | formatters_var_labels | 👶 | | $+0.00$ | col_labels_returns_empty_character_vector_for_a_data.frame_with_no_columns | | formatters_var_labels | 👶 | | $+0.01$ | col_relabel_correctly_changes_column_labels_in_a_data_frame | | formatters_var_labels | 👶 | | $+0.00$ | col_relabel_returns_the_original_data.frame_when_no_new_labels_are_specified | | formatters_var_labels | 👶 | | $+0.01$ | col_relabel_throws_an_error_for_non_existent_columns |

Results for commit 4b796a8637d3258be36b60cfa785290d8edc4492

♻️ This comment has been updated with latest results.