You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per the discussion in #53, I added a check if isnan is applicable before calling it. Note that now, the tests fail because there is also no isfinite method for Millisecond. I can fix this with the same strategy of checking if the method is applicable, but this just feels clunky to me. I'm used to the "call the method" and it does the right thing for each type. Checking before calling so many methods just starts to look clunky, but if you think that's the right approach, I can easily add it.
I agree it's not ideal, but the only other solution I can see is to define isnan(::Any) and isfinite(::Any) to be false. Do you feel like proposing this in Base? That would probably allow making the code cleaner.
CI errors, but AFAICT it's no related to isfinite?
@nalimilan Thanks for the bump, I've been busy with other things and I don't think I have time to make the PR to Base right now. Feel free to run with it if you have time before I do.
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
ifapplicable(isfinite, a) &&isfinite(a) &&isfinite(b) &&
ifapplicable(isfinite, a) &&isfinite(a) &&
applicable(isfinite, b) &&isfinite(b)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix https://github.com/JuliaLang/Statistics.jl/issues/53