Skip to content

Commit

Permalink
quick hack for examples indirect
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamstark committed Aug 31, 2023
1 parent d2abe61 commit 66780ee
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ExampleHouseholdGetter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ using .Definitions
using .ModelHousehold: Household
using .ConsumptionData: find_consumption_for_hh!
using .HouseholdFromFrame: load_hhld_from_frame
using .RunSettings: Settings
using .RunSettings

export initialise, get_household

Expand All @@ -27,10 +27,10 @@ function find_consumption_for_example!( hh, settings )
sv_hid = hh.hid
sv_data_year = hh.data_year
hh.hid = 1
hh.data_year = 2020

find_consumption_for_hh!( hh, settings, 1 )

hh.data_year = 2021
if settings.indirect_method == matching
find_consumption_for_hh!( hh, settings, 1 )
end
hh.hid = sv_hid
hh.data_year = sv_data_year
end
Expand Down
11 changes: 11 additions & 0 deletions test/consumption_data_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ using .STBParameters
using .Uprating
using .Utils
using .Monitor: Progress
using .ExampleHouseholdGetter

settings = Settings()

Expand Down Expand Up @@ -52,6 +53,16 @@ end
end
end

@testset "test examples consumption" begin
settings = get_all_uk_settings_2023() # so, with expenditure == matching jammed on
@test settings.indirect_method == matching
keys = ExampleHouseholdGetter.initialise( settings )
for k in keys
hh = ExampleHouseholdGetter.get_household( k )
@test ! isnothing(hh.expenditure)
end
end

@testset "Indirect Parameters" begin
println( "default_exempt = $(DEFAULT_EXEMPT)")
println( "default_reduced_rate = $(DEFAULT_REDUCED_RATE)")
Expand Down

0 comments on commit 66780ee

Please sign in to comment.