Skip to content

Commit

Permalink
Merge pull request #5 from uw-windc/merge_data_defines
Browse files Browse the repository at this point in the history
Create a central data defines for the Core module
  • Loading branch information
mitchphillipson authored Nov 20, 2023
2 parents 9444db2 + 1fbb2f5 commit b38fe09
Show file tree
Hide file tree
Showing 16 changed files with 2,497 additions and 2,397 deletions.
3 changes: 3 additions & 0 deletions src/WiNDC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ export load_national_data,load_state_data
include("helper_functions.jl")
include("data/notations.jl")



include("data/core/bea_api/bea_api.jl")

#Models
include("core/nationalmodel.jl")
include("core/state_disaggregation_model.jl")

#Data
include("data/core/core_data_defines.jl")
include("data/core/bea_io/PartitionBEA.jl")
include("data/core/bea_gsp/bea_gsp.jl")
include("data/core/bea_pce/bea_pce.jl")
Expand Down
22 changes: 8 additions & 14 deletions src/data/core/bea_gsp/bea_gsp.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include("./data_defines.jl")
#include("./data_defines.jl")

function load_bea_gsp!(GU,data_dir,gsp_info)

Expand Down Expand Up @@ -172,23 +172,17 @@ function load_raw_bea_gsp(data_dir,years,gsp_data)
end

function clean_raw_bea_gsp(df)
notations = []
#notations = []

push!(notations,notation_link(gsp_states,:state,:region_fullname))
push!(notations,notation_link(gsp_industry_id,:IndustryID,:gsp_industry_id))
push!(notations,notation_link(bea_gsp_map,:ComponentName,:bea_code))
push!(notations,notation_link(bea_gsp_mapsec,:gsp_industry_id,:gdp_industry_id))
#push!(notations,notation_link(gsp_states,:state,:region_fullname))
##push!(notations,notation_link(gsp_industry_id,:IndustryID,:gsp_industry_id))
#push!(notations,notation_link(bea_gsp_mapsec,:IndustryID,:gdp_industry_id))
#push!(notations,notation_link(bea_gsp_map,:ComponentName,:bea_code))

notations = bea_gsp_notations()
df = apply_notations(df,notations)

#df = load_raw_bea_gsp(data_dir,1997:2021,info_dict)

#return df

for notation in notations
df = apply_notation!(df,notation)
end



df = df[!,[:region_abbv,:year,:gdpcat,:i,:units,:value]]

Expand Down
159 changes: 0 additions & 159 deletions src/data/core/bea_gsp/data_defines.jl

This file was deleted.

9 changes: 4 additions & 5 deletions src/data/core/bea_io/PartitionBEA.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include("./bea_api/bea_api.jl")
include("./calibrate.jl")
include("./data_defines.jl")
#include("./data_defines.jl")



Expand Down Expand Up @@ -117,10 +117,9 @@ function _bea_apply_notations!(GU,use,supply)

notations = bea_io_notations()

for notation in notations
use = apply_notation!(use,notation)
supply = apply_notation!(supply,notation)
end
use = apply_notations(use,notations)
supply = apply_notations(supply,notations)


use[!,:industry] = Symbol.(use[!,:industry])
use[!,:commodity] = Symbol.(use[!,:commodity])
Expand Down
129 changes: 0 additions & 129 deletions src/data/core/bea_io/data_defines.jl

This file was deleted.

Loading

0 comments on commit b38fe09

Please sign in to comment.