Skip to content

nafill gains nan argument#4025

Merged
mattdowle merged 12 commits intomasterfrom
nafill_nan
Dec 18, 2019
Merged

nafill gains nan argument#4025
mattdowle merged 12 commits intomasterfrom
nafill_nan

Conversation

@MichaelChirico
Copy link
Copy Markdown
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.

Comment thread R/shift.R Outdated
Comment thread src/nafill.c Outdated
Comment thread man/nafill.Rd Outdated
@jangorecki
Copy link
Copy Markdown
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
Copy Markdown
Member Author

About verbose, will come back to that

@MichaelChirico
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread R/utils.R Outdated
@MichaelChirico
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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?

Comment thread R/utils.R Outdated
Comment thread inst/tests/nafill.Rraw Outdated
@MichaelChirico
Copy link
Copy Markdown
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
Copy Markdown
Member

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

@MichaelChirico
Copy link
Copy Markdown
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