-
Notifications
You must be signed in to change notification settings - Fork 235
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
Refactor met.process
and dbfiles
#3319
Conversation
Signed-off-by: Abhinav Pandey <[email protected]>
Signed-off-by: Abhinav Pandey <[email protected]>
Signed-off-by: Abhinav Pandey <[email protected]>
Signed-off-by: Abhinav Pandey <[email protected]>
Signed-off-by: Abhinav Pandey <[email protected]>
met.process.R
to optimize standerdized_result
handlingmet.process
and dbfiles
Signed-off-by: Abhinav Pandey <[email protected]>
Signed-off-by: Abhinav Pandey <[email protected]>
is_standardized <- FALSE | ||
} | ||
|
||
if(is_standardized) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this changes behavior: previously ready.id
would have an entry for each id whether it was standardized or not; this only adds the ids that were standardized. Is that intentional?
(As currently implemented I think ids not standardized would probably have errored out earlier, but this step should not rely on that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've implemented a NA
appending too to make sure to append even when we have face a !is_standardized
condition. The initial though process I had was whether it would be wise pass the input.id
's to .met2model.module
and later on to convert_input
if we have not standardised our results. Although it seems I failed and ignored the order in array at check which may change the results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@infotroph Can you take a look into this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sweetdevil144 I was wrong above about the existing behavior -- In the current code standardize_result
has an entry for each id, but it is NULL for ids not standardized and therefore gets silently dropped when appending to ready.id
. I don't know how advisable that is, but I bet downstream code relies on it.
I'll suggest changes here that eliminate the second for-loop but keep the original behavior -- please edit further if you see problems I missed.
Signed-off-by: Abhinav Pandey <[email protected]>
Signed-off-by: Abhinav Pandey <[email protected]>
is_standardized <- FALSE | ||
} | ||
|
||
if(is_standardized) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sweetdevil144 I was wrong above about the existing behavior -- In the current code standardize_result
has an entry for each id, but it is NULL for ids not standardized and therefore gets silently dropped when appending to ready.id
. I don't know how advisable that is, but I bet downstream code relies on it.
I'll suggest changes here that eliminate the second for-loop but keep the original behavior -- please edit further if you see problems I missed.
Co-authored-by: Chris Black <[email protected]>
Co-authored-by: Chris Black <[email protected]>
Signed-off-by: Abhinav Pandey <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR is ready for review. Mentioning @infotroph and @moki1202 for approval
Description
return
statement where we intended to return but didn't implementMotivation and Context
Removed the redundant loop that iterated over
standardize_result
to updateready.id
. Instead,ready.id
is now directly assigned the values from the current iteration'sstandardize_result
ifis_standardized
is TRUE every time we perform a standardization.For now, I've commented out the previous changes and will remove them once the current changes are approved.
Review Time Estimate
Types of changes
Checklist: