Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions config/carbon_impact_rates.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,85 +18,85 @@
"Year": "2021/22",
"Cap Do Nothing Intensity": 3.648,
"Ops Do Nothing Intensity": 4.49,
"Cap Target Reduction Rate": -19.20,
"Ops Target Reduction Rate": ""
"Cap Target Reduction Rate": -9.00,
"Ops Target Reduction Rate": -9.00
},
{
"Year": "2022/23",
"Cap Do Nothing Intensity": 3.55,
"Ops Do Nothing Intensity": 4.37,
"Cap Target Reduction Rate": -26.92,
"Ops Target Reduction Rate": -2.50
"Cap Target Reduction Rate": -13.50,
"Ops Target Reduction Rate": -13.50
},
{
"Year": "2023/24",
"Cap Do Nothing Intensity": 3.41,
"Ops Do Nothing Intensity": 4.2,
"Cap Target Reduction Rate": -34.24,
"Ops Target Reduction Rate": -5.00
"Cap Target Reduction Rate": -18.00,
"Ops Target Reduction Rate": -18.00
},
{
"Year": "2024/25",
"Cap Do Nothing Intensity": 3.27,
"Ops Do Nothing Intensity": 4.03,
"Cap Target Reduction Rate": -41.36,
"Ops Target Reduction Rate": -7.50
"Cap Target Reduction Rate": -22.50,
"Ops Target Reduction Rate": -22.50
},
{
"Year": "2025/26",
"Cap Do Nothing Intensity": 3.17,
"Ops Do Nothing Intensity": 3.91,
"Cap Target Reduction Rate": -46.40,
"Ops Target Reduction Rate": -10.00
"Cap Target Reduction Rate": -27.00,
"Ops Target Reduction Rate": -27.00
},
{
"Year": "2026/27",
"Cap Do Nothing Intensity": 3.17,
"Ops Do Nothing Intensity": 3.91,
"Cap Target Reduction Rate": -51.20,
"Ops Target Reduction Rate": -12.50
"Cap Target Reduction Rate": -31.50,
"Ops Target Reduction Rate": -31.50
},
{
"Year": "2027/28",
"Cap Do Nothing Intensity": 3.17,
"Ops Do Nothing Intensity": 3.91,
"Cap Target Reduction Rate": -54.30,
"Ops Target Reduction Rate": -15.00
"Cap Target Reduction Rate": -36.00,
"Ops Target Reduction Rate": -36.00
},
{
"Year": "2028/29",
"Cap Do Nothing Intensity": 3.17,
"Ops Do Nothing Intensity": 3.91,
"Cap Target Reduction Rate": -57.30,
"Ops Target Reduction Rate": -17.50
"Cap Target Reduction Rate": -40.50,
"Ops Target Reduction Rate": -40.50
},
{
"Year": "2029/30",
"Cap Do Nothing Intensity": 3.17,
"Ops Do Nothing Intensity": 3.91,
"Cap Target Reduction Rate": -60.00,
"Ops Target Reduction Rate": -20.00
"Cap Target Reduction Rate": -45.00,
"Ops Target Reduction Rate": -45.00
},
{
"Year": "2030/31",
"Cap Do Nothing Intensity": 3.17,
"Ops Do Nothing Intensity": 3.91,
"Cap Target Reduction Rate": -63.00,
"Ops Target Reduction Rate": -22.50
"Cap Target Reduction Rate": -49.50,
"Ops Target Reduction Rate": -49.50
},
{
"Year": "2031/32",
"Cap Do Nothing Intensity": 3.17,
"Ops Do Nothing Intensity": 3.91,
"Cap Target Reduction Rate": -63.00,
"Ops Target Reduction Rate": -25.00
"Cap Target Reduction Rate": -54.00,
"Ops Target Reduction Rate": -54.00
},
{
"Year": "2032/33",
"Cap Do Nothing Intensity": 3.17,
"Ops Do Nothing Intensity": 3.91,
"Cap Target Reduction Rate": -63.00,
"Ops Target Reduction Rate": -27.50
"Cap Target Reduction Rate": -58.50,
"Ops Target Reduction Rate": -58.50
}
]
}
12 changes: 6 additions & 6 deletions spec/presenters/pafs_core/carbon_impact_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@

describe "#capital_carbon_target" do
it "calculates target with reduction rate applied" do
# 9000 * 3.27 * (1 + (-0.4136)) / 10000 = 9000 * 3.27 * 0.5864 / 10000
expect(presenter.capital_carbon_target.round(4)).to eq(1.7258)
# 9000 * 3.27 * (1 + (-0.225)) / 10000 = 9000 * 3.27 * 0.775 / 10000
expect(presenter.capital_carbon_target.round(4)).to eq(2.2808)
end
end

Expand All @@ -174,8 +174,8 @@
end

it "calculates target with reduction rate applied" do
# 50000 * 3.91 * (1 + (-0.1)) / 10000 = 50000 * 3.91 * 0.9 / 10000
expect(presenter.operational_carbon_target).to eq(17.595)
# 50000 * 3.91 * (1 + (-0.27)) / 10000 = 50000 * 3.91 * 0.73 / 10000
expect(presenter.operational_carbon_target).to eq(14.2715)
end
end

Expand Down Expand Up @@ -369,7 +369,7 @@

describe "#display_capital_carbon_target" do
it "returns formatted carbon target with units" do
expect(subject.display_capital_carbon_target).to eq("1.73 tonnes")
expect(subject.display_capital_carbon_target).to eq("2.28 tonnes")
end

it "returns 'not provided' when start_construction_year is nil" do
Expand Down Expand Up @@ -405,7 +405,7 @@
describe "#display_operational_carbon_target" do
it "returns formatted carbon target with units" do
allow(project).to receive(:carbon_operational_cost_forecast).and_return(12_345)
expect(subject.display_operational_carbon_target).to eq("4.34 tonnes")
expect(subject.display_operational_carbon_target).to eq("3.52 tonnes")
end

it "returns 'not provided' if operational_total_project_funding is nil" do
Expand Down
Loading