-
Notifications
You must be signed in to change notification settings - Fork 19
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
Rename skip, replace and fail #53
Comments
Something I should have noted is that some functions will need to take convenience keyword arguments anyway because they need a special behavior:
|
My vote is |
My vote is |
So basically you both support option 2, and the question is whether it use I agree we probably don't need |
As someone who's been biased and influenced by the current |
These functions are supposed to be called as
Missings.skip
since their names are too broad for them to be exported. Yet, if we move these features to Base, there will not be any module to replaceMissings
. A few possible solutions have been discussed:Include these functions in a standard library module, which could be called
Missings
. Cons: many people do not like this name, it's already relatively long to type.Make
skip
,replace
andfail
methods of more general functions underBase.Iterators
, as they are not so commonly used. But sinceskip
is needed all the time, also export a convenience function with a short name. Possible choices include:nonmissing
. Pros: it's the common term used to speak about values which are notmissing
(it's even in the Wiktionary; we already havenonzeros
, which is somewhat similar; auto-completion works with justnonm[tab]
. Cons: it could be weird to have a negation in a function name.skipmissing
. Pros: maybe more explicit than "non", and avoids the negation; can also be auto-completed by typingskipm[tab]
. Cons: less standard thannonmissing
.Base.Iterators
functions), and add keyword arguments where missing values need a special treatment. For example,sum
would take amissing=:pass
argument (ormissing=pass
using an enum) which could also take valuesskip
andfail
. Pros: it's flexible, so that it could be extended to e.g.missing=:pairwise_delete
forcor
; it's kind of systematic in thatskip
doesn't get a special treatment. Cons: it requires adapting all reductions to support missing values, and doesn't help when you need to deal with a function which has not been adapted (so that we will probably need functions from 1 or 2 anyway, though less frequently). Option 2 could also be combined with this one by allowing a second argument tononmissing
/skipmissing
which would allow replacing missing values with a value (replace
) or throwing an error (fail
).Overall I'm leaning towards 2, but I'm not completely sure which name is the best one (we could find other ideas too).
The text was updated successfully, but these errors were encountered: