thegreenwebfoundation / co2.js

An npm module for accessing the green web API, and estimating the carbon emissions from using digital services
Other
389 stars 49 forks source link

Provide a way to surface system segment level carbon estimates #101

Closed fershad closed 1 year ago

fershad commented 2 years ago

Currently, CO2.js can be used to calculate carbon estimates for an entire system. In the case of the OneByte model that is data centers and networks. For the Sustainable Web Design (SWD) model, this covers data centers, networks, user devices, and production.

Ideally, there should be a way for developers to easily get carbon estimates for each individual segment. There are currently functions in the SWD model that do this, but they are not exposed through the CO2 object.

Outcome

It should be possible for a developer to obtain a breakdown of segment-level carbon estimates for a given model. This, when coupled with changes proposed for #64 and #97, would provide a means for developers to return even more detailed carbon emissions estimates.

Example

I am looking at a website, that is hosted in Portugal. The audience for this website is mostly based in Brazil. I could use average grid intensity figures for Portugal & Brazil, and plug them into the SWD model to be used when calculating device & user device carbon estimates respectively. This will enable the results returned by CO2.js to be more tailored to my website's situation, rather than all results being based off global average emissions intensity.

mrchrisadams commented 2 years ago

hey @fershad I think this could plausibly be begun without waiting for the marginal intensity work in #97, as there are a couple of python scripts that could be converted to js ones as we discussed.

WDYT?

https://github.com/thegreenwebfoundation/co2.js/pull/69

fershad commented 2 years ago

I reckon we could make a start on it, though I'll be prioritising the Ember & UNFCCC data since it'll be mentioned in the Branch article.

mrchrisadams commented 2 years ago

Good point - the datasets take priority 👍