Function reference
NEMO provides several functions intended for end users - these are documented below. There are also a number of internal functions in NEMO that are documented in the program's Julia code.
calculatescenario
convertscenariounits
NemoMod.convertscenariounits — Function
convertscenariounits(
path::String;
energy_multiplier::Float64 = 1.0,
power_multiplier::Float64 = 1.0,
cost_multiplier::Float64 = 1.0,
emissions_multiplier::Float64 = 1.0,
quiet::Bool = false
)Converts units of measure in the scenario database at path. Quantities denominated in energy units are multiplied by energy_multiplier, quantities denominated in power units are multiplied by power_multiplier, quantities denominated in cost units are multiplied by cost_multiplier, and quantities denominated in emissions units are multiplied by emissions_multiplier. The quiet argument suppresses non-essential status messages.
This function assumes that consistent energy and power units are used across regions, and it converts both parameter and variable tables. It also converts default values in the DefaultParams table.
createnemodb
NemoMod.createnemodb — Function
createnemodb(path::String;
defaultvals::Dict{String, Float64} = Dict{String, Float64}(),
foreignkeys::Bool = false)Creates an empty NEMO scenario database in SQLite. If the specified database already exists, drops and recreates NEMO tables in the database.
Arguments
path::String: Full path to the scenario database, including the file name.defaultvals::Dict{String, Float64} = Dict{String, Float64}(): Dictionary of parameter table names and default values forvalcolumn.foreignkeys::Bool = false: Indicates whether to create foreign keys within the database.
dropdefaultviews
NemoMod.dropdefaultviews — Function
dropdefaultviews(db::SQLite.DB)Drops all views in db whose name ends with ""_def"".
dropresulttables
NemoMod.dropresulttables — Function
dropresulttables(db::SQLite.DB, quiet::Bool = true)Drops all tables in db whose name begins with ""v"" or ""sqlite_stat"" (both case-sensitive). The quiet parameter determines whether most status messages are suppressed.
logmsg
NemoMod.logmsg — Function
logmsg(msg::String, suppress=false, dtm=now()::DateTime)Prints a log message (msg) to STDOUT. The message is suppressed if suppress == true. dtm determines the date and time included in the printed message.
Examples
julia> using Dates
julia> logmsg("Test message", false, DateTime(2020))
2020-01-Jan 00:00:00.000 Test messagesetparamdefault
NemoMod.setparamdefault — Function
setparamdefault(db::SQLite.DB, table::String, val::Float64)Sets the default value for a parameter table in a NEMO scenario database.
Arguments
db::SQLite.DB: Scenario database containing the parameter table.table::String: Table name (case-sensitive).val::Float64: Parameter value (must be a floating-point number).
find_infeasibilities
NemoMod.find_infeasibilities — Function
find_infeasibilities(m::JuMP.Model,
silent_solver::Bool=false
)Returns a Vector of constraint data for constraints in m that cause infeasibility. silent_solver suppresses output from the solver for m.
Arguments
m::JuMP.Model: Model to check for infeasibility. Should be a NEMO model created withcalculatescenario.silent_solver::Bool = false: Suppresses output from the solver form.
convert_ini_to_toml
NemoMod.convert_ini_to_toml — Function
convert_ini_to_toml(ini_path::String, toml_path::String, quiet::Bool = false)Converts a configuration file from NEMO 2.2 or earlier (in INI format) to the TOML format used in NEMO version 2.3 and later.
Arguments
ini_path::String: Path to the INI file to be converted.toml_path::String: Path where the new TOML file should be saved.quiet::Bool = false: Suppresses low-priority status messages (which are otherwise printed toSTDOUT).