Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with pre functions #491

Merged
merged 14 commits into from
Apr 26, 2023
Merged

issue with pre functions #491

merged 14 commits into from
Apr 26, 2023

Conversation

clarkliming
Copy link
Contributor

@clarkliming clarkliming commented Apr 24, 2023

export checks and use :: in pre functions

part of #476

@clarkliming clarkliming changed the title 476 pre@main issue with pre functions Apr 24, 2023
BFalquet
BFalquet previously approved these changes Apr 24, 2023
Copy link
Contributor

@BFalquet BFalquet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@clarkliming clarkliming requested a review from BFalquet April 25, 2023 05:12
@github-actions
Copy link
Contributor

github-actions bot commented Apr 25, 2023

Unit Tests Summary

    1 files    33 suites   1m 35s ⏱️
178 tests 128 ✔️   50 💤 0
348 runs  234 ✔️ 114 💤 0

Results for commit 6d13c28.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 25, 2023

🧪 $Test coverage: 97.14%$

Code Coverage Summary

Filename                     Stmts    Miss  Cover    Missing
-------------------------  -------  ------  -------  --------------------------------------------------------------
R/ael01_nollt.R                 26       2  92.31%   82-91
R/aet01_aesi.R                 189       7  96.30%   51, 53-57, 285
R/aet01.R                      342       5  98.54%   41, 253, 328, 334, 562
R/aet02.R                      235       1  99.57%   493
R/aet03.R                       83       0  100.00%
R/aet04.R                      106       2  98.11%   169, 186
R/aet10.R                       50       1  98.00%   102
R/assertions.R                  71       5  92.96%   178-182
R/checks.R                      20       0  100.00%
R/chevron_tlg-S4class.R         21       0  100.00%
R/chevron_tlg-S4methods.R      136      12  91.18%   410-482
R/cmt01a.R                     186       0  100.00%
R/cmt02_pt.R                    49       0  100.00%
R/dmt01.R                       30       0  100.00%
R/dst01.R                      290       0  100.00%
R/dtht01.R                      98       0  100.00%
R/egt01.R                       45       0  100.00%
R/egt02.R                       56       0  100.00%
R/egt03.R                      132       3  97.73%   118, 164, 322
R/egt05_qtcat.R                 57       0  100.00%
R/ext01.R                       71       4  94.37%   230-231, 235-236
R/kmg01.R                       37       7  81.08%   58-66, 106
R/lbt01.R                       94       0  100.00%
R/lbt04.R                       49       0  100.00%
R/lbt05.R                       68       5  92.65%   148-153
R/lbt07.R                       90       1  98.89%   171
R/lbt14.R                      188      24  87.23%   54, 56, 108-109, 111-117, 144, 257, 259, 311-312, 314-320, 347
R/mht01.R                       69       2  97.10%   33-34
R/mng01.R                       95      12  87.37%   114, 118-121, 130-138, 180
R/pdt01.R                       57       0  100.00%
R/pdt02.R                       65       0  100.00%
R/utils.R                       73       0  100.00%
R/vst01.R                       47       0  100.00%
R/vst02.R                       92       2  97.83%   109, 240
TOTAL                         3317      95  97.14%

Diff against main

Filename          Stmts    Miss  Cover
--------------  -------  ------  -------
R/aet01_aesi.R       +4       0  +0.08%
TOTAL                +4       0  +0.00%

Results for commit: 19e2725d16d02bca953b402c0a49be7f637daa10

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@clarkliming clarkliming dismissed BFalquet’s stale review April 25, 2023 13:39

new update in code

Copy link
Contributor

@BFalquet BFalquet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor point inside (could be solved later). Thank you for the hard work

R/aet01_aesi.R Outdated Show resolved Hide resolved
@@ -13,7 +13,8 @@
Grade 2 6 (4.5%) 10 (7.5%) 7 (5.3%)
Grade 3 18 (13.4%) 14 (10.4%) 16 (12.1%)
Grade 4 15 (11.2%) 20 (14.9%) 18 (13.6%)
Grade 5 (fatal outcome) 76 (56.7%) 70 (52.2%) 75 (56.8%)
Grade 5 76 (56.7%) 70 (52.2%) 75 (56.8%)
Missing 0 0 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if missing should appear (I dont think so). What do you think @barnett11

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a difficult issue. We can expect Missing grade in adae.atoxgr, (even in cleaned adam). We should not filter this out because we also need to count the number of events. But this should not be counted in the count_occurrences_by_grade.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. for ATOXGR, those records are still using NA (not convertet to a level) and then will be discarded.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another update: ADAE.ATOXGR is a string (character in R's language). in rtables we require ATOXGR to be factor. Then we need to convert it into factor.
so here while we apply reformating, we need to populate NA for empty strings. Very different logic here!

reformat(c('1','2','3','4','5',''), rule('1'='1','2'='2','3'='3','4'='4','5'='5'))

my suggestion is to keep this missing level for now (as this solves many issues) and open another issue to deal with this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably need to evaluate the reformat when it is partial match of the whole set, option 1, keep the rest, option 2, discard the rest levels (use NA to replace) (but this is really contradictory to what we are doing to conver NA to "Missing"!) The logic/design behind this need to be further evaluated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue opened here: #492

Co-authored-by: b_falquet <[email protected]>
Signed-off-by: Liming <[email protected]>
@BFalquet
Copy link
Contributor

Good to merge from my side @clarkliming, issue has been opened for the reaming details

@clarkliming
Copy link
Contributor Author

I further adapt the code to remove the missing levels. hope this time it works

@clarkliming clarkliming merged commit f34bbbd into main Apr 26, 2023
@clarkliming clarkliming deleted the 476_pre@main branch April 26, 2023 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants