-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
containsElements("H2O", "Z") returns TRUE #63
Labels
bug
Something isn't working
Comments
I add (currently failing) unit tests in the issue63-containsElements-returns-TRUE-for-invalid-elements branch. |
Thanks for adding this issue! Can you maybe work on that? |
This was referenced Aug 4, 2023
fixed by #65 |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
containsElements
returnsTRUE
(with a warning) for characters that are not valid elements:Created on 2023-08-02 with reprex v2.0.2
It should return
FALSE
(without a warning).It would be possible to add something like
in the
mapply
ofcountElements
MetaboCoreUtils/R/chemFormula.R
Lines 55 to 75 in 7294eec
if (is.na(xx))
statement introduced in #62 ) and test forlength(x) == 0
incontainsElements
but that would break many unit tests intest_adducts.R
(.pasteElements
throws an error because of an unnamed argument instead of silently return""
; even returning a namedinteger(0)
results in many other failures intest_adducts.R
).The text was updated successfully, but these errors were encountered: