carbonplan / offsets-db-api

accounting of voluntary and compliance offset programs
https://carbonplan.org/research/offsets-db
MIT License
1 stars 0 forks source link

Reassess category bucketing logic in `/charts/` endpoints #65

Closed katamartin closed 11 months ago

katamartin commented 11 months ago

For projects that have multiple categories, numerous edge cases can be hit when rendering charts that group by category. For example, see the charts rendered when specifying category=agriculture:

CleanShot 2023-11-15 at 17 40 40@2x

We should revisit the queries we're using to construct these charting responses to:

  1. Avoid double-counting projects/credits (this is very important)
  2. Only group projects by categories that are included in the category query param list (less crucial, but would prevent the unexpected forest bar showing up in the case above)
andersy005 commented 11 months ago

It turns out this was a small bug in a function used to filter projects. this should be fixed now