Internal API
Dieter.calc_inv_storages! — MethodCalculate the amortised investment cost of technologies from capital costs.
Dieter.calc_inv_tech! — MethodCalculate the amortised investment cost of technologies from capital costs.
Dieter.calc_mc! — MethodCalculated marginal costs for plants including variable costs
Dieter.convert_jump_container_to_df — MethodReturns a DataFrame with the values of the variables from the JuMP container var. The column names of the DataFrame can be specified for the indexing columns in dim_names, and the name of the data value column by a Symbol value_col e.g. :Value
Dieter.initialise_data_dir_structure — MethodInitialise a basic file structure for accessing the model data. The default directory structure is: <datapath>/ ├── base │ ├── availability.csv │ ├── load.csv │ ├── storages.csv │ └── technologies.csv ├── ev │ ├── ev.csv │ ├── evdemand.csv │ └── evpower.csv ├── h2 │ └── h2technologies.csv └── heat ├── buildings.csv ├── dhwdemand.csv ├── heat.csv ├── heatdemand.csv ├── heattechnologies.csv └── temperature.csv
Dieter.initialise_set_relation_data! — MethodCreate the mathematical set relations for doing set-correspondences in models.
Dieter.isDictAllMissing — MethodCheck if a Dictionary has all missing values; if so, return true
Dieter.map_dfheader_to_col — MethodCreate a Dict from a DataFrame with the DataFrame column-names as keys and columns as values.
Dieter.map_idcol — MethodReturn a dictionary of Dicts from a DataFrame with column-names as keys, and each Dict has a key-value pair of idcols => data-value. Column symbols listed in `skipcols` are skipped.
Examples
julia> df = DataFrame(x=1:4, y=11:14, z=2:5)
4×3 DataFrame
│ Row │ x │ y │ z │
│ │ Int64 │ Int64 │ Int64 │
├─────┼───────┼───────┼───────┤
│ 1 │ 1 │ 11 │ 2 │
│ 2 │ 2 │ 12 │ 3 │
│ 3 │ 3 │ 13 │ 4 │
│ 4 │ 4 │ 14 │ 5 │
julia> map_idcol(df, 1, skip_cols=[:z])
Dict{Symbol,Dict} with 1 entry:
:y => Dict(4=>14,2=>12,3=>13,1=>11)Dieter.parse_base_technologies! — MethodExpected Dieter model parameters read into dtr.parameters: ExistingCapacity, FuelCost, FixedCost, VariableCost, OvernightCost, CurtailmentCost, LoadIncreaseCost, LoadDecreaseCost, Lifetime, MaxCapacity, MaxEnergy, TechTypeCategory, Renewable, Dispatchable, FuelSource, Efficiency, CarbonContent, CO2_price
Dieter.parse_file — MethodParse a given data file and return the desired data in a DataFrame.
Dieter.split_df_tuple — Methodsplit_df_tuple is a function that transforms a DataFrame with a Tuple{N,M...} type column. It outputs an augmented DataFrame with the tuples split into two columns of type N, M... resp.
The function splits the column InputCol of type Tuple into individual columns named with OutputCols vector of Symbols. Note that the Symbols in OutputCols need to be of the name length and order to correspond to the splitting Tuples.
Arguments
df: aDataFrameInputCol: aSymbolfor a column of typeTuple{Types...}OutputCols: aVectorofSymbols for new column names,
Returns
::DataFrame
Examples
``` julia> using DataFramesMeta, DataFrames
julia> df = DataFrame(A_N = [("a",1),("b",2)], V = [8,9]);
julia> splitdftuple(df, :AN, [:A, :N]) 2×4 DataFrame │ Row │ AN │ V │ A │ N │ │ │ Tuple… │ Int64 │ String │ Int64 │ ├─────┼──────────┼───────┼────────┼───────┤ │ 1 │ ("a", 1) │ 8 │ a │ 1 │ │ 2 │ ("b", 2) │ 9 │ b │ 2 │ ```
Dieter.table2df — MethodFunction to convert an Array{Any,2} with a header row of column name strings to a DataFrame
- Thanks: https://stackoverflow.com/questions/25894634/dataframe-from-array-with-header
Dieter.tableToDict — MethodtableToDict(tab::Array{Any,2}; keycols::Array{Int64,1}=[1])Create a dictionary from an array in table form, where the table tab has:
- key-index or indices given in the
keycolarray (integer column position), and - the column names for data appear in the first row.
Dieter.update_dict! — MethodUpdate a data Dict, merging the data if present, adding data if not present
Dieter.@def — MacroThe def macro is used to build other macros that can insert the same block of Julia code into different parts of a program. This is macro is used to generate a standard set of fields inside a model type hierarchy. (Thanks: InfrastructureModels.jl; see http://www.stochasticlifestyle.com/type-dispatch-design-post-object-oriented-programming-julia/)
Dieter.@dm_fields — MacroA macro for adding the basic fields to an AbstractDieterModel type definition.