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

Ensure proper handling of "partially missing" complex inputs where appropriate #5797

Open
MichaelChirico opened this issue Dec 6, 2023 · 1 comment

Comments

@MichaelChirico
Copy link
Member

MichaelChirico commented Dec 6, 2023

Follow-up to #5748.

We need to ensure our complex handling behaves "as expected" in the improved world of missingness for complex values in R.

coalesce() in particular seems worthy of further scrutiny (skipped for now in the interest of just getting tests green as quickly as possible):

showz = \(z) cbind(Re = Re(z), Im = Im(z))

showz(fcoalesce(complex(real = NA, imaginary = NA), 0+1i)) # i.e. NA_complex_
#      Re Im
# [1,]  0  1
showz(fcoalesce(complex(real = 0 , imaginary = NA), 0+1i)) # i.e. unchanged
#      Re Im
# [1,]  0 NA
showz(fcoalesce(complex(real = NA, imaginary = 0 ), 0+1i)) # i.e. unchanged
#      Re Im
# [1,] NA  0

If this is deemed problematic we should check handling elsewhere in the codebase too.

@jangorecki
Copy link
Member

I think it is good. If complex number is only partially missing then fcoalesce can ignore it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants