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.PathOpt — Type
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.
EnergyPathway.InitialCapacity — Type
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.
EnergyPathway.HistoricalCapacity — Type
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.
EnergyPathway.Path — Type
Path(optimizer, opt::PathOpt)Return a multi-year pathway made of one Nosy Snapshot per snapshot year and one shared JuMP model.
EnergyPathway.PathSim — Type
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.
EnergyPathway.MetaSnapshot — Type
MetaSnapshot(year, snap)A Nosy Snapshot tagged with its pathway year.
EnergyPathway.getsnapshot — Function
getsnapshot(path, year)Return the Nosy Snapshot for snapshot year.
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.
Year Helpers
EnergyPathway.years — Function
years(opt::PathOpt)Return the sorted snapshot years configured in opt.
EnergyPathway.mesh — Function
mesh(opt::PathOpt, year)Return the TimeMesh associated with snapshot year.
EnergyPathway.firstyear — Function
firstyear(p::Path)Return the first year of the Path, considering both initialized capacities and snapshot years.
EnergyPathway.lastyear — Function
lastyear(path)Return the final model year configured in path.
EnergyPathway.allyears — Function
allyears(path)Return the full model-year range from firstyear(path) to lastyear(path).
EnergyPathway.firstsnapshotyear — Function
firstsnapshotyear(path)Return the first snapshot year.
EnergyPathway.lastsnapshotyear — Function
lastsnapshotyear(path)Return the last snapshot year.
EnergyPathway.snapshotyears — Function
snapshotyears(path)Return the sorted vector of snapshot years.
EnergyPathway.snapshotyear — Function
snapshotyear(path, year)Return the latest snapshot year less than or equal to year.
EnergyPathway.alltech — Function
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.
Dynamic Behaviors
EnergyPathway.VariableDeployment — Type
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
EnergyPathway.FixedDeployment — Type
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
EnergyPathway.VariableRetirement — Type
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
EnergyPathway.FixedRetirement — Type
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
EnergyPathway.Lifetime — Type
Lifetime(years::Int)Return a Lifetime behavior data.
EnergyPathway.SingleCost — Type
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.
Metrics
Nosy.capacity — Function
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.
EnergyPathway.deployment — Function
deployment(path, cname, year)Return the total capacity of component cname deployed in year.
EnergyPathway.retirement — Function
retirement(path, cname, year)Return the total capacity of component cname retired in year.
EnergyPathway.singlecost — Function
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.
Nosy.fixedcost — Function
fixedcost(path, cname, year[, type])Return discounted fixed operating costs for component cname in year.
Nosy.variablecost — Function
variablecost(path, cname, year[, type])Return discounted variable operating costs for component cname in year.
Nosy.table — Function
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.
EnergyPathway.discount — Function
discount(opt, year)Return the discount factor from year to opt.baseyear.