Skip to content

Commit a10235b

Browse files
committed
Merge branch 'main' into feature/emissions-release
2 parents 7d84e12 + df414e0 commit a10235b

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

data/transform/energy-to-stripe-metrics.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,8 @@ function updateMetricObject(
122122
if (d[domain.id] || d[domain.id] === 0) {
123123
hasEmissionsValue = true
124124
}
125-
if (domain.category !== 'load' || domain.fuelTech !== 'exports') {
126-
totalEmissions += d[domain.id] || 0
127-
}
125+
const value = domain.fuelTech === 'exports' ? -d[domain.id] || 0 : d[domain.id] || 0
126+
totalEmissions += value
128127
})
129128

130129
domainTemperature.forEach((domain) => {
@@ -143,9 +142,8 @@ function updateMetricObject(
143142
const ft = domain.fuelTech
144143
const id = domain.id
145144

146-
if (domain.category !== 'load' || ft === 'exports') {
147-
totalPowerEnergy += d[id] || 0
148-
}
145+
totalPowerEnergy += d[id] || 0
146+
149147
if (ft === BATTERY_DISCHARGING) {
150148
totalBatteryDischarging += d[id] || 0
151149
}
@@ -160,7 +158,7 @@ function updateMetricObject(
160158
const totalPowerEnergyMinusBatteryDischarging =
161159
totalPowerEnergy - totalBatteryDischarging
162160

163-
const ei = hasEmissionsValue ? totalEmissions / totalPowerEnergyMinusBatteryDischarging : null
161+
const ei = hasEmissionsValue ? totalEmissions / totalPowerEnergy : null
164162
const isValidEI = Number.isFinite(ei)
165163

166164
// if no value

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opennem",
3-
"version": "4.22.2",
3+
"version": "4.22.4",
44
"description": "An Open Platform for National Electricity Market Data",
55
"author": "Steven Tan",
66
"private": true,

0 commit comments

Comments
 (0)