-
Notifications
You must be signed in to change notification settings - Fork 1
calculation of "Species Most Affected" on report #1197
Comments
sharing the email thread here for posterity: Blake to Neil:
Neil response:
|
The reason this is more like a 4 hour fix is because the EventSummaries response does not currently have the data to make this calculation possible. It only contains the total affected count for the whole event, and has no species level affected count. This was by design at the time. Obviously that species level affected count can be found at the event details page and the eventdetails endpoint, but it was not included here. Since we are using the So for a quick immediate fix, the best thing is to rename the field on the report. I am thinking "Species with highest occurrence" but will make it whatever you want @nbaertlein or @JChipault . |
Yeah, adding it as a serializer field in the back end is fine with me. |
Let's do "Most Frequent Species" to match "Most Frequent Event Diagnosis" |
@aaronstephenson if that is a quick and soon possible change for you, then I will wait on this on my end. If it may take you a few weeks to get to it, I will make this label change in the meantime. |
I could probably get to it this week, but I'll need to know the specifics of what needs to be done. |
I will create an issue in the backend repo for this. |
So Aaron went ahead and implemented something on the backend that I asked for (see here: USGS-WiM/whispersservices#489) but I now realize that it will not meet our needs. This mistake is my fault entirely. Here is the problem - the Summary Report, by definition and design, does not include Location Species level affected numbers. It does sort of incidentally in the cases where there is one species at a location, and that can be paired with the '# of Animals Affected' column to determine how many of that species were affected. But anywhere there are multiple species, the summary response puts all of those number into a single sum, with no information on the respective count for each. That data is available at the Event Details page and the eventdetails response. In order to calculate the species with highest affected count, the server will need to query the locationspecies data for every location in the search response and append a custom object with the count per species so that 'Species Most Affected' can be calculated for the report. This is a significant change for the summary response which was deigned to be lighter weight and more performant to get the 'gist' before user drills down for more details. It feels like a scope creep to task it with querying that additional data to serve this single field on the report. For the time being, I am going to make the field label change to "Most Frequent Species" as specified above so as not to hold up the publishing of any further features. We need to discuss this decision more as a team to proceed with a material change to what that field is showing. |
fixes bulkupload bug and temp fix for #1197
@BlakeDraper I should've pointed this out more explicitly, sorry, but we'll need the metadata for this report updated too. Can it read "Top species based on the number of events with that species reported." |
This is done in an update to v2.16.9. Now available on test, soon available in Prod. |
I'm pretty sure Neil already talked to Blake about this one and they decided it was a lower priority fix, but we realized it wasn't logged in github so putting it in as lower priority github issue....
Undesired Design or Confusing behavior
The "Species Most Affected" on the front page of the search summary report seems to be based on frequency of species, but we want it based on total affected by species (see metadata at the back of the report)
If Possible, Describe a Solution
Change calculation for "Species Most Affected" to reflect the species with most affected based on sick and dead numbers. Neil found code here that calculates based on sum of affected, might be helpful (maybe not?): 5bd7121
Screenshots
If you run the search in the screenshot above, the 'White-tailed deer' was found in the most events (20 when search run in early April). The most 'affected' by numbers was the American Coot (5,054).
The text was updated successfully, but these errors were encountered: