thegreenwebfoundation / co2.js

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

Update Sustainable Web Design Model to Version 4 #119

Closed mrchrisadams closed 3 months ago

mrchrisadams commented 1 year ago

Since the SWD model was worked into this library, new data and reports from DIMPACT, the IEA, Ember and Cisco systems have been published, many of which provide new top level numbers for total energy use, total transfer and so on.

This issue is a placeholder to check the original numbers in the SWD model, as well as confirm if they were using the 1024 based figure of gibibytes (often used for storage), or 1000 based figure for gigabytes (often used for transfer).

fershad commented 3 months ago

Renamed this issue.

The Sustainable Web Design Model has recently published an updated calculation based on newer data. This issue will capture the changes required in CO2.js to facilitate adding the new version to the library.

The updated methodology is outlined on this page. The update includes a significant change to the calculation (linked here).

Key changes from version 3 to version 4:

At this time, version 4 is open for comment. As such, version 3 (the current version implemented in CO2.js _will remain the default_. This will allow us to introduce version 4 into the library, allow users to opt-in to using it, and leave space to make changes should they be required. Eventually, we will outline a roadmap for defaulting to version 4.

What this might look like:

import { co2 } from '@tgwf/co2';

// These would use version 3 of the Sustainable Web Design Model
const default = new co2();
const version3 = new co2({ model: "swd" });
const explicitVersion3 = new co2({ model: "swd", version: "3" });

// This would use version 4 of the Sustainable Web Design Model
const version4 = new co2({ model: "swd", version: "4" });

As part of this update, we would also need to update the Sustainable Web Design Rating Scale that's being implemented in #207. The SWD group is working through making that update to the website & once that's done we'll look to replicate that in CO2.js.

mrchrisadams commented 3 months ago

There's some more discussion about supporting new versions in the issue below. It's helpful context:

https://github.com/thegreenwebfoundation/co2.js/issues/206

fershad commented 3 months ago

Version 4 has been added to CO2.js in #208 and is "opt-in" for developers to use at this time. Version 3 remains in the library as the default SWDM version.

Discussions to update the default SWDM version to version 4 are being tracked in #209.