Skip to content

Commit

Permalink
more artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamstark committed Nov 14, 2024
1 parent 807b814 commit 8de5b5a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 13 deletions.
32 changes: 32 additions & 0 deletions Artifacts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ lazy = true
sha256 = "5bc1607882203127bd0c13ddeeb22deb0f51156cd65aa9f4c14af3c1df175ef2"
url = "https://virtual-worlds.biz/artifacts//model-data-scotland-2015-2021-v2.tar.gz"

[scottish-lcf-expenditure]
git-tree-sha1 = "bf18d73b3f48bea065528bf63e43e522f85f5e4b"
lazy = true

[[scottish-lcf-expenditure.download]]
sha256 = "66231a2f9d4cf75d373812e6969e40ffe1dd386dc0b8c577aa3ed67f75e4cc1c"
url = "https://virtual-worlds.biz/artifacts//scottish-lcf-expenditure.tar.gz"

[scottish-synthetic-data]
git-tree-sha1 = "2bcdf3e7a62bb4bcd282f05008adbe6b63228ab9"
lazy = true
Expand All @@ -38,6 +46,14 @@ lazy = true
sha256 = "701ac0c44fe997b7d4e252dc2bee65e2c8ae2cdb2b6975cf5ae8134c0188e2d5"
url = "https://virtual-worlds.biz/artifacts//not-created-yet.tar.gz"

[scottish-synthetic-expenditure]
git-tree-sha1 = "8fb7e3a1d9da7de2a9b1f91a05a8c431f8ab4526"
lazy = true

[[scottish-synthetic-expenditure.download]]
sha256 = "38f4f588974a40102a4b9998f9c0cea15001ec3d59f3e6b329a9659201cdb4c0"
url = "https://virtual-worlds.biz/artifacts//scottish-synthetic-expenditure.tar.gz"

[uk-frs-data]
git-tree-sha1 = "8891ef02ea5dada4ec097ce0a183502cfafb995f"
lazy = true
Expand All @@ -46,10 +62,26 @@ lazy = true
sha256 = "8e3efc98a687441085be9ef5e53b663c2bd9abf6e300efa2dd6edb29993d8777"
url = "https://virtual-worlds.biz/artifacts//model-data-2021-2021-v2.tar.gz"

[uk-lcf-expenditure]
git-tree-sha1 = "75780fa203742d35c05e345ea26daa4b2e803280"
lazy = true

[[uk-lcf-expenditure.download]]
sha256 = "3cc8b249fb7e9e8e50b2ac719165d4dbe6e79ddbd9a57f444b9e0a7fc0f11f4c"
url = "https://virtual-worlds.biz/artifacts//uk-lcf-expenditure.tar.gz"

[uk-synthetic-data]
git-tree-sha1 = "2bcdf3e7a62bb4bcd282f05008adbe6b63228ab9"
lazy = true

[[uk-synthetic-data.download]]
sha256 = "701ac0c44fe997b7d4e252dc2bee65e2c8ae2cdb2b6975cf5ae8134c0188e2d5"
url = "https://virtual-worlds.biz/artifacts//not-created-yet.tar.gz"

[uk-synthetic-expenditure]
git-tree-sha1 = "8fb7e3a1d9da7de2a9b1f91a05a8c431f8ab4526"
lazy = true

[[uk-synthetic-expenditure.download]]
sha256 = "65593965ef048b2f9144b73e109a7dd25756df491929e63b5ff1b70e808e8d50"
url = "https://virtual-worlds.biz/artifacts//uk-synthetic-expenditure.tar.gz"
9 changes: 6 additions & 3 deletions src/ConsumptionData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ using ArgCheck
using CSV
using DataFrames
using StatsBase
using Pkg, Pkg.Artifacts
using LazyArtifacts

using ScottishTaxBenefitModel
using .Definitions
Expand Down Expand Up @@ -340,16 +342,17 @@ end

"""
FIXME DO FACTOR COSTS!!!!
fixme selectable artifacts
"""
function init( settings :: Settings; reset = false )
if settings.do_indirect_tax_calculations
if(settings.indirect_method == matching) && (reset || (size(EXPENDITURE_DATASET)[1] == 0 )) # needed but uninitialised
global IND_MATCHING
global EXPENDITURE_DATASET
global FACTOR_COST_DATASET
IND_MATCHING = CSV.File( joinpath( data_dir( settings ), "$(settings.indirect_matching_dataframe).tab" )) |> DataFrame
EXPENDITURE_DATASET = CSV.File( joinpath( data_dir( settings ), settings.expenditure_dataset * ".tab")) |> DataFrame
FACTOR_COST_DATASET = CSV.File( joinpath( data_dir( settings ), settings.expenditure_dataset * ".tab" )) |> DataFrame
IND_MATCHING = CSV.File( joinpath( artifact"uk-lcf-expenditure", "matches.tab" )) |> DataFrame
EXPENDITURE_DATASET = CSV.File( joinpath( artifact"uk-lcf-expenditure", "dataset.tab")) |> DataFrame
FACTOR_COST_DATASET = CSV.File( joinpath( artifact"uk-lcf-expenditure", "dataset.tab" )) |> DataFrame
println( EXPENDITURE_DATASET[1:2,:])
uprate_expenditure( settings )
end
Expand Down
14 changes: 4 additions & 10 deletions src/WealthData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,15 @@
This module holds both the data for wealth tax calculations. Quickie pro tem thing
for Northumberland, but you know how that goes..
TODO add mapping for example households.
TODO all uprating is nom gdp for now.
TODO Factor costs for excisable goods and base excisable good parameters.
TODO Better calculation of exempt goods.
TODO Recheck allocations REALLY carefully.
TODO Much more detailed uprating.
TODO costs of spirits etc.
=#
module WealthData

using ArgCheck
using CSV
using DataFrames
using StatsBase
using Pkg, Pkg.Artifacts
using LazyArtifacts

using ScottishTaxBenefitModel
using .Definitions
Expand Down Expand Up @@ -81,8 +75,8 @@ function init( settings :: Settings; reset = false )
if(settings.wealth_method == matching) && (reset || (size(WEALTH_DATASET)[1] == 0 )) # needed but uninitialised
global IND_MATCHING
global WEALTH_DATASET
IND_MATCHING = CSV.File( joinpath( data_dir( settings ), "$(settings.wealth_matching_dataframe).tab" )) |> DataFrame
WEALTH_DATASET = CSV.File( joinpath( data_dir( settings ), settings.wealth_dataset * ".tab"); types=jam_on_float ) |> DataFrame
#IND_MATCHING = CSV.File( joinpath( artifact"uk-was-wealth", "matches.tab" )) |> DataFrame
#WEALTH_DATASET = CSV.File( joinpath( artifact"uk-was-wealth", "data.tab"); types=jam_on_float ) |> DataFrame
uprate_raw_wealth()
println( WEALTH_DATASET[1:2,:])
end
Expand Down

0 comments on commit 8de5b5a

Please sign in to comment.