multi-species species counts #550
-
Howdy, everyone. I'm working on a function to get a list of species to look for in a given locale at the current moment. I'd like to change the sort order based on how unique a species is: normalizing the number of observations here-and-now by the total similar observations in a place or in a time. However, when many species are returned, this is slow and seems to drag on inat's servers, sometimes throwing errors. I've already gathered the results for here-and-now as a pandas dataframe. Rather than moving taxon-by-taxon with iterrows(), I tried something like the following, which returned no results. Is there a better approach?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Since I don't have your dataframe contents to test with, can you show me the debug log output for this search? You can enable it with from pyinaturalist import enable_logging
enable_logging('DEBUG') That will show me the full HTTP request being sent. |
Beta Was this translation helpful? Give feedback.
-
Not quite sure what the magic change was -- I suspect I was over some limit in terms of species requested -- but I think I've got things working pretty well now. Thank you! The multi-species request is much more performant than going one at a time. My little project currently has two functions, one for finding and formatting names, and one for showing species to keep an eye out for in the current place/time. I'm open to feedback and you're welcome to use anything you like. |
Beta Was this translation helpful? Give feedback.
Not quite sure what the magic change was -- I suspect I was over some limit in terms of species requested -- but I think I've got things working pretty well now. Thank you! The multi-species request is much more performant than going one at a time. My little project currently has two functions, one for finding and formatting names, and one for showing species to keep an eye out for in the current place/time. I'm open to feedback and you're welcome to use anything you like.
https://github.com/svshepherd/pynat