API Reference

This page lists the main EnergyPathway-specific API. EnergyPathway also re-exports the common Nosy API for components, nodes, snapshots, carriers, metrics, and optimization.

Options and Path Objects

EnergyPathway.PathOptType
PathOpt(years; discountrate=0.05, baseyear=first(years), endyear=last(years), mesh=TimeMesh(), ini=[])
PathOpt(years, discountrate, baseyear, endyear, mesh; ini=[])

Temporal options for an EnergyPathway model.

years are the snapshot years. mesh can be one TimeMesh shared by all snapshots or a dictionary mapping each snapshot year to a TimeMesh. ini describes historical capacity installed before the first snapshot year.

source
EnergyPathway.InitialCapacityType
InitialCapacity(entries)

Historical capacity indexed by installation year.

entries can be tuples (year, cname, capacity, lifetime) or named tuples with fields year, cname, capacity, and lifetime.

source
EnergyPathway.HistoricalCapacityType
HistoricalCapacity(cname, capacity, lifetime)

Historical installed capacity for component cname. capacity uses the same unit as the component capacity and lifetime is the technical lifetime in years.

source
EnergyPathway.PathType
Path(optimizer, opt::PathOpt)

Return a multi-year pathway made of one Nosy Snapshot per snapshot year and one shared JuMP model.

source
EnergyPathway.PathSimType
PathSim(model, opt; simkwargs...)

Shared simulation state for a Path.

model follows Nosy's Sim constructor: pass either an existing JuMP model or an optimizer constructor. When an optimizer constructor is passed, Nosy handles constraint scaling.

source
EnergyPathway.addsnapshot!Function
addsnapshot!(path, year; mesh=nothing)
addsnapshot!(path, snapshot, year)

Add a snapshot year to path and return the added snapshot.

The first method creates an empty Nosy Snapshot using the pathway's shared JuMP model. The second method registers an existing snapshot; it must use the same JuMP model as the pathway.

source

Year Helpers

EnergyPathway.firstyearFunction
firstyear(p::Path)

Return the first year of the Path, considering both initialized capacities and snapshot years.

source
EnergyPathway.alltechFunction
alltech(path; cwith=[], cwithout=[], nwith=[], nwithout=[])

Return sorted component names appearing in historical capacity or snapshots. Optional filters are forwarded to Nosy's node and component tag queries.

source

Dynamic Behaviors

EnergyPathway.VariableDeploymentType
VariableDeployment(pname::String; lb::Number=0., ub::Number=Inf)

Return a VariableDeployment behavior data, associated with port name pname and modifier modifier. Optional parameters:

  • lb: lower bound
  • ub: upper bound
source
EnergyPathway.FixedDeploymentType
FixedDeployment(pname::String; lb::Number=0., ub::Number=Inf)

Return a FixedDeployment behavior data, associated with port name pname and modifier modifier. Optional parameters:

  • lb: lower bound
  • ub: upper bound
source
EnergyPathway.VariableRetirementType
VariableRetirement(pname::String; lb::Number=0., ub::Number=Inf)

Return a VariableRetirement behavior data, associated with port name pname and modifier modifier. Optional parameters:

  • lb: lower bound
  • ub: upper bound
source
EnergyPathway.FixedRetirementType
FixedRetirement(pname::String; lb::Number=0., ub::Number=Inf)

Return a FixedRetirement behavior data, associated with port name pname and modifier modifier. Optional parameters:

  • lb: lower bound
  • ub: upper bound
source
EnergyPathway.SingleCostType
SingleCost(type::Symbol, operation::Symbol, pname::String, modifier::Function, val::Number, profile::Union{Nothing,AbstractDict{<:Int,<:Number}})

Return a SingleCost behavior data, associated with port name pname, modifier modifier and fixed value val.

source

Metrics

Nosy.capacityFunction
capacity(path, cname, year)

Return the installed capacity of component cname in year.

Before the first snapshot year, this is based on historical capacity. Between snapshot years, EnergyPathway uses the latest previous snapshot. After the model horizon, capacity is zero.

source
EnergyPathway.singlecostFunction
singlecost(path, cname, year[, type])

Return discounted one-time costs for component cname in year. If type is provided, only costs tagged with that symbol are included.

source
Nosy.costFunction
cost(path, cname, year[, type])

Return discounted total cost for component cname in year.

source
Nosy.fixedcostFunction
fixedcost(path, cname, year[, type])

Return discounted fixed operating costs for component cname in year.

source
Nosy.variablecostFunction
variablecost(path, cname, year[, type])

Return discounted variable operating costs for component cname in year.

source
Nosy.tableFunction
table(path, metric; removenothing=true)

Return a DataFrame containing metric(path, component_name, year) for every year in allyears(path) and every technology in alltech(path).

Rows are pathway years. The first column is year; technology names are the remaining columns. If removenothing is true, technology columns whose metric values are all nothing are omitted.

source