Skip to content

Commit

Permalink
refactor: updating GLOBAL_INTENSITY figure from 475 => 440
Browse files Browse the repository at this point in the history
  • Loading branch information
drydenwilliams authored and mrchrisadams committed Mar 9, 2022
1 parent 1956ea8 commit fd55085
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/sustainable-web-design.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const { formatNumber } = require('./helpers');

// Taken from: https://sustainablewebdesign.org/calculating-digital-emissions/#:~:text=TWh/EB%20or-,0.81%20kWH/GB,-Carbon%20factor%20(global
const KWH_PER_GB = 0.81;
// Taken from: https://sustainablewebdesign.org/calculating-digital-emissions/#:~:text=intensity%20of%20electricity%20(-,475g/kWh,-).%C2%A0
const GLOBAL_INTENSITY = 475;
// Taken from: https://www.iea.org/reports/renewables-2021
const GLOBAL_INTENSITY = 440;
// Taken from: https://gitlab.com/wholegrain/carbon-api-2-0/-/blob/master/includes/carbonapi.php
const FIRST_TIME_VIEWING_PERCENTAGE = 0.25;
const RETURNING_VISITOR_PERCENTAGE = 0.75;
Expand Down
2 changes: 1 addition & 1 deletion src/sustainable-web-design.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('sustainable web design model', () => {
it('should calculate the correct co2 per visit', () => {
const averageWebsiteInBytes = 2257715.2;
const energy = swd.energyPerVisit(averageWebsiteInBytes);
expect(swd.emissionsPerVisitInGrams(energy)).toEqual(0.21);
expect(swd.emissionsPerVisitInGrams(energy)).toEqual(0.2);
});

it('should accept a dynamic KwH value', () => {
Expand Down

0 comments on commit fd55085

Please sign in to comment.