Build
SLiDE.build_eem
— Methodbuild_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:
SLiDE.scale_sector
SLiDE.partition_seds
SLiDE.disaggregate_energy!
SLiDE.partition_co2!
SLiDE.calibrate_regional
Arguments
dataset::Dataset
identifier
Returns
d::Dict
of model parametersset::Dict
of Arrays describing parameter indices (years, regions, goods, sectors, etc.)
SLiDE.build_io
— Methodbuild_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:
Arguments
dataset::Dataset
identifier
Returns
d::Dict
of model parametersset::Dict
of Arrays describing parameter indices (years, regions, goods, sectors, etc.)
SLiDE.data_saved
— MethodThis function returns true if parameters and sets have already been generated, and their values saved, for the given dataset
.
SLiDE.datapath
— Methoddatapath(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.
SLiDE.describe
— Methoddescribe!(set::Dict, dataset::Dataset)
describe(dataset::Dataset)
Arguments
dataset::Dataset
orstep::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 fieldparameter
.
SLiDE.list
— Methodlist!(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 updatedataset::Dataset
orstep::Symbol
Returns
lst::AbstractArray
of parameters added toset
SLiDE.overwrite
— Methodoverwrite(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.
SLiDE.read_build
— Methodread_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
identifiersubset::String
: Internally-passed parameter indicating the type of information to save (set, parameter, or build step)
Returns
d::Dict{Symbol,DataFrame}
if reading parameters ord::Dict{Any,Array}
if reading sets
SLiDE.read_input!
— Methodread_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. Ifdataset.step
does not require input data, return Dict().
SLiDE.read_map
— Methodread_map()
Returns
d::Dict
of EEM mapping datasets.
SLiDE.read_set
— Methodread_set()
SLiDE.set_sector!
— MethodSLiDE.write_build!
— Methodwrite_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
identifierd::Dict
of information to write
Returns
d::Dict
: filtered dictionary
SLiDE.write_build
— Methodwrite_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
: filenamedf::DataFrame
orlst::AbstractArray
of data to write