-
Notifications
You must be signed in to change notification settings - Fork 43
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
added cir_img() function #272
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very excited to be adding image functions to webchem! Here are some style suggestions and a couple of issues with the behavior of the function.
I think it might be good to write some tests to check that error messages work as expected and file downloads happen or don't happen when expected. You can use tempdir() to download images inside tests. I don't think it's necessary to check that the correct image is downloaded. |
Co-authored-by: Eric R Scott <[email protected]>
I have added some tests to check the funciton. |
to vectorise the function I now use a for loop instead of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @andschar for your work on this PR and sorry for the late reply. I agree, this PR is almost there.
Good point. It's also a problem if somebody would call the function like this vec = c(NA, '', 'Triclosan')
if (anyNA(vec) || any(vec == '')) {
stop('NA or empty strings provided.')
} |
Checks fail because Pubchem is a living database so tests often become outdated. Let's not worry about those tests here. CIR tests work locally. |
Pull Request
adding the
cir_img()
function. Replacing the closed, erroneous PR #250. Alreasy usesRETRY()
as discussed in PR #271 .PR task list:
devtools::document()