From 4b947b1ca8490ca4e176da4088a645fa5e856554 Mon Sep 17 00:00:00 2001 From: Aldo Date: Mon, 13 May 2024 14:49:43 +0200 Subject: [PATCH] test: bring accounting identities precision from 1e-9 to 1e-8 to avoid failure due to numerics --- test/accounting_identities.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/accounting_identities.jl b/test/accounting_identities.jl index 3cbd05d..402d36b 100644 --- a/test/accounting_identities.jl +++ b/test/accounting_identities.jl @@ -18,14 +18,14 @@ using Test # income accounting and production accounting should be equal zero = sum(data.nominal_gva - data.compensation_employees - data.operating_surplus - data.taxes_production) - @test isapprox(zero, 0.0, atol = 1e-9) + @test isapprox(zero, 0.0, atol = 1e-8) # compare nominal_gdp to total expenditure zero = sum( data.nominal_gdp - data.nominal_household_consumption - data.nominal_government_consumption - data.nominal_capitalformation - data.nominal_exports + data.nominal_imports, ) - @test isapprox(zero, 0.0, atol = 1e-9) + @test isapprox(zero, 0.0, atol = 1e-8) zero = sum( data.real_gdp - data.real_household_consumption - data.real_government_consumption - data.real_capitalformation - data.real_exports + data.real_imports, @@ -34,10 +34,10 @@ using Test # accounting identity of balance sheet of central bank zero = model.cb.E_CB + model.rotw.D_RoW - model.gov.L_G + model.bank.D_k - @test isapprox(zero, 0.0, atol = 1e-9) + @test isapprox(zero, 0.0, atol = 1e-8) # accounting identity of balance sheet of commercial bank tot_D_h = sum(model.w_act.D_h) + sum(model.w_inact.D_h) + sum(model.firms.D_h) + model.bank.D_h zero = sum(model.firms.D_i) + tot_D_h + sum(model.bank.E_k) - sum(model.firms.L_i) - model.bank.D_k - @test isapprox(zero, 0.0, atol = 1e-9) + @test isapprox(zero, 0.0, atol = 1e-8) end \ No newline at end of file