fix PPSTRESN - #939
Conversation
|
Hey @Shaakon35 this one is a bit difficult to assess because the issue is no longer in |
In the main, the issue might not appear for the dummy data, but when using the real data I got: |
js3110
left a comment
There was a problem hiding this comment.
Works well for me! I tried with a complicated dataset :)
There was a problem hiding this comment.
I don't understand this PR.
How am I supposed to test if it works if there is no data with the issue available?
I don't know what the expected result is. If the requirements are:
PPORRES = PPSTRESN = PPSTRESC
then we can just do:
mutate(PPORRES = 0, PPSTRESN = 0, PPSTRESC = 0)and that will satisfy the requirements.
We seem to be fixing some kind of edge-case that shows up with specific numbers - but that is not reflected in the unit tests. If we discover some edge-case, we should cover it with tests, to make sure we don't break this with further updates. This is what the tests are for.
This is not a well prepared and described PR.
What is up with this weird syntax with column values reassignment and idx? If we want to skip NA values in formatting, why is if_else not used as with PPSTRESC?
Why are we so furiously converting character -> numeric -> character -> numeric? Let the numbers be numbers, derive formatted characters where needed.
I have tried a couple of examples from the attached screenshot and doing just
round(as.numeric(x), 8)yields me the same results as
as.numeric(format(round(as.numeric(x[idx]), 8), scientific = FALSE))so I don't get what is the reason? What is the edge case we are solving by doing this back and forth conversion?
This is some unorthodox code submitted with zero explanation on the reasoning behind those decisions.
Gero1999
left a comment
There was a problem hiding this comment.
Hello @m-kolomanski! Your interpretation on the problem is correct. And you are right that it is still happening in main, so that is my bad, I may have not updated the env correctly when I checked.
The implementation seems to work (also in the xpt translated format), I just have some questions regarding the code part. Once clarified I can approve
|
Still there is no unit tests for that case we are solving here. |
|
@m-kolomanski Tests added. @Gero1999 @js3110 |
Review of PR #939 — fix PPSTRESNContextThis PR addresses issue #561 where Issues1.
|
this essentially means that any time the user changes the units the rounding wont be good- so I don't think this is something worth compromising on |
Yeah I will try to find a solution, but it's hard :( |


Issue
Closes #561
Description
I fixed three columns so that the numeric always match the character variable
Definition of Done
For PP/ADPP, it is expected based on CDISC rules that the result variables in numeric (
PPSTRESN) and character (PPSTRESC) matches in length and share exactly the same values for the PP/ADPP objects. Therefore:PPSTRESN = PPSTRESC.When no custom units are specified, is also expected that ``PPORRES = PPSTRESN = PPSTRESC`.
How to test
Run NCA with dummy data, download ADPP and PP to check all these variables are exactly the same value/length: PPORRES = PPSTRESN = PPSTRESC
Contributor checklist