Build

SLiDE.build_eemMethod
build_eem(dataset::Dataset)

If dataset.eem=true, continue the SLiDE buildstream for the Energy-Environment Module. If the dataset has already been generated and saved, the function will read and return those values.

Otherwise, it will execute the build routine via the following functions:

  1. SLiDE.scale_sector
  2. SLiDE.partition_seds
  3. SLiDE.disaggregate_energy!
  4. SLiDE.partition_co2!
  5. SLiDE.calibrate_regional

Arguments

  • dataset::Dataset identifier

Returns

  • d::Dict of model parameters
  • set::Dict of Arrays describing parameter indices (years, regions, goods, sectors, etc.)
source
SLiDE.build_ioMethod
build_io(dataset::Dataset)

If the dataset has already been generated and saved, the function will read and return those values.

Otherwise, it will read input data from the /SLIDE_DIR/data/input/ directory and execute the four steps of the SLiDE buildstream via the following functions:

  1. SLiDE.partition_bea
  2. SLiDE.calibrate_national
  3. SLiDE.share_region
  4. SLiDE.disaggregate_region

Arguments

  • dataset::Dataset identifier

Returns

  • d::Dict of model parameters
  • set::Dict of Arrays describing parameter indices (years, regions, goods, sectors, etc.)
source
SLiDE.data_savedMethod

This function returns true if parameters and sets have already been generated, and their values saved, for the given dataset.

source
SLiDE.datapathMethod
datapath(dataset::Dataset)

This function returns the path to the directory location specified by dataset.name/dataset.build/dataset.step. Building a dataset called dataset.name with dataset.save_build=true will produce files in the following structure. /SLIDE_DATA/data/dataset.name/ ├── eem/ | ├── parameters/ | └── sets/ ├── io/ | ├── parameters/ └───└── sets/

Arguments

  • dataset::String: Dataset identifier

Returns

  • dir::String = /path/to/dataset
    • SLIDE_DIR is the path to the location of the SLiDE.jl package on the user's machine.
    • The default dataset identifier is state_model. This dataset includes all U.S. states and summary-level sectors and goods.
source
SLiDE.describeMethod
describe!(set::Dict, dataset::Dataset)
describe(dataset::Dataset)

Arguments

  • dataset::Dataset or step::String/Symbol specifying the parameters to describe

Returns

  • d::Dict{Symbol,Parameter} of Parameters relevant to the specified data step. The dictionary key is consistent the value's field parameter.
source
SLiDE.listMethod
list!(set::Dict, dataset::Dataset)

This function adds a list of the parameters described by SLiDE.describe to set, identified by the key :step_list.

Arguments

  • set::Dict to update
  • dataset::Dataset or step::Symbol

Returns

  • lst::AbstractArray of parameters added to set
source
SLiDE.overwriteMethod
overwrite(dataset::Dataset)

This function executes dataset.overwrite=true. If a directory exists at dataset.name/dataset.build, and

  • Output data HAS been generated, append the date this directory was created and move it.
  • Output data HAS NOT yet been generated, remove the directory and start over.
source
SLiDE.read_buildMethod
read_build(dataset::Dataset)

This function reads data from or for the specified dataset if this information has previously been generated and saved, read the saved data. If this information has NOT yet been generated, read input data using SLiDE.read_input!.

Arguments

  • dataset::Dataset identifier
  • subset::String: Internally-passed parameter indicating the type of information to save (set, parameter, or build step)

Returns

  • d::Dict{Symbol,DataFrame} if reading parameters or d::Dict{Any,Array} if reading sets
source
SLiDE.read_input!Method
read_input!(dataset::Dataset)

Read input data for the specified dataset.build/dataset.step and set dataset.step="input to indicate further action is required.

Arguments

  • dataset::Dataset identifier

Returns

  • d::Dict of input data. If dataset.step does not require input data, return Dict().
source
SLiDE.write_build!Method
write_build!(dataset::Dataset, d::Dict)

This function filters the contents of the input dictionary d to include only relevant files using SLiDE.filter_with! and writes set lists and parameter DataFrames to csv files in the directory named by SLiDE.datapath and named for their associated dictionary key.

Arguments

  • dataset::Dataset identifier
  • d::Dict of information to write

Returns

  • d::Dict: filtered dictionary
source
SLiDE.write_buildMethod
write_build(path::String, k::Symbol, df::DataFrame)
write_build(path::String, k::Symbol, lst::AbstractArray)

This is a helper function for SLiDE.write_build!.

Arguments

  • path::String = /path/to/dataset
  • k: filename
  • df::DataFrame or lst::AbstractArray of data to write
source