-
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
get_*() consistency discussion #193
Comments
Also related: #206 |
We could also turn |
I also think that |
Another (maybe bad) idea is to get rid of |
I think the |
I like the way etoxids are currently returned, the function will always returns a data frame, but the contents of the dataframe will depend on |
I like the |
I saw the functionality of the |
Yeah, that was kind of the idea with the I wanted this functionality to be in df %>%
mutate(name = pc_synonyms(CAS_number, choices = 1)) But I suppose if |
In PR #203 I used I think the benefit of making the
Even if filtering the |
Have you decided on whether data.frame's should be returned by the What is bad in my opinion, and I think we all agree is to return a list of vectors, b/c it'd need some tweeking to get it into a data.frame. So, instead of directly a data.frame, I would prefer a list of data.frames. |
Concerning the |
I think I will start a separate discussion on this because there is a huge variation in what is returned by get_ and query functions across the package. edit: continued in #218 |
How's this for a
Where I realize that EDIT: I included |
if we only use |
@stitam But this only applies to |
You are probably right and I of course agree that the |
Let's re-purpose |
While adding guidelines for handling invalid queries in PR #225, I also added some guidelines for the |
How about this:
The query type (i.e. For anything that might not have an exact match we should also show the match to the query:
Other columns, can exist after these, for example the |
I think this is perfect. |
get functions to fix:
|
Currently
webchem
hasget_
functions for 4 databases to retrieve database-specific IDs that can then be used as input to other functions. These all have different interfaces.Let's use this as a starting point to discuss consistency of the API across databases. Personally, my favorite arguments that I think should be in all of the
get_
functions are:query
for obvious reasons should always be the first argument.from
argument let's you specify whether the input is a name, inchikey, etc. and the documentation specifies what kinds of queries are valid for that particular database.first
argument lets you get a vector out, even if multiple IDs are returned. Vectors of IDs are integral for using in otherwebchem
functions that return dataframes. I like thematch
argument inget_wdid
too, but how often are you really going to use "ask" for ID numbers? How are you supposed to know which is the right one beforehand?...
, although I think they should pass arguments to an underlying control function likecs_control()
(that is, I don't thinkget_cid
should have botharg
and...
)language
forget_wdid
orapikey
forget_csid
should go at the end (but before...
)Anyway, happy to hear what y'all think. Hopefully this will be an easy-ish jumping off point for making the API more consistent across databases.
The text was updated successfully, but these errors were encountered: