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

nafill gains nan argument #4025

Merged
merged 12 commits into from
Dec 18, 2019
Merged

nafill gains nan argument #4025

merged 12 commits into from
Dec 18, 2019

Conversation

MichaelChirico
Copy link
Member

Closes #4020

I imagine this will need a few small changes but here's 90% of it.

Would be nice to do the C equivalent of testF = if (nan_is_na) ISNAN else ISNA outside the loop but I couldn't figure out the proper way to do that.

R/shift.R Outdated Show resolved Hide resolved
src/nafill.c Outdated Show resolved Hide resolved
man/nafill.Rd Outdated Show resolved Hide resolved
@jangorecki
Copy link
Member

jangorecki commented Nov 3, 2019

This is not related but could you also remove verbose arg from function API? and fetch it at the beginning of C function, passing to lower level functions as argument already.

@MichaelChirico
Copy link
Member Author

About verbose, will come back to that

@MichaelChirico
Copy link
Member Author

@jangorecki these two tests are broken, shall we set nan=NaN by default for backwards compatibility? or happy to break this?

test(1.21, nafill(z, "locf"), c(NA,Inf,3,4,NaN,NaN,7,8,-Inf,-Inf)/2)
test(1.22, nafill(z, "nocb"), c(Inf,Inf,3,4,NaN,7,7,8,-Inf,NA)/2)

Copy link
Member

@jangorecki jangorecki left a comment

Choose a reason for hiding this comment

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

Test can be changed, just mention this change in news

R/utils.R Outdated Show resolved Hide resolved
@MichaelChirico
Copy link
Member Author

Hmm @mattdowle seems there was an API failure on the covr step, rest of job is OK. Re-trigger Travis should be enough unless there's ongoing outage (seems all is fine now)

@codecov
Copy link

codecov bot commented Nov 8, 2019

Codecov Report

Merging #4025 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4025      +/-   ##
==========================================
+ Coverage   99.41%   99.41%   +<.01%     
==========================================
  Files          72       72              
  Lines       13756    13769      +13     
==========================================
+ Hits        13675    13688      +13     
  Misses         81       81
Impacted Files Coverage Δ
src/nafill.c 100% <100%> (ø) ⬆️
R/utils.R 100% <100%> (ø) ⬆️
R/shift.R 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ce5f09...eb42c60. Read the comment docs.

Copy link
Member

@jangorecki jangorecki left a comment

Choose a reason for hiding this comment

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

And verbose arg? Could we remove it on R level here?

R/utils.R Outdated Show resolved Hide resolved
inst/tests/nafill.Rraw Outdated Show resolved Hide resolved
@MichaelChirico
Copy link
Member Author

MichaelChirico commented Nov 8, 2019

And verbose arg? Could we remove it on R level here?

Do we have any rule about when verbose should/shouldn't be provided as a function argument? Seems pretty harmless

^ @jangorecki

@MichaelChirico MichaelChirico changed the title nafill gains nan_is_na argument nafill gains nan argument Nov 22, 2019
@jangorecki
Copy link
Member

@MichaelChirico no rules about that, here it looks really unneeded, and could be easily migrated to use option.

@MichaelChirico
Copy link
Member Author

OK done the move, please have a look

@jangorecki jangorecki added this to the 1.12.7 milestone Nov 29, 2019
@mattdowle mattdowle modified the milestones: 1.12.7, 1.12.9 Dec 8, 2019
@mattdowle mattdowle merged commit 51805cd into master Dec 18, 2019
@mattdowle mattdowle deleted the nafill_nan branch December 18, 2019 07:01
@jangorecki jangorecki modified the milestones: 1.12.11, 1.12.9 May 26, 2020
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.

Should nafill replace NaN values?
3 participants