Skip to content

Commit aadc7c5

Browse files
committed
lint: JuliaFormetter
1 parent b6b1c73 commit aadc7c5

10 files changed

+26
-22
lines changed

docs/make.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ makedocs(
3030
],
3131
)
3232

33-
deploydocs(;repo = "github.com/bancaditalia/ABCredit.jl.git")
33+
deploydocs(; repo = "github.com/bancaditalia/ABCredit.jl.git")

examples/compare_histograms.jl

+15-10
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using ABCredit, Statistics, Plots, DelimitedFiles
66

77
# install the HPFilter and KernelDensity packages
88
using Pkg
9-
Pkg.add(url="https://github.com/sdBrinkmann/HPFilter.jl")
9+
Pkg.add(url = "https://github.com/sdBrinkmann/HPFilter.jl")
1010
Pkg.add("KernelDensity")
1111
using HPFilter, KernelDensity
1212

@@ -23,10 +23,10 @@ T = 1000
2323
d = ABCredit.run_one_sim!(model, T; seed = 100, burn_in = 300)
2424

2525
# select some variables
26-
Y = d.Y_real;
27-
P = d.gdp_deflator;
28-
I = d.Investment;
29-
C = d.consumption;
26+
Y = d.Y_real;
27+
P = d.gdp_deflator;
28+
I = d.Investment;
29+
C = d.consumption;
3030
U = d.Un;
3131

3232
# load the data from FRED saved in the package as an example
@@ -38,16 +38,21 @@ c_real = data[:, 4];
3838
u_real = data[:, 5];
3939

4040
# apply HP filter to the simulated data
41-
y = log.(Y) - HP(log.(Y),1600);
42-
c = log.(C) - HP(log.(C),1600);
43-
invest = log.(I) - HP(log.(I),1600);
41+
y = log.(Y) - HP(log.(Y), 1600);
42+
c = log.(C) - HP(log.(C), 1600);
43+
invest = log.(I) - HP(log.(I), 1600);
4444
u = U;
4545
pi = diff(log.(P)) .- mean((diff(log.(P))));
4646

4747
# plot the histograms of real and simulated data
4848
pdf_sim = kde(u);
4949
pdf_real = kde(u_real);
50-
p1 = plot([pdf_sim.density, pdf_real.density], title = "unemployment rate", titlefont = 10, labels=["simulated" "real"])
50+
p1 = plot(
51+
[pdf_sim.density, pdf_real.density],
52+
title = "unemployment rate",
53+
titlefont = 10,
54+
labels = ["simulated" "real"],
55+
)
5156

5257
pdf_sim = kde(y);
5358
pdf_real = kde(y_real);
@@ -65,4 +70,4 @@ pdf_sim = kde(invest);
6570
pdf_real = kde(invest_real);
6671
p5 = plot([pdf_sim.density, pdf_real.density], title = "investment gap", titlefont = 10, legend = :none)
6772

68-
plot(p1, p2, p3, p4, p5, layout = (2, 3))
73+
plot(p1, p2, p3, p4, p5, layout = (2, 3))

main.jl

-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ p21 = plot(d.reserves, title = "RESERVES", titlefont = 10)
4848
p21 = plot(d.deposits, title = "DEPOSITS", titlefont = 10)
4949
plot(p1, p2, p3, p4, p5, p6, p7, p8, p9, layout = (3, 3), legend = false)
5050
plot(p10, p11, p12, p13, p14, p15, p16, p17, p18, layout = (3, 3), legend = false)
51-

src/markets/credit_market.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ function firm_gets_credit!(firm::AbstractConsumptionFirm, model::AbstractModel)
2828
pr = _compute_bankruptcy_probability(firm.lev, model.params[:b1], model.params[:b2])
2929

3030
#proposed rate depends on the estimated bankruptcy probability
31-
proposed_rate = _compute_proposed_rate(pr, model.params[:mu], model.params[:theta], model.params[:interest_rate])
31+
proposed_rate =
32+
_compute_proposed_rate(pr, model.params[:mu], model.params[:theta], model.params[:interest_rate])
3233

3334
#the bank gives a maximum credit depending on maximum expected loss
3435
maxL = _compute_max_loan(firm.deb, model.params[:phi], model.bank.E, model.bank.E_threshold, pr)

src/model_init/init.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function initialise_model(W, F, N; params = ABCredit.PARAMS_ORIGINAL)
2828
params[:init_K] = 10.0
2929
params[:maastricht] = false
3030
params[:E_threshold_scale] = 0.0
31-
31+
3232
workers = ABCredit.initialise_workers(params)
3333

3434
### INITIALISE CAPITAL FIRMS AND CONSUMPTION FIRMS ###

src/params/standard_params.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,6 @@ end
105105

106106
const PARAMS_RL = params
107107

108-
real_data = readdlm(joinpath(dir, "FRED_data.txt"), ' ', Float64, skipstart=1)
108+
real_data = readdlm(joinpath(dir, "FRED_data.txt"), ' ', Float64, skipstart = 1)
109109

110-
const REAL_DATA_EXAMPLE = real_data
110+
const REAL_DATA_EXAMPLE = real_data

test/consumption_goods_market.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ using ABCredit, Test
2929
firm.Yd = 0 #record demand
3030
end
3131

32-
ABCredit.consumption_goods_market!(consumer,cons_firms, model)
32+
ABCredit.consumption_goods_market!(consumer, cons_firms, model)
3333

3434
@test consumer.PA == 2.0 - 0.25 * F
3535
@test consumer.cons_budget == 1.0 - 0.25 * F
@@ -67,4 +67,4 @@ using ABCredit, Test
6767
@test endQ == [2.0 / 5.0, 0.0]
6868
@test endYd == [2 / 5, 0]
6969

70-
end
70+
end

test/main.jl

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ d = ABCredit.run_one_sim!(model, T; seed = seed);
2121

2222
# ABCredit.save_csv(d, dir*"/fixtures/data_fixed_seed_$seed.csv")
2323

24-
data_expected = ABCredit.load_csv( dir*"/fixtures/data_fixed_seed_$seed.csv")
24+
data_expected = ABCredit.load_csv(dir * "/fixtures/data_fixed_seed_$seed.csv")
2525

2626
for name in fieldnames(typeof(d))
2727
@test isapprox(getfield(d, name), getfield(data_expected, name), rtol = 1e-2)
2828
end
29-

test/stock_flow_consistency.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ using ABCredit, Test
2424
@test isapprox(init_money, money, atol = 1e-5)
2525
end
2626

27-
end
27+
end

test/stock_flow_consistency_detailed.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,4 @@ using ABCredit, Test
152152

153153
end
154154

155-
end
155+
end

0 commit comments

Comments
 (0)