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
createnemodb
NemoMod.createnemodb
— Functioncreatenemodb(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 forval
column.foreignkeys::Bool = false
: Indicates whether to create foreign keys within the database.
dropdefaultviews
NemoMod.dropdefaultviews
— Functiondropdefaultviews(db::SQLite.DB)
Drops all views in db
whose name ends with ""_def"".
dropresulttables
NemoMod.dropresulttables
— Functiondropresulttables(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
— Functionlogmsg(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 message
setparamdefault
NemoMod.setparamdefault
— Functionsetparamdefault(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).