-
Notifications
You must be signed in to change notification settings - Fork 10
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
add convenience functions for common operations #110
Comments
I agree with your opinion to minimize the complexity in use especially for the most used functions. Should we mimic something like this to make it easier? Returning an object as a response and with all its properties seems very much natural to me since the end user would want to access everything about a query from a single object. We can uniformize this approach across the whole package. |
Even just the concept of "objects" and attributes can be confusing for beginners. I think many come to coding by imagining calling a function is like clicking a button in a GUI. One line function gets the data, or one line creates a plot. Although, perhaps @MathewBiddle and I were chatting about this earlier. I am curious to hear perspectives from non-coders on this. |
I think this is simple, good and easy to follow. |
just my 2 cents. I would expect |
We tried to separate query building from query execution for some reasons. One of them being the high turn-around time of execution. While we implemented methods like But we are eager to adopt changes. Please suggest. |
Since we could see a significant improvement in time from this thread, I think we can add a query parameter - Eg. # Method 1:
q1 = taxa.search(scientificname="Mola mola", nofetch = True) # does not return data and needs to be executed
# data can be accessed as
data = q1.execute() # returns the data
# data can also be accessed as, (once executed, it gets stored as a property of the object)
q1.data
# Method 2: or we can do simply
q2 = taxa.search(scientificname="Mola mola", nofetch = False) # fetches the data and also returns the whole object
q2.data # data can be accessed from this |
To maximize usability, I have suggested before [ref] that we wrap the (minor) complexity of query-building in some "convenience" functions. To this end I suggest we create and document the following:
pyobis.occurrences.search()
: search for taxa using geometry, datetimes, and taxa names.Are there other very common operations that should be promoted for use by non-technical users?
The text was updated successfully, but these errors were encountered: