GlobalFishingWatch / gfwr

R package for accessing data from Global Fishing Watch APIs
https://globalfishingwatch.github.io/gfwr/
Apache License 2.0
58 stars 7 forks source link

Handle zero events and make get_event faster 65 #73

Closed tclavelle closed 2 years ago

tclavelle commented 2 years ago

PR makes changes to the get_event function to make it much faster and to no longer error when the API returns zero events.

tclavelle commented 2 years ago

PR will close #65 and #66. The US trawlers example will still return zero events, but it is now intentional and used to demo when the API returns zero events and the function returns a zero row dataframe.

adeloera commented 1 year ago

Hi @tclavelle @natemiller I just wanted to check about this since it's listed as closed but I think I'm still having the same issue despite having downloaded the latest gfwr (I think). E.g. here's an example:

image

natemiller commented 1 year ago

@adeloera I just had a quick look and when I run this

get_event(event_type = "port_visit",vessel = '77315d119-9999-2176-e4c9-4e930416f52c')

I get the following returned

[1] "Your request returned zero results"
NULL

Can you check again if you have updated to the most recent version of gfwr

adeloera commented 1 year ago

@natemiller Oh that would be great to get!

Here's what I get if I go to download gfwr again: image

I infer from that that I'm using the latest version of the main branch. Is there some way for me to check the version?

adeloera commented 1 year ago

Just to update on this I think this is working for me now! Not sure exactly why but after updating R, uninstalling and downloading the latest version of all the packages gfwr uses, and redownloading gfwr again, whatever issue was causing my "get_events" to break (mentioned in #86) is gone and I'm also getting the "Your request returned zero results" result when relevant. Thanks so much!

natemiller commented 1 year ago

Great to hear it is working! Sorry it took that level of effort.