energyRt 0.90.0 (pre-release)
The first release since 0.50-beta, consolidating the unreleased 0.60-0.80 cycles. The modelling API is the one planned for 1.0; testing and debugging continue. Upgrading from 0.50 is not a drop-in: see Breaking changes.
License
- The per-object timeslice maps (
mTechTimesliceand its siblings,mCommTimeslice,mWeatherTimeslice), the technology activity and output domains (mvTechAct,mvTechOut),meqTechActSngand the availability-factor maps (meqTechAfLo,meqTechAfUp,meqTechAfFx, where the bound is one number per technology, region and year) are defined by a rule, the join of the small tables they are made of, and their tables are dropped at the end ofinterpolate_model(). Readers see the same tuples; the multimod route enumerates the rule itself and the saved scenario no longer carries the tables. The output and single-output domains keep their tables in a model with coarse processes.options(energyRt.map_rules = FALSE)keeps every table;options(energyRt.map_rules_verify = TRUE)checks each rule against the table it replaces. The availability-factor maps are decided per technology, region and year and recorded as rules without building their tables, in a sparse, unfolded interpolation; a full-year one-country model builds them about 3.5 times faster, with a quarter less peak memory. - Relicensed from AGPL-3 to Apache-2.0. Releases up to v0.89 remain AGPL-3.
New features
delete_project()removes a project folder. It refuses a folder that holds no project, a project another session has open or with a run still being written, and one with sealed entries;force = TRUEoverrides the last two.open_project()andcreate_project()record the session in the project folder (.sessions/);close_project()removes the record and returns the store paths to their defaults.list_project_users()lists the sessions that have a project open and the runs still being written.interpolate_model(overwrite = TRUE)andsave_scenario(clean_start = TRUE)stop when a run of the scenario is still being written by another process;delete_marked()anddrop_solver_outputs()skip such scenarios and runs (skipped_running).ondisk = "auto"follows the build: a scenario started in memory continues on disk when the build outgrows theondisk_ramallowance, and one left in memory moves to disk at a later write or read once it has outgrown it.A scenario built on a
basekeeps the base’s storage parts: a charger or discharger declared only by an efficiency or anafwas dropped from the base’s own storages.TOPIA’s two stores declare
inp2out = 1: the charger is rated as the discharger, where charging power was unbounded.Notes printed during a stage start on their own line, indented under it, and lines wider than the console wrap with a hanging indent.
Rows dropped because their timeslices are outside a sampled calendar are reported as a message, not a warning.
The
unsized_partadvisory is split over lines and states the consequence: the flow is not limited by a rating.The JuMP build draws a fixed-length progress bar that survives a console resize, prints no
solverline ahead of the solver’s log and closes with a rule when it hands back to R.A write for GAMS, JuMP, GLPK or Pyomo that stops part-way no longer leaves the artificial fold member in an on-disk scenario’s tables; a later matrix build read it as a year no equation indexes and wrote zero availability and demand.
A scenario built again from the same inputs resumes the run already written instead of writing the model again.
interpolate_model(overwrite = TRUE)starts the scenario’s folder afresh in memory too, naming the runs removed. Without it, the runs an earlier build left in the folder are kept, andscenario_runs()marks them in a newstalecolumn;save_scenario()names them.load_scenario()keeps a second scenario of the same name, loaded from another folder, under a numbered key (BASE_2) and says so.A scenario derived from a base (
interpolate_model(base = )) goes on disk whenondiskasks for it; it was always left in memory.solve_model()on a scenario made bynewScenario()builds it with the settings the scenario carries.get_status()reports the mode a scenario was saved in, read from its manifest.The dispatch plots take the day and the step within it from the calendar, so a calendar whose finest timeslices are not named
_hNNis drawn too.gg_year_calendars()draws the timeslices each milestone year is solved on, coloured by their weight, for a model or scenario whose milestones have calendars of their own. The full scenario and model reports include it, and the full scenario report draws one dispatch day per distinct calendar.autoplot(<scenario>, timeslice = )with several years draws one panel per year; it summed them.autoplot()is re-exported and works afterlibrary(energyRt)alone; ggplot2 moves from Suggests to Imports.create_project()makes a project folder, its stores and an empty registry, and opens it.open_project()stops on a folder that does not exist and takesondisk =as the project’s default.A scenario keeps its tables in memory or on disk and the mode stays with it: an on-disk scenario is recorded at every stage, so its folder loads after any of them, and a later stage reads no parameter table.
to_disk()/to_memory()switch.interpolate_model(ondisk = )defaults to theondiskoption."auto"puts a scenario on disk when it is expected to take more memory thanoptions(energyRt.ondisk_ram = )allows: a share of the available RAM, or gigabytes above 1.interpolate_model(overwrite = TRUE)names the runs it removes with an on-disk scenario, and refuses a sealed one.Every stage opens and closes with one line at
verbose = 1and is silent atverbose = 0. A numericverboseis honoured byopen_project(),seal_*()andmark_delete(), and reaches the interpolationsolve_model()runs.Parameter interpolation, the mapping builds, the writers and the solution read report progress, at
verbose = 1and above and withshow_progress_bar()on.base_year_scenario =accepts a scenario folder.obj2mem()reads a loaded scenario and one interpolated on disk.Every backend leaves
<run>/solver.log. GLPK, GAMS, Pyomo, JuMP and the matrix route are each asked to log natively, andlog =names the file or turns it off; glpsol’s log moves up fromoutput/.recast_object(as = "split")inverts the cluster relabel, each cluster going back to the member it was, andas = "objects"mints one object per former member. A derived cluster is refused rather than divided.The matrix backends solve in a process of their own. The write leaves a
solve.Rdriver besidemodel.mps, sowait = FALSEreturns once the matrix is written;mm_run(dir)is that driver as a function. mmcloud stays in-process.A NEOS solve detaches too.
solve_scenario(wait = FALSE)returns once the job is launched, and a driver beside the model collects the result;invisible = TRUEkeeps it quiet.force = TRUEclaims a run whoserunningrecord this session cannot verify – a detached solve, or one from another machine – with a warning, and refuses one whose process is alive. A detached matrix solve claims its record with its own pid.HiGHS writes its progress to
solver.logbeside the matrix; thehighspackage does not surface the solver’s console output.A matrix solve that returns a verdict rather than a solution – infeasible, unbounded – reports it instead of failing in the decoder.
autoplot()on amodelorrepositorydraws its declared objects together.class =,comm =andby =choose the objects and the series key; declared data as points, its interpolation as lines.type = "windows"remains the default.getData()gainsclass =on the object,modelandrepositorymethods: the classes to keep, or all-negative to drop them ("-trade"). An unknown class is refused.On a
modelorrepository,comm =selects the objects that reference a commodity on any side, then filters the rows that name one. It could only filter rows before, so a slot with nocommcolumn passed every row.merge = TRUEkeepsclusterandvintageas index columns.The variant provenance columns (
class,base,vintage,cluster) are dropped when no row returned is a variant, so a query about an import no longer carries four all-NAcolumns; they stay as soon as one row matches.apply_to_scenario_data()accepts amodelorrepository, so theget_process_*()accessors work on declarations.get_process_comm(return_list = FALSE)returns the two-column frame it documents.Three numbers describe a timeslice:
share,widthandweight.shareis one unit of its timeframe as a fraction of the year,width(new in@timetable) its length in those units,weightits repetitions. Widths of 1 change nothing.The length of a timeslice in the model (
pTimesliceShare) issharexwidth, and the hours it stands for are that timesweighttimes 8760.Calendars gain
@unitsandnewCalendar(units = ): the length of one unit of a timeframe in hours, e.g.list(HOUR = 1). A listed timeframe is counted in those units; one that is not listed is its own unit.A timeslice of zero
weightis left out: the model is built on the sample that keeps the others, with the gaps located from the calendar’s own rows. Data declared on the timeslices left out is accepted and ignored.storage@cyclenames the timeframe within which a storage’s level closes on itself:"ANNUAL"(default), any timeframe above the storage’s own, or the shorthands"year"and"timeframe".interpolate_model(storage_cycle = )takes a name too.load_scenario()gainsmodel =: opens a saved scenario with the given model (an object, or a name in the model store) in place of the recorded one, without changing anything on disk.relink_scenario()rewrites the model reference of a saved scenario – manifest, scenario file, dependents and registry row – without loading its data. Differences warn, or error withstrict = TRUE;dry_run = TRUEwrites nothing.check_scenario_models()reports, from the manifests alone, whether the model each saved scenario references is still in the store:ok,moved,name_only,missingorembedded.getData()can weight results by timeslice and by period length.apply_weights = TRUEmultiplies bypTimesliceWeight, so a sampled scenario’s per-slice results annualise;apply_period_length = TRUEmultiplies bypPeriodLen(year).-
add_weights/add_period_lengthattach the factor as a column (weight,period_length);"auto", the default, attaches it when it was applied, so no existing result changes shape.What is multiplied is decided by the declared catalogue, not by the column being there: only a result declared
sumon the time axis is weighted, and only a flow-like role is spread over a period. A level is a snapshot, a capacity is a stock and an input parameter is a rate, so none of them is scaled – and whatever was left alone is named in a warning. The four arguments were accepted and silently ignored before. The objective can be weighted by milestone year and by region.
setObjectiveWeights(mod, years = , regions = )writeshorizon@intervals$weightandconfig@objweight, which multiply intopObjWeight[region, year]ineqObjective.-
The year weight is for uneven time resolution, where a cheaply resolved interim year still carries full-year cost at full period weight; the region weight is for a study that does not value every region’s costs equally.
The weight scales the whole cost cell, capital and fuel and penalties alike, so no trade-off inside a cell changes and only its share of the cross-cell investment decision moves; a uniform weight rescales the objective exactly. Weights are strictly positive and are not interpolated – a cell no declaration names counts in full, and an undeclared model writes no rows at all, so it is unchanged. A cost declared at a coarse region inherits one weight its children agree on and is refused where they differ, as the discount factor already is.
objective_weights(scen)reports the solved objective beside the same sum recomputed without the weights, plus the weight of every cell – no second solve.verify_solution()’s objective identity now carries the weight.The store lifecycle verbs take a folder path.
seal_*(),unseal_*()andlist_dependents()accept a stored entry’s directory as well as its registered name or the object itself, reaching an entry outside the project’s store.The entry’s name is read from its manifest, so a registry row stays keyed on the name and never on the path; a layout-2 folder, which keeps no
scenario.yml, now says so instead of reporting the scenario missing.interpolate_model(storage_cycle = )overrides every storage’s own@cyclefor one build:"year","timeframe", orNULL(default) to honour the objects. The model is not changed and the override is recorded inscen@misc$storage.Storage level targets:
storage@targetsets soft floors on the level (stg.af.target), each priced per unit short (stg.af.cost), and tiers stack. Reported asvStorageShort/vStorageShortCost;stg.varommay now be negative.Storage columns of the storing part take the
stg.prefix and the per-part efficiencies and costs are dotted:af.*->stg.af.*,stgeff/inpeff/outeff->stg.eff/inp.eff/out.eff,stgcost->stg.varom, and so on.The old storage column names are accepted with a deprecation warning, and saved storages and process specs are renamed on load.
foldmay now include the timeslice axis while a milestone carries its own calendar; the combination was refused before. Folding happens while the data still spans the model calendar’s universe, so the uniformity it asserts holds for every year’s subset of it, and a wildcard expanded back is trimmed to the cells each year actually has. Measured on a sampled-year model: same objective folded and unfolded on GLPK, Pyomo/CBC and Julia/HiGHS.subset_model_regions()prunes a cluster roster declared without aregioncolumn: a variant whose rows the cut removed is no longer declared, where before the model was refused for carrying no rows for it.A base-year ledger carried into a SUBSET of the model it was solved on is narrowed to the regions the model declares, naming what it left out, instead of writing capacity for regions the cut removed.
aggregate_model_regions()no longer averages weather. A series is already a clustered object, and the weight such a mean needs – the resource available for that grade in that province – is not something a geoscale can carry, so every fine series is preserved: the province becomes part of the variant label (HIinR07becomesHI_R07underZ4) and no value is touched. The objects that share those labels – the series, the resource commodity and both sides of its market – are composed together.aggregate_model_regions(dryrun = TRUE)returns a plan instead of aggregating: the geoframe each region-keyed slot sits at and what will happen to it, thecopycolumns that disagree, each corridor’s fate, the clustering each family resolves to, and whether the call is ready.subset_model_regions()reports what share of the system a cut keeps – demand, capacity, supply and the geoscale’s own weights – in thedryrunreport and in@misc$subset.check_model_levels()reports the level ruleinterpolate_model()raises: every strict-class declaration that sits at a different level than its commodity, plus a@geoframeor@timeframethe model’s geoscale or calendar does not have. Works on a model, before interpolation.verify_aggregation(fine, coarse)says what a coarsening conserved: an extensive total must be unchanged, a rate must stay inside the range it came from, and a class that lost objects – corridors internal to a coarse region – is reported as such instead of as loss.aggregate_model_regions(max_clusters = )caps clusters per coarse region –max_clusters = 3, or per family withlist(all = 3)– instead ofclusters’ model-widek. Each region takes the best number below the cap, and one with nothing to separate is left plainly aggregated.aggregate_model_regions()now coarsens a model whose objects are not all declared at its finest regions: each row is recast from the geoframe its own code sits at, one already at the target is carried, one above it is kept, and a stale@geoframeis cleared.update()on a model moves the frame an element is declared at:update(mod, geoframe = list(ELC = "zone")), with the classes pinned to the commodity moving with it. Data not already at the frame is refused;dryrun = TRUEreports,force = TRUEwrites the frame anyway.subset_model_regions(region = )takes a code at any geoframe:region = "Z3"keeps that zone’s provinces.A region subset drops objects it leaves with nothing to do, and records the cut in
@misc$subset.A region subset no longer stops at a group it divides when everything declared there is a rate: a price or a factor holds for each child unchanged, so there is nothing to apportion. A quantity still stops the call, and now names the weight it would need.
subset_model_regions(dryrun = TRUE)reports, before cutting, whether a region set can be cut and what it still needs: which groups it splits, which values ask for a weight, which are carried, and the ways on.is_separable()is its verdict alone.A resource tier no object references is no longer materialized as a commodity, so a region subset that narrows a graded technology (TOPIA’s
EWINtoHI/MD) stops warning about the tier it left behind (LANDW_CLLO).A spatial sample at interpolation is the same operation as the verb:
interpolate_model(geoscale = )keeps the coarse declarations a whole group covers, refuses a group it divides on the same terms, and takessplit_weight/keep/drop. A rebuilt scenario copy is cut the same way.subset_model_regions(split_weight = , keep = , drop = )cuts through a region group a subset divides: a quantity declared at the group is apportioned by the weight named (split_weight = "area"for all of them), held whole (keep) or left out (drop). A subset and its complement still sum to the whole; a corridor endpoint at a split group is still refused.Reports name the calendar each milestone is solved on. Where milestones do not share one calendar, the model, scenario and config reports carry a
Calendar by milestone yeartable – year, calendar, timeslices, timeframes, and whether the year takes the model’s calendar or one of its own – and the configuration gains aper-year calendarsrow. A model whose years all share a calendar reports exactly what it reported before.autoplot()on ahorizonlabels each interval with the calendar that milestone is solved on, whenintervals$calendarnames one.-
topia_simulate()generates TOPIA’s weather and demand profiles. The shipped"simulated"dataset is one cached run of it; every other parameter set is an alternative, and the result feedsbuild_topia(weather = , demand = ).topia_simulate(calendar = "d365_h24") # the defaults topia_simulate(wind_season = rep(1, 12)) # no seasonal wind topia_simulate(clusters = FALSE) # one series per resource topia_simulate(jitter = 0.08, seed = 1) # another drawLevels are calibrated against the measured set per resource, cluster and province; the arguments change the shape. Clusters differ through
wind_gradeandsolar_halflen, so a grade is a different resource rather than another ceiling on one series. The returned frames carry adatasetattribute naming the generator and the parameters that differ from the defaults. build_topia(max_vintages = )caps the vintages a process keeps, merging the cohorts it drops by each column’s declared space rule.build_topia(clusters = FALSE)drops the weather clusters, collapsing each resource to one member per region and leaving the supply tiers alone.calendars$d365_h24_3dpm: three consecutive days per month at hourly resolution, so a sampled store cycles over 72 hours rather than 24.build_topia(storage_duration = , storage_inp2out = )set a store’s shape: a number pins the ratio, two give it a range,"free"unpins it.A ramp declared where the model does not step is reported.
interpolate_model()warns whenrampup/rampdownname a timeslice that gates no equation, instead of storing a limit that does nothing.build_topia(weather = , demand = )replace the series. Each takes the name of a shipped dataset or adata.frameshaped like the matching element oftopia_profiles(), so the output of one is the input of the other. A weather frame must cover every(cluster, region)pair the object declares; a demand frame carryingloadis a relative shape, scaled to the annual energy the shipped object holds.-
build_topia()cuts smaller cases from the shipped model. One call for a province, a zone or a sample, resolving the parts that are tedious by hand:build_topia("Z3", as = "model") # the zone, ready to interpolate build_topia(preset = "island") # R01: no wire, no domestic fuel identical(build_topia(), topia$modules$electricity) # TRUEA zone code expands to the provinces beneath it, so a request does not cut a zone the fossil fuels balance on; one that still does is refused and names the province to add. The two levers carrying a spatial shape travel with the model –
GREEN_H2, whosefor.eachnames every province, andCO2_CAP, whose cap is a per-province allowance times the province count.techsandmodulesselect processes, and a dependency closure follows them: drop every coal burner andCOA,SUP_COA,IMP_COAand both coal corridors go too.modulesuses the nine sub-repositories the article builds the model from, carried through astopia$modules$electricity$groupsrather than re-derived.build_topia(techs = "-ECOA") # and the whole coal chain with it build_topia(techs = "vre") # declares a weather series build_topia(modules = "-hydrogen") # the chain declared across 3 sectionscalendarre-keys the series and the demand curve onto a cheaper sample of the hourly year, holding the annual energy fixed, so a case stays comparable with the full model:build_topia(preset = "tiny") # 1 region, 101 timeslices build_topia(calendar = "d365_h24_1dpm") # one day a monthOnly a sample is accepted – one whose timeslices are a subset of the model calendar’s.
s4_h24carries names of its own and no series, so it would leave every clustered technology with no weather row and running unbounded; it is refused, naming the slices that do not match.It authors nothing: every object it returns was declared in TOPIA I, which generates the shipped data files. With every argument at its default it returns
topia$modules$electricityunchanged.clusters,demand,weatherandlevelare not built yet and are refused rather than ignored. -
A milestone year can be solved on a sample of the model calendar. Hourly where the investment decisions land, cheaper in the years that only carry the trajectory between them:
mod <- setCalendar(mod, calendars$d365_h24_1dpm, years = 2040) getYearCalendars(mod)The horizon names a calendar per milestone (
horizon@intervals$calendar) and the calendars themselves live inconfig@misc$calendars; an absent column is one calendar for every year, as before. A year’s calendar must be a sample of the model’s – the same timeframe levels, slices from the same universe, the sameshareper slice – whichsetCalendar()checks, naming the level or slice at fault. Each year’s weights come from its own calendar, so every year still annualises exactly, and the variable and equation domains carry only the slices their year has.foldmay not include the timeslice axis while a per-year calendar is declared. sample_calendar()is exported: it builds a calendar from a subset of another’s timeslices, keeping the parent’s names, levels and shares and carrying the weights that annualise. It was internal tosolve_by_sample().timescales::filter_calendar()is the same operation on atimescales::Calendar.setCalendar()gainedmodelandscenariomethods, and accepts acalendarobject. Both were documented from 0.92 but neither existed: the only method tooknewCalendar()’s arguments, so passing a calendar – the form the help page showed – failed on the name assertion.-
Money carries a year.
convert(1, "MEUR2015", "MUSD2020")is an exchange-rate question and an inflation question at once, and the two routes through it – deflate then convert, or convert then deflate – do not agree: the gap is the change in the real exchange rate over the interval. Both are computed, the World Bank and IPCC convention ("deflate_then_fx") is the default, and a material disagreement warns.convert(1, "MEUR2015", "MUSD2020") convert(1, "MEUR2015", "MUSD2020", currency_route = "both") convert(1, "MEUR", "MUSD", from_year = 2015, to_year = 2020)basis = "cpi"deflates on consumer prices instead of GDP. A year is read only where the unit is a currency:MWh2020is still an unknown unit.currency_base_year()reads or sets the year untagged money is read at, andadd_currency_fx()/add_currency_deflator()add a rate or an index for the session. normalize_model_currency()converts a model’s costs to one currency-year, and reports every factor it applied rather than applying it silently.interpolate_model()runs it on the copy it builds from, so a model’s objects keep the values they were written with while the scenario carries the converted ones, andscen@misc$currencyrecords each factor with the exchange-rate and deflator rows behind it. The columns it converts are every parameter whose declared unit carries the currency token; physical units are not normalised.-
One object can override a parameter’s default or interpolation rule for its own rows.
@defValand@interpolationontechnology,storage,trade,supply,demand,import,export,weather,taxandsubsidy, keyed by the short column name the value is written under:tech@interpolation$af.up <- "inter" # this technology only weather@defVal$wval <- 3A parameter name works too and is resolved (
pTechAf.up, orpTechAffor every bound at once), and any accepted rule spelling is normalised. A key naming no column or parameter of that class is an error, not a silent no-op. These are the third of three layers – the catalogue, thenconfig@defVal/@interpolation, then the object – and a value equal to the layer above it records nothing, so a model that sets no override interpolates exactly as it did before. -
A weather series may declare what it measures, and a process what it expects.
weather@units$wvalstates the series’ own unit; the newunitcolumn oftechnology@weather,storage@weather,trade@weatherandsupply@weatherstates what that row expects from the series it names – per row, because one process may read a temperature from one series and a wind speed from another. Where both are declared and differ,newModel()andinterpolate_model()stop:1 weather unit mismatch(es): technology HP expects degK from weather 'TEMP', which declares degCBoth sides are optional and silence is the default, so a model that has never heard of weather units is unaffected. Nothing is converted: a coefficient fitted to one measure and applied to another is wrong, and there is no conversion in a model to reconcile them. The coefficient itself stays a
factoreither way – the relation is reciprocal for a temperature and direct for other measures, so it is not derived. getUnits()works on aconfig(and asettings), reporting the model’s rates and its dummy-flow prices.confighas no catalogued columns of its own —settingscontainsconfigand the shared slots are filed under the child — so the lookup resolves through that relation.getUnits()works fortrade,tax,subsidy,weatherandcalendar, which had no method.tradereports all 40 of its columns, with{comm}resolved from the new@units$comm;taxandsubsidygained a@unitsslot of their own (commandcurrency), since a levy is a rate and both halves are needed to read it.demand,importandexportgained acurrencycolumn, sopriceresolves where it could not.getUnit()reads an object’s own measure, besidegetUnits()for the table of its parameter units.A weather series reports its declared unit:
newWeather(unit = "degC")makesgetUnits()saydegCwhere it says{wval}for an undeclared one. Dimensionless stays the default, and the coefficients that read the series stay afactoreither way — the relation is reciprocal for a temperature and direct for other measures, so it is not derived.-
Exchange rates and deflators ship as data:
currency_fx(one rate per currency and year),currency_deflator(price indices on a GDP or a CPI basis, for moving money between years) andcurrency_codes(every spellingconvert()accepts, resolved to an ISO code and a scale). All three are built bydata-raw/currency.Rfrom World Bank series, which also generates the currency rates inconvert_data– those were typed by hand before and could not be rebuilt.attr(currency_fx, "base_year")is the year untagged money is read at. A crore or a cent is now derived from its currency’s rate throughscale, rather than carrying its own copy of a number. aggregate_model_regions(resolve_conflicts = )decides what happens to a value with no merged form, such as a lifetime or a levy rate. The default stops and names the object, the column and the regions that disagree;"force"takes their mean and"drop"leaves the value unset, so the parameter falls back to its default rather than to a fabricated number. Both warn and record what was resolved in each object’s@misc$aggregation, which also records the level every object was aggregated to.newHorizon(base_year = )marks one milestone as GIVEN rather than decided. The marked year is interpolated as any other but never reaches the solver, and the milestones before it are historical and enter no LP at all; both still anchor interpolation.solve_base_year()solves the base year on its own, andinterpolate_model(base_year_scenario = )carries what it decided into the projection as sunkstockat its true vintage, leaving the model’s declared@stockuntouched. With no source the projection still excludes the base year and starts from the model’s own stock.getData(base_year = TRUE)returns both, labelled by asourcecolumn.Solver preset
mm_cuopt_wsl_py: cuOpt on a local GPU through WSL, run through cuOpt’s Python interface. The solution is kept at a time limit, andgpu_save_warm_start = TRUE/gpu_warm_start = <file>save and continue from PDLP’s warm-start data.solve_by_sample()accepts a saved scenario as its first argument, or an explicitbase =: the scenario’s model drives the sequence and the scenario becomes the base, so each sample’s interpolated tables are stored as a row filter over it instead of a copy. The base must have its inputs sealed (seal_scenario()), which leaves it solvable, and only tables at or aboveenergyRt.param_ref_min_rowsqualify. A base that cannot be used falls back to copying and says why.solve_by_sample(ncap_floor =)solves the ensemble twice: freely, then against a floor ofncap_floortimes the samples’ own new capacity, so the spread becomes period variation at one plan rather than variation between plans.ncap_statpicks the mean or the median. The consensus is taken across all samples, so it does not depend on the order they were solved, and a sample that built nothing counts as a zero rather than being skipped. It is a floor, not a fix: a sample may still build above it, which marks a period the consensus plan cannot serve. The floored solves are stored as<sample>_fvariants beside the free ones and the free pass stays in$scenarios_free;$runsgains apasscolumn.ncap_floor = 0is the default and changes nothing.recast_model_calendar()rebuilds a model’s time-varying data on another calendar. Timeslice values are rates, so aggregation is a weighted mean and annual totals are conserved;rules =overrides it per column. TOPIA at 4 seasons instead of 96 hourly slices solves in 1.4 s rather than 408 s.subset_model_regions()keeps a declaration made above the region level (a@geoframe = "zone"supply or trade) when the whole group survives, instead of dropping it. A subset that splits such a group now errors and names the options.interpolate_model(geoscale = )does not do this yet.check_feasibility()reports unservable demand, missing process inputs and binding supply ceilings, on a model or an interpolated scenario;interpolate_model(check = TRUE)runs it.check_feasibility()is aware of economic retirement. A requirement that follows from standing capacity is forced only while that capacity must stand, so findings carry aretirementcolumn and are reported under both settings – off (the whole stock stands) and on (what theret.up/ret.fxbounds still pin) – with the model’s own setting named in the report and in theretirement_actualattribute.interpolate_model(check = TRUE)stops only on findings under the live setting, since a finding under the other one is a counterfactual.
Model building
- Three-part storage: charger, reservoir and discharger with their own capacities, costs and availability, coupled by
@duration,@inp2outand@inp2stg. - Vintages (
@vintage) and clusters (@cluster) expand a process into variants at interpolation;getVariants()lists them. - Resource tiers: a
commodityorweatherobject with@clustergets one balance per tier. - Weather transforms derive many series from one, and a weather object may be declared at a coarser region than the processes reading it.
- Transmission:
newACLine(),newDCLink(), an optional Kirchhoff voltage law, loss tranches (lossTranches()), route ratings (@trade$af), route ratings over a parent timeslice (@trade$afs) and weather factors of the ratings (@weather, read at the route’s source region). - Supply, import and export curves:
asSupplyCurve(),asImportCurve(),asExportCurve(). - Taxes and subsidies are indexed by instrument and can be levied on processes.
capandncapcharge technologies and trades (a trade in each region the levy is placed in); a storage’s capacity is levied by part withstg.cap/stg.ncap(reservoir),inp.cap/inp.ncap(charger) andout.cap/out.ncap(discharger). -
commodity@propertyfor physical properties; discount rates at any geoscale level; a WACC per technology withpaybackas its cost-recovery life. - Portable process definitions:
process_to_spec()/process_from_spec()(YAML/JSON),process_designer(),read_technology_xlsx()/write_technology_xlsx().
Time and space
- Calendars from timescales, including irregular calendars (months of 28-31 days), sampled calendars (representative days) and the new
m12_d365_h24andm12_d365_h24_1dpm. - Multi-level geography from geoscales: commodities and processes may sit at a coarser
@geoframethan the flows they touch, with auxiliary flows held in the finer cells beneath. - Region aggregation with clustering:
aggregate_model_regions(clusters = ),get_process_groups(),process_cluster_sweep(),model_clusters(). - Sub-territory solves from a filtered geoscale, and
subset_model_regions(). - Auxiliary flows sit at the auxiliary commodity’s timeframe: an annual emission is one variable per year, not one per hour.
Solving
solve_scenario()resumes a scenario already written to a run, solving the files on disk instead of writing them again. A fingerprint inrun.ymlguards it: a changed model, or a run written before fingerprints existed, is rewritten.The write stage records its run with
status: "written", so a written-but-unsolved directory is addressable by label andscenario_run_info()no longer errors on it.write_model(run = "<label>")writes into that run. The label was silently dropped and the run named after the solver instead.A write that is refused leaves nothing behind: the run directory is claimed before the solver files are written, not after. Sealed outputs, and a run another session is still solving, were both refused with the files already on disk.
read_solution()gaineddir =(a solve that ran outside R),wait =(block until the solver’s output is complete) andsave =. Reading an external directory and keeping the result is now one call.write()writes a scenario’s model, the short form ofwrite_model(), beside the existinginterpolate(),solve()andread().base::write()is unaffected.Solve drivers:
solve_recursive(),solve_by_sample(),solve_by_region()andsolve_guided().First-order LP solvers (cuOpt, HiGHS PDLP), and
lang = "mm", which builds the problem matrix with multimod. Remote solving on the NEOS server and on cloud GPUs.Matrix presets (
backend = "mm") are solved bymultimod::solve_mps(): HiGHS in the R session or through Julia, cuOpt on a local GPU through WSL (mm_cuopt_wsl) or on a rented GPU (mm_cuopt_cloud,pyomo_cuopt_cloud).On the
lang = "mm"route the activity and output definitions (eqTechAfFx,eqTechActSng) and the per-process totals (eqTechOutTot,eqTechInpTot, the storage, supply, import, export and demand totals) are substituted while the matrix is built: their rows and the columns they define are not written, which reduces a full-year model several-fold. The preset fieldsubstitutenames the equations;character()builds every row. With a multimod that composes roll-ups, the commodity output and input totals (eqOutTot,eqInpTot) are substituted too.The matrix route removes
model.mps(and its compressed copy) once the solution is decoded; the index tables and the solution file stay. The preset fieldkeep_mps = TRUEkeeps it. A preset’smm_solverandwherechoose the solver and the place. A Pyomo- or JuMP-written matrix carries index tables (from Pyomo’s symbol map, from JuMP’s containers) and is decoded by multimod like its own;julia_mpswrites the JuMP matrix andjulia_cuopt_cloudsolves it on a rented GPU.interpolate_model()is about 6x faster on large models;fx_equ = TRUEwrites fixed bounds as single equality rows (about 25% fewer rows on hourly VRE models).MPS output (
solver_options$pyomo_mps),read_solution()for solutions produced elsewhere, anden_check_solve(),en_check_packages(),en_install_deps(),en_install_julia_pkgs()to check and set up the toolchains.interpolate_model(model, ..., base = REF)builds a scenario on an interpolated base when the objects added are constraints, cost terms, taxes or subsidies: only what they add is computed, the base’s tables are reused and its store is never written to, and the result equals a full interpolation. Anything else is interpolated in full, with a message saying why. The saved scenario names its base inscenario.yml.A scenario keeps the model as given in
@model: the variants, tiers and transform clones interpolation builds are rebuilt when a reader needs them. A saved scenario references its sealed model instead of copying it, also for models with vintages, clusters or a spatial sample.getObject()on a scenario returns the objects as defined.save_dataset(rehash = FALSE)andsave_dataset(overwrite = TRUE)stop when another store entry references the version they would rewrite, and name the dependents.base = REFalso takes new processes, commodities and other model objects: the per-object tables of the objects REF holds are reused and every map is rebuilt.base = REFtakes a sample of REF’s calendar or regions (a calendar of some of its timeslices, a filtered geoscale withboundary_prices): REF’s tables are reused filtered to the sample. Saved, such a scenario references the sealed REF’s tables through a row filter.
Results and project management
Stored tables carry their SET columns as Arrow dictionaries – integer codes plus one copy of each label, with the declared set as the levels – so the files are much smaller and faster to read.
set_storage_dictionary(FALSE)turns it off.The encoding is only at the file boundary:
obj2mem()decodes, so nothing in memory holds a factor and the content hashes are unchanged.en_characters_to_factors()/en_factors_to_characters()convert a table’s set columns to and from dictionaries, for code that reads a store directly rather than throughgetData().getData(stringsAsFactors = TRUE, process = TRUE)gives theprocesscolumn one level set covering every process of the problem, so results about different classes stack and join.A project registry keyed on path, with a lifecycle (
seal_*(),mark_delete(), …); objects are reachable by name (getScenario("base")).Runs and artifacts:
scenario_runs(),scenario_solutions(),promote_solution(),import_solution(),drop_scenario_run().Results in Arrow stores, readable when larger than memory;
getData(run = )reads several runs at once.The dataset store keeps versions by content under one name (
datasets/<name>/<hash>/): saving other content under a name adds a version instead of overwriting,load_dataset(name, hash = )pins one, and the registry lists every version. A references table beside the registry records which scenario points at which version.save_scenario()keeps a scenario’s large interpolated tables (numeric parameters, bounds and maps fromenergyRt.param_ref_min_rowsrows, 1e6 by default; weather and demand series fromenergyRt.ondisk_min_rows) in its own store and records their hashes inscenario.yml. A scenario built withinterpolate_model(base = )on a saved and sealed base references every table identical to the base’s instead of storing a copy, and keeps the rest.load_scenario()resolves the references; the lazy readers follow them; a writer that changes a table drops its reference.unseal_scenario()refuses while scenarios reference the base’s tables (force = TRUEto unseal anyway). References into the dataset store held by scenarios saved earlier still load; a weather or demand table whose version is gone is recomputed from the model.A scenario seals its inputs and its outputs separately:
seal_scenario(x, inputs = TRUE, outputs = FALSE). With sealed inputs and open outputs it can still be solved under a new run label;save_scenario()then writes that run only, so scenarios built on it keep reading the same tables.unseal_scenario(x, inputs = FALSE, outputs = TRUE)reopens the runs alone. A scenario sealed before reads as both parts sealed.save_model()andsave_scenario()takemode = "ref"(default,options(energyRt.save_mode)) or"full"."ref"references a repository or model only when its exact content is a SEALED version, and copies it in otherwise;"full"copies everything in.save_scenario()no longer stores an unsealed model in the model store to reference it. Changed: a scenario whose model is stored but not sealed now carries its own copy.A scenario whose model is a sealed version plus repositories added by
interpolate_model()references the sealed version and keeps only the added repositories (model: addedin its manifest);load_scenario()adds them back.list_versions()lists the versions of models, repositories and datasets with a status (current,in use,marked,unused), when they were sealed, how many entries reference them and their size (details = TRUEfor more).mark_delete(version = )marks superseded versions (sealed ones of models and repositories; a hash, or"unused"), anddelete_marked()deletes them when still unreferenced.delete_marked()also keeps an entry while any of its sealed versions has a dependent.list_dependents()replacesstore_dependents(): the verified dependents recorded on sealed versions (withrecursive = TRUE, transitively) plus the references found in manifests;prune = TRUEdrops stale records.Unsealed saves of models and repositories record a save id instead of a content hash (
hashed: falsein the manifest), so saving a large model no longer serializes it for hashing. The content hash is computed when a decision needs it: saving onto a sealed entry, comparing with the sealed versions of a name, and sealing (which now loads and hashes the payload). An identical re-save of an unsealed entry is written again.options(energyRt.lazy_hash = FALSE)hashes every save.A model whose repository holds unchanged objects of one sealed repository version (taken with
getObject()from a loaded sealed repository) references that version with the object names and the hash of the selected objects, verified byload_model(). Sealing a repository records each object’s hash for this.Sealing a model or repository freezes its content as a version (
<entry>/<hash>/): unsealed saves update the entry in place and leave the sealed versions untouched, and references andload_*(hash = )reach a sealed version exactly. A sealed version records the models and scenarios that reference it, andunseal_model()/unseal_repository()list them and refuse while they exist unlessforce = TRUE.Referenced tables read back into memory are dropped before the scenario shell (
scen.RData) is written. A shell aboveoptions(energyRt.shell_max_mb = 256)warns and names its largest slots.The
mmroute no longer copies the scenario’s tables into the multimod model: multimod reads them from the scenario’s store or the dataset store as the matrix is built (multimod_from_energyRt(inMemory = FALSE)), a table held in memory is attached rather than dropped, and the memo size is the preset’sdata_cache_gb(32 by default). Once the matrix is written, the model, the memo and the scenario’s tables that are persisted on disk or in the store are released, so a solve, local or in the cloud, waits with the memory free.
Validation and comparison
-
validate_scenario_parameters()(structural versus advisory findings),verify_solution()with check groups,audit_coefficients(). -
compare_scenarios(),compare_models(),compare_inputs().
Reporting and visualisation
report()for every class and for models and scenarios (HTML, PDF, Word, TeX), with spatial and solved context (geoscale =,model =,scenario =).levcost(): analytic levelized cost of technologies, storage (LCOS) and trade (LCOT) per vintage, cluster and region; ex-post per variant on a solved scenario.levcost()on a storage takesby_variant =andby_region =, as on a technology: the table per vintage and cluster, or one result per region.draw()process diagrams;autoplot()for objects, calendars, horizons, scenarios and comparisons;plot_map(),plot_trade_map(),plot_trade_network().draw()takesvintage =andcluster =on storage and trade, andcluster =on supply, demand, import and export: each member is drawn with its own values.getMix("generation")includes technology consumption, so a process that consumes the balanced commodity appears as a sink instead of vanishing.style = "map"for supply, import, export, demand, technology and storage; trade maps takecommand any geoscale level, and separate stock from investable capacity.Shared
autoplot()settings:@descas subtitle, the object’s unit on the y axis, legends titled by the key they show.autoplot(<supply>):param =picks the quantity,style =the chart;type =is deprecated.sequence_coverage()reports what a solve sequence covered, one row per unit and element, andautoplot()draws it: a sampled calendar as a tile grid or a wall calendar, a region sample on its geoscale, a recursive walk as a horizon Gantt with the look-ahead years marked apart from the decided ones. Elements no unit covered stay visible as gaps.autoplot(<by_sample>, "histogram")draws a result’s spread across the samples, weighted by each sample’s coverage, with the free pass overlaid on the floored one whenncap_floor > 0.solve_scenario(wait = FALSE)launches the solver detached and returns at once, for running several scenarios or carrying on working.waitis a documented argument now, and is refused together withread.solution = TRUE,transient = TRUEor an externalsolver.dir, none of which can be honoured once the call returns before the solve does. Collect the result later withimport_solution(). Detached solving covers the backends that launch a solver process (GLPK, GAMS, Pyomo, JuMP).A run record now identifies the process that wrote it (
pid,pid_started,detached), so a run still being written can be told from one whose writer is gone. While a run is in flight, reading it, dropping it, re-solving into it and sealing the scenario’s outputs are refused rather than allowed to corrupt or overwrite it;clear_run()is the override, andget_status()reports a run whose process has gone without finishing ascrashed. A run recorded on another host refuses as well, since the process cannot be checked from elsewhere.get_status()reports the state of a saved object – sealed (for a scenario, inputs and outputs separately), marked for deletion, runs held, size on disk – for one model, repository, dataset or scenario, or for every saved object in the project. It reads the manifests, so it does not depend on the registry being current. For a derived scenario it separatesbase, which is provenance, from the tables it actually borrows, which are what block unsealing or deleting that base.The solve drivers report progress through progressr:
set_progress_bar()for a bar,verbose = TRUEfor a line per unit, either or both. ### Shipped dataTOPIA (was UTOPIA) rebuilt as one 11-region model: land as the scarce resource (
LANDS,LANDW) in place ofSOL/WIN, wind site clusters, vintages, fuel supply curves, a transmission network from the geoscale, and a hydrogen chain (H2ELC,STG_H2,EXP_H2). Tangled fromvignettes/topia-build.Rmd.New TOPIA lever
GREEN_H2: electrolysis capped by renewable generation in the same region and timeslice (hourly matching, not unbundling).
Breaking changes
save_scenario()returns the scenario as it was given: one held in memory keeps its tables.to_disk(), orsave_scenario(thin = TRUE), returns the emptied object.A
base_year_scenariothat is named and holds no optimal base-year solution is an error; the projection was built from the declared stock with a message.horizon_segment = "projection"asks for that explicitly.open_project()returnsproject_rootandondiskwith the paths it replaced.The base-year capacity pin is a constraint, not a bound.
base_year_capacity = "fixed"wrotencap.up = 0into the capacity tables, which carries forward, so a pin meant for the observed years banned investment in every later year.A forced build in an observed year (
ncap.lo/ncap.fx) is kept and the pin steps aside for it, per variant; it was deleted before.A declared
ncap.upin an observed year is left alone. The pin wrote a blank-key zero, which is the broader row and overrode any narrower ceiling.getData(class = )on amodelorrepositoryselects objects. It reached the row filter before, which skips a column it cannot find, so it selected nothing and the call looked like it had worked.Ramp times are hours.
rampupandrampdownoftechnology@afwere a fraction of the year and are now the hours a technology needs to go from zero to full output. Existing values must be multiplied by 8760.The share of an
HOURtimeslice is one hour of the year in every calendar.newCalendar()andmake_timetable()refuse one with a longer share; a block of hours is anHOURtimeslice several hours wide.The averaged calendars
s4_h24,m12_h24,wd7_h24andw52_h24hold the hours of an average day as single hours with the days they stand for inweight, as they did, and record no source.The timeframe
HOURTYPEofs4_hp3is nowHOUR: each block has the share of one hour, its hours in a day inwidthand the season’s days inweight, so models on it give other numbers than before.The blocks of
s4_hp3changed: hour 21 moved fromDAYtoNIGHT, soDAYis h06 to h16 (11 hours),PEAKh17 to h20 (4) andNIGHTh21 to h05 (9). Stored calendars are not converted.storage@fullYearisstorage@cycle. The logical is replaced by a timeframe name:TRUEis"ANNUAL",FALSEis"timeframe".newStorage(fullYear = )still works, with a message; saved storages are upgraded on interpolation.A sampled calendar records its source in
misc$sample_of, keeping the source calendar itself only when it is not one of the shipped ones. A sample that records the source’s two successor tables keeps working.The shipped samples
m12_subset_q1,d365_h24_1dps,d365_h24_1dpmandm12_d365_h24_1dpmnow carry a source, so a storage level is no longer carried between sampled days that are not adjacent and results with storage can move.A calendar that records no source and has no timeslice of zero weight has no gaps, whatever its weights, and no longer warns that its gaps cannot be located.
upgrade_model_calendar()adds thewidthcolumn and theunitsslot to calendars saved without them, and renames a finest timeframeHOURTYPEwhose timeslices are counted in hours toHOUR.A calendar holding an average day as blocks under a timeframe
DAYHOUR, written by a development version, is converted to single hours with the days inweight, with a message: a model built on it has to be rebuilt.topiaruns ond365_h24and its sampled365_h24_1dps.s4_h24is replaced byd365_h24_1dpsthroughout, andtopia$weather/topia$demandcarry the measured hourly series on that sample’s timeslices.The
simulateddataset is no longer shipped:topia_simulate()generates it for any calendar, andtopia_profiles(calendar = )accepts"d365_h24_1dps"(the default) and"d365_h24".A calendar’s timetable holds timeslice names. Each timeframe column of
calendar@timetableholds the name of the row’s timeslice at that timeframe (MONTH = "m01",HOUR = "m01_h00"), and thetimeslicecolumn is gone.Code that read
cal@timetable$timeslicereads the finest column,cal@timetable[[cal@default_timeframe]].newCalendar()still accepts a table of per-timeframe labels, with or without atimeslicecolumn, and converts it.calendar@timeslices_in_framecounts the timeslices of each timeframe and equalslengths(cal@timeframes): 288 hours form12_h24, where it gave 24. Reports show the same counts.calendargains atokensslot, thetimescalestoken of each timeframe (list(MONTH = "m12", HOUR = "h24")), read off the labels when the calendar is built;newCalendar(tokens = )sets it and a sample takes its source’s.upgrade_model_calendar()brings a calendar saved by an earlier version, or the calendars of a model or scenario, to the current form; timeslice names, shares and every model set stay as they were.Saved calendars are upgraded where they are read or passed in (
load_model(),load_scenario(),newModel(),setCalendar(),interpolate_model(), sampling, plots), so an upgraded model’s content hash differs from the recorded one.calendar_samples(by = )chooses what a member oflevelis:"label"(default, as before) draws the labels of the level wherever they occur,"timeslice"the timeslices of the level.The shipped
calendarsare in the current form.solve_recursive(on_error = "return")is now"continue", the spellingsolve_by_sample()andsolve_by_region()already use. The old value warns once and still works.Solver-run arguments renamed.
tmp.dirissolver.dirandtmp.delistransient, each warning once and forwarding;tmp.pathandtmp.nameare gone – pass the whole directory assolver.dir.interpolate_model(horizon_segment = )is the spelling ofsegment, which still works; naming both is refused unless they agree.solve_scenario()andsolve_model()declareinvisible =rather than taking it through....interpolate_model(segment = )is deprecated in favour ofhorizon_segment =and says so.read_solution(dir = )is deprecated in favour ofsolver.dir =, the name the solve and the write use, and says so.solve_base_year()is deprecated: useinterpolate_model(horizon_segment = "base_year")thensolve_scenario(), which returns a scenario rather than a four-field list.horizon_segmentis inferred frombase_year_scenariowhen unset.Base-year retirement follows
base_year_capacity.solve_base_year(optimize_retirement = TRUE)warns; passbase_year_capacity = "free"to leave the base year open.write_script()is nowwrite_model(), after the stage it performs and the.write_model_*()backends it dispatches to. The old name warns once and forwards;write_sc()is removed.A completed solve closes its run record even when
wait = FALSE. Themm,mmcloudandneosbackends solve in the R session and ignorewait, so their records readrunningfor a finished solve.import_solution()is deprecated:read_solution(object, run = , save = TRUE), which reads an external directory too (dir =).A logical
runis deprecated.runis the run’s label; usewrite_model()to write without solving.set_gdxlib_path()/get_gdxlib_path()are deprecated and thegdxlib_pathoption is not read: GDX i/o goes throughgamstransfer, in-process, so there is no library to locate. Useset_gams_path().solve(object, "NAME")uses the name instead of discarding it.Writing into a scenario whose outputs are sealed is refused. A write adds a run, so an outputs seal stops it; an inputs-only seal still allows it.
levcost()’ssupplycost component is nowinput, and a process that consumes anything always reports one – the old name claimed to know the commodity was a fuel.A free input is reported as a zero in the breakdown and in
cost_yearlyinstead of being omitted, which used to makelevcost()on a bare technology look like a complete cost.A storage’s charger and discharger exist wherever the object declares an
inp./out.column. Read from the object, not the pruned parameters, soinp.invcost = 0andinp.cap.up = Infcount andsparse =no longer decides its parts.inp2out,inp2stganddurationdeclare both of their ends;comm,unitandcap2actdeclare nothing. A part declared by a zero or anInfgains a real capacity variable, so anafbound on it starts binding.An
af, a link or an aux coupling alone no longer errors:validate_scenario_parameters()reports a part nothing sizes asunsized_part.A storage level no longer crosses a gap left by a sampled calendar. A sample drops part of the year, so its successor relation chained blocks months apart; each contiguous block now closes onto its own first timeslice.
A full calendar has no gaps and is unaffected; a sampled year’s results can move, and only upward.
interpolate_model(bridge_storage_gaps = TRUE), or the option of the same name, restores the old chain.Ramping still bridges gaps, a ramp limit across one being restrictive rather than permissive, and gaps are located from the calendar a sample records as its source – so a hand-made sample warns instead of guessing.
setCalendar()’s first argument after the object is nowcalendar, which takes a calendar object. PassingnewCalendar()’s arguments by name (setCalendar(cfg, name = , timetable = )) is unchanged; passing them positionally is not.A model’s currency and an object’s are reconciled, not merely compared. An object priced in another currency used to be an error at
newModel(); whereconvert()can answer it, it is now converted at interpolation and reported. A pair with no conversion at all –bnEURis not a unit – is still refused, at construction.The figure functions that return a ggplot object are named
gg_*:gg_map(),gg_heatmap(),gg_trade_map(),gg_trade_network(),gg_share_frontier(). Theplot_*names forward with a one-time warning and go before 1.0.plot_geoscale()is deprecated without a successor here: callgeoscales::gg_geoscale()ongetGeoscale(object).plot()on every energyRt class now draws the figure and returns it invisibly, like baseplot();autoplot()returns the ggplot to modify.autoplot()on a calendar is drawn bytimescales::gg_calendar().labelstakes"name","timeslice"or"none"(label_by,label_colorandshow_leafsare gone – subset the calendar first);referencestays.The
s4_h24_subset_2seasonsandm12_h24_subset_4monthscalendars are removed: both sampled an already-representative design, so their weight was the product of two reductions.weather@defVal,tax@defValandsubsidy@defValare the override table above, not a number. ThedefVal =argument is unchanged – a bare number folds into the column the class owns (wval; a levy’sinp/out/bal), anddefVal = 0equals the catalogue default and so records nothing. The three slots were inert: nothing read a levy’s, and a weather’s reached no parameter, so this gives them the effect they always described.The currency rates in
convert_datamoved. They were undated and not all from the same year – a euro rate from one year sat beside a yen rate from another – and are now generated fromcurrency_fxat one declared base year.convert("MEUR", "MUSD")and every other cross-currency conversion returns a different number; conversions within one currency, such asconvert("EUR/kW", "MEUR/GW"), are unaffected.-
config@currencyis gone, folded intoconfig@units$currency. The model declares its generic units in one slot, with the same column names an object uses, so the check comparescurrencywithcurrencyrather than a differently-named scalar:newModel("demo", currency = "MUSD") # unchanged newModel("demo", units = data.frame(currency = "MUSD")) # the same thingcurrency =is unchanged as an argument and a saved config’s@currencyis migrated from the orphaned attribute, as@unitis.config@unitsalso carriescomm,capacity,activityanduse— the model’s generic units, declared and reported. Nothing here converts a value. -
The scalar
@unitslot is gone. A commodity’s, a flow’s or a weather series’ own measure lives in@units, the same slot a process already used:@units$commfor the commodity an object is counted in,@units$wvalfor a weather value.commodity,demand,import,exportandweathergained the slot;supplycarried both shapes and lost the scalar one. Read it with the newgetUnit()accessor, which returns one value orNA_character_:co <- newCommodity("ELC", desc = "Electricity", unit = "GWh") getUnit(co) # "GWh" -- was co@unit co@units$comm # "GWh" -- where it is storedunit =is unchanged as a constructor andupdate()argument, so authoring code does not move; it writes the column, and an explicitunits =in the same call wins. A saved object’s@unitis migrated, not lost: a slot removed from a class definition survives deserialization as a plain attribute, and bothgetUnit()and the unit resolver read it.Three places declared units in two shapes under two names one letter apart, which is why six classes could not state a currency at all and
tradecould not state the commodity its 39 priced columns are measured in. -
config@defValandconfig@interpolationare empty override tables keyed by parameter name, not pre-filled tables keyed by column name. Setconfig@interpolation$pDemand <- "inter"orconfig@defVal$pTechAf.up <- 0.5; a key naming no parameter is an error. Every parameter is now overridable, where 103 of 190 columns were not. A model or scenario saved before this release carries the old ~100-column table in these slots and must have it cleared or re-keyed.A parameter’s default and interpolation rule are declared in one place, the catalogue (
data-raw/parameters.yml).data-raw/config_default_values.yml,data-raw/config_default_interpolation.yml,R/defaults.R,.defValand.defIntare gone: they were a second copy of every default, keyed by bare column name, and had drifted —stockresolved totrade’s rule fortechnologytoo. -
solve_myopic()is renamedsolve_recursive(), withmyopic_objective()torecursive_objective()and the result class frommyopictorecursive. The driver steps through the horizon’s milestones carrying capacity forward, which is recursive dynamic; it is only myopic in its default special case (step = 1,overlap = 0), sinceoverlapgives a step look-ahead andstep > 1solves several milestones jointly. There are no aliases.Sequences already on disk are unaffected:
variant.ymlnow recordstype: recursive_step, andread_sequence()reads the oldermyopic_stepas the same driver. sliceistimeslice, and acalendaris required; thetsl2*()helpers moved to timescales.Storage:
vStorageStoreisvStorageLevel;@cap2stg,@chargeand@infloware refused (use@duration,@startLevelor asupply); flows are bounded by converter capacity (inp.af.up/out.af.updefault to 1).technology@aeffno longer takesstg2ainp,stg2aout,sinp2ainp,sinp2aout,sout2ainporsout2aout; they were never read for a technology. A storage’s own@aeffkeeps its couplings.@start,@endand@olifeare merged into@vintage; vintage and cluster labels must be declared.@geolevelis@geoframe, and a model carries aGeoscale.Taxes and subsidies are indexed by instrument;
newConstraintS()andnewSub()are removed.Storage auxiliary couplings are part-prefixed (
inp.cap2ainp, …).The first argument is
objectin 66 functions; the scenario API is verb-first (save_scenario(),load_scenario(), …) withen_registry; 46 helpers are no longer exported; the 0.5-era deprecations are removed.The Julia and Python backends exchange Arrow files (
Arrow.jl,pyarrow);arrow_formatis split intostorage_formatandexchange_format.UTOPIA is TOPIA (regions
W1/W2,C1-C6,E1-E3); the test tiernightlyisfull.topia$modules$goldenis no longer shipped. The retiring per-layout kits are a test fixture (tests/testthat/fixtures/topia_golden.rds); examples and articles usetopia$modules$electricity.TOPIA’s horizons are rekeyed:
$horizons$baseis$BY2025_50_by10and$unitis$BY2025.The cloud presets are renamed:
mmcloudismm_cuopt_cloud,mmcloud_crossoverismm_cuopt_cloud_crossover,mmcloud_pyomoispyomo_cuopt_cloud,mmcloud_pyomo_crossoverispyomo_cuopt_cloud_crossover; a solve with a former name stops and names its replacement.mm_engineis replaced bymm_solverandwhere; settings stored by earlier versions are still read.get_hf_token()andset_hf_token()are removed: usemmcloud::get_hf_token()andmmcloud::set_hf_token().autoplot()on ahorizonmarks the milestones that are given rather than optimised: the base year and any milestones before it are washed out, with a rule at the last given year and a caption naming the states.
Breaking changes
-
TOPIA’s finest geoframe is
province, notregion.regionis energyRt’s own spatial dimension –newModel(region = )and theregioncolumn of every parameter table – so a geoframe of the same name madelevel = "region"read as the generic one. The hierarchy is nownation -> zone -> provinceover the same codesR01..R12, andgeoframe = "province"addresses the finest level:geoscale_regions(topia$geoscales$honeycomb, geoframe = "province") filter_geoscale(topia$geoscales$honeycomb, "province", c("R04", "R05"))The leaftable still carries a
regioncolumn – the atom key, a copy ofprovince– so anything joining onregionis unaffected, and the model’s regions are still the twelve codes.level = "zone"andlevel = "nation"are unchanged. topia’sEBIOis a multi-fuel plant. It takes a grouped input overBIOand the newWSTcommodity, withcinp2ginpof 1.00 and 0.74 and nogrp.sharebounds, so one plant burns either fuel or any blend.topiagainsWSTandSUP_WST.WSTcarrieslimtype = "FX", so what arises may not be spilled, andSUP_WSToffers it free at the gate under anava.upceiling in every milestone. Waste is therefore the first fuelEBIOburns wherever it is built.topia’sEXP_H2is bounded by a terminal. It is declared in the five coastal provinces with anexp.upthroughput each, where it was declared in all twelve at a bound high enough to be no bound at all.topia_profiles(calendar = )accepts only the calendars the shipped profiles are built for;"m12_h24"and"topia_seasons"are removed.
Bug fixes
draw()draws technologies with an output group again.The process window chart draws one bar per vintage. It showed only the earliest cohort, which for a vintaged process is the stock vintage that cannot be built, so every investable vintage was hidden and the chart read as having no investment window.
The model report calls the window chart’s processes “sampled” only when some were left out.
Rows appended to a parameter that is already on disk reach its store.
.dat2par()wrote them to@data, whichget_data_slot()reads only when the store comes back empty, so a coarse region’s investment rate was lost and the EAC then refused the cost that needed it.A storage part whose stock a fixed ratio (
inp2out.fx,duration.fx,inp2stg.fx) determines has it derived at interpolation; an undeclared part read as a hard zero and pinned the declared part to zero. Declared values that disagree are refused.A set column read from a scenario’s on-disk store is character, as it is in memory. The dictionary encoding leaked past the file boundary through
get_data_slot(), so the same table differed between the two storage modes by class alone.getData(timeframe = )on a single milestone year that has a calendar of its own rolls up with that year’s weights; it took the model calendar’s and understated the total by the year’s fraction.The scenario report’s dispatch day is taken from the timeslices of the year it draws; it came back empty when the last milestone’s calendar lacked the first day of the model calendar.
getObjects(class = )andgetNames(class = )take a vector of classes. A vector reached a comparison that recycles against the object list, so the call returned an arbitrary subset and said nothing.A visible solver opens one console window on Windows, not two.
system()already runs its argument throughcmd.exe, so thecmd /kprefix added a second shell that outlived the solve.A zero right-hand side reaches the solver as
0: a constraint’s own parameters now interpolate with every row explicit, sonewConstraint(replace_zerros = )is no longer needed and is deprecated.It had substituted
1e-20for each zero and for a zerodefVal, which became the written parameter’s default, so every row of the constraint read1e-20. An all-zerorhstable also used to stop the build; it interpolates.A value too small to be meant is reported:
validate_scenario_parameters()gains atiny_valueadvisory, andaudit_coefficients()reads the right-hand side it skipped by design – which is why a1e-20rhs was invisible to it.A GMPL table carrying an
NApaired its values with the wrong tuples; the write is refused naming the parameter.write_model()andsolve_scenario()declareroundandround_tolrather than taking them through....round(scenario)/round_scenario(digits, tol)andwrite_model(round = )strip values below a tolerance to exactly zero and optionally round the rest, for a scenario already built.The JuMP backend narrates its build: a task block naming the project, scenario, run, solver and log files, a progress bar for the parameters, variables and constraints, the solver’s own log, and a closing summary.
It used to print one unconditional line per parameter and equation and nothing else, so a long build looked like a hung process. Needs
ProgressMeter(en_install_julia_pkgs()).A run directory is reported as project / scenario / run on three lines instead of one absolute path that wraps, and the record and log file names are named with it.
A detached run’s record is closed by the process that owns the solve, not by the one that launched it, however fast the solver finishes.
A detached run whose solver has stopped is no longer reported as running, and one that produced no usable solution reads
failedrather thanfinished.export_format = "gdx"works again, through GAMS Transfer (gamstransfer). No shared library is loaded, soset_gdxlib_path()is no longer a prerequisite.A solved variable with a repeated dimension keeps it: the retirement variables and
vTradeIrcame back one dimension short.Interpolation prints less at the default verbosity;
verbose = 2restores the detail.A NEOS solve reports one status line, rewritten in place on a live console, rather than one line per poll.
GDX files are written compressed. GDX compression is a flag inside the format, so GAMS reads them unchanged; the file is several times smaller.
A scenario built with the default
sparse = TRUEwrites to GAMS; the refusal that asked for a second interpolation withsparse = FALSEis gone.solver_options$neos_gams_gdx_cplex,neos_gams_gdx_cplex_barrierandneos_gams_gdx_cbcsend the data to NEOS as a compressed GDX instead of inlining it as GAMS text, which is what gets an hourly model under the job-input cap.verboseis a level on every pipeline verb, and a call’s level wins while it runs:0silent,1one line per stage,2per-parameter detail. As a logical it could not reach the gated emitters, soverbose = FALSEdid not silence them.Write, solve and read narrate like interpolation – a banner and one timed stage line each – and the backends’ own narration moved to level 2. A matrix solve’s loudest block, which nothing could silence, is now gated with the rest.
A run record never reads
status: solvedwith no objective: a known objective is no longer overwritten withNA, and a run that was optimal while itsvObjectivecame back empty is recordedunknown, with a warning naming the reason.update()refusesperiod, on ahorizonand through aconfig, and namesnewHorizon()/setHorizon().intervalsis derived from it, so writing one slot at a time left the milestones naming years the new period did not contain.A slot of an unnamed object is checked for conflicting rows instead of stopping.
@nameischaracter(0)there, and the message built from it made the conditionNA, soupdate()on any unnamed object died before a row was read.update(config, ...)refuses the calendar slots derived from a timetable and namessetCalendar():timetableitself,timeslice_share,timeframe_rank,timeslices_in_frame,timeslice_familyand the three relation slots.They were accepted only because
update()forwards every argument into the calendar’s slots, so setting one wrote it and left the rest describing the previous calendar.A table handed to a keyed slot is checked for conflicting rows whether it is a data.frame or a data.table. The guard used data.frame indexing, which a data.table reads as a column name, so
newSupply(supply = <data.table>)stopped on an error.levcost()on a container says what it could not price: a process whose input commodity nothing supplies was skipped behind a verbose-gated message. It now warns once and carriesattr(x, "unpriced")naming each process and the reason.levcost()takes the region from every slot that names one, asby_regionalways did. Reading only@regionand@capacitypriced a technology whose regions appear ininvcostalone in a region where no row matched, so every number wasNA.A
tradelevelized cost carries the traded commodity’s unit, taken from the container. PJ-priced fuel corridors otherwise sat in one table beside GWh-priced ones with nothing to tell them apart.A levy on a storage part that does not exist is reported instead of charging nothing:
inp.cap,out.ncapand their siblings are summed over the part’s own capacity map, so a rate on a storage without that converter multiplied nothing.validate_scenario_parameters()names it aslevy_no_part, per cell and per levy – an advisory, since a levy selecting every storage legitimately sweeps reservoir-only ones.The
setCalendar()example runs. Its horizon was built fromnewHorizon(c(2030, 2035, 2040), ...), whereperiodis a span rather than a list of milestones, so the years it then asked for were not milestones of the horizon it built.autoplot()on a single-intervalhorizonshows both of its boundaries. The leading tick was the first interval’s start unshifted, which collapses onto the milestone whenever that interval is one year, leaving the shipped one-year horizons as a slab with a single tick at the right edge.The year legend of
autoplot(<horizon>)breaks on whole years; on a short horizon the continuous scale put breaks between them (2032.5).check_feasibility()reports a third contradiction,forced-supply-no-sink: a commodity balanced as an equality that is forced to arise where nothing can consume it. The sinks come from the interpolated gating maps, so a consumer whosevintagestarts after the supply does is caught – a case that is invisible in the declarations, because it is the years interpolation fills between two milestones that have no consumer.newHorizon()warns when years of the period belong to no interval. Such a year is in the horizon’s span but carries no milestone, so nothing of it enters the problem; it used to be accepted silently.TOPIA’s waste arising is a ceiling (
ava.up) rather than a fixed quantity. Fixed, it forced waste to arise in the years beforeEBIO’s vintage opens, where the equality balance left nowhere for it to go, so a horizon that modelled those years was infeasible.topia_profiles()no longer fails when a requested province carries none of a resource’s grades; the absent series is dropped instead of being returned as a two-column frame.topia$weather’s"simulated"set now carries the same grades as the measured one. It had a single ungraded series per resource, which no clustered technology could use.A geoscale whose finest geoframe is not called
regionnow works throughout.get_process_groups()and the clustered aggregation read that name from the geoscale instead of assuming it, andgg_trade_map()accepts a plainsfkeyed on it rather than requiring a column calledregion.get_process_groups()labels a corridor family with its own prefix. A trade named<prefix>_<src>_<dst>– one separator, which is what bi-directional corridors use – was read as carrying no endpoints and fell back to a constant, so every family in a model came back under one label andaggregate_model_regions(clusters = )had no key that named any of them.A process group’s label no longer ends inside a name part.
ECOA_R01andECOA_R09were labelledECOA_R0, half a region code, because the longest common prefix was taken as the stem.pYearFractionis the fraction of the year a milestone’s timeslices cover, read from that year’s calendar. It came fromsettings@yearFraction– a slot deprecated as unwired – whose single row was recycled across the year rows rather than joined onyear, so it reported 1 however the calendar was sampled. No equation reads the parameter today, but all four backends declare it.newHorizon()kept every column of anintervalstable except on the path that forces the base-year interval to one year, which rebuilt the table from a fixed four columns and dropped the rest.A resource grade declares the regions it exists in, so narrowing a model’s regions can delete a grade outright.
subset_model_regions()dropped the roster row but left the rows keyed on that grade in@aeff,@invcost,@fixomand@af, and interpolating the sub-model then refused it (“Undeclared cluster label(s)”). The orphaned rows are dropped with the grade, and an object none of whose grades is in the sample leaves it.levcost()averaged a graded resource’s profiles into one capacity factor, so every grade of a technology came out at the same levelized cost – the one thing grading them is for. Each cell is now priced at its own grade’s capacity factor.levcost()also failed outright on a graded or availability-bounded resource, naming regions its mini-model does not declare.A container report’s levelized-cost table reported the first cell of a process declaring vintages or grades as the cost of the whole process, dropping the rest. It now carries one row per cell, with its vintage and grade.
Calendars whose timeslices stand for several of the unit their timeframe names –
s4_h24,m12_h24,wd7_h24,w52_h24– carried the repetition as a longershare, andsharescales every per-timeslice bound. Storage built on them was oversized by that factor, while costs and annual totals stayed right. The repetition is a timeslice weight, so a model returns the same capacities and objective on any of them, and a timeframe namedHOURwhose timeslices are longer than an hour is refused.commodity@emis$unitand@agg$unitare rates, reported as declared.getUnits()divided both by the commodity’s own unit, which was right for neither: an emission factor’s denominator is already this commodity ("kt/PJ"was reported askt/PJ/{comm}), while an aggregation coefficient’s numerator is the one that matches it ("kt"on aktaggregate was reported askt/{comm}). A new check warns when either column holds a quantity instead of a rate, and when the side that must agree with@units$commdoes not – a warning, never an error, since a unit is reported and cross-checked and never converted.getUnits()on acommodityerrored with “argument is of length zero” whenever the commodity declared no unit, which is every commodity in the shipped test models: the default wascharacter()andnzchar()on it returnslogical(0).A unit declared in
@units$commwas read as a commodity name by the undeclared-name and unused-name checks, which sweep every slot for a column calledcomm. A model withnewCommodity("ELC", unit = "MWh")failed to build with “The model references undeclared name(s): commodity: MWh”.storage@durationand@inp2stgwere reported in hours, which is wrong.durationis energy capacity per unit of power capacity in the stored commodity’s own units — PJ per GW for an ELC store — because the equations multiply it by the discharging capacity with no conversion. A four-hour battery is4 * 0.0036 = 0.0144, not4.inp2stgis its inverse. The numbers in a model are unchanged; whatgetUnits()and the class documentation claimed about them was not.Units now cover the classes that had none.
trade’s 40 parameters, the 24 weather coefficients,tax,subsidy,calendarand the discount rates all report a unit where they reported nothing: 254 of 321 catalogued columns carry one, against 135 before.waccandsdrare1/yearrather than a bare fraction, and a weather coefficient isfactor— dimensionless but explicitly not bounded by 1, since low temperature raising conductivity can put output above nameplate.The
@unitsmoney column iscurrency, notcosts:units = data.frame(capacity = "GW", activity = "GWh", currency = "MEUR"). The token is money in every formula and never stands alone, socostsnamed the quantity the formula builds by dividing.costsis still accepted and normalised on input, so existing code keeps working.The short interpolation-rule spellings now work.
bwdforback,intormidforinter,fwd(alsoforw,frw) forforth, in any combination:bwd.mid.fwdisback.inter.forth. They were documented as aliases but errored with “Wrong interpolation rule”, because the token set was defined three times — a substring strip in the validator, a loose regex in one engine, literal matches in the other. There is one table now, every spelling is normalised to the canonicalback.inter.forthform on the way in, and an unknown token is an error naming the accepted set.A parameter’s unit is declared with it, as
unit:on the parameter indata-raw/parameters.yml, rather than in three hand-written lists inR/units.R.getUnits()is unchanged in shape and gains the formulas those lists could no longer reach: 22 of their keys addressed columns that do not exist, sotechnology@ceff$grp.share.*and twelve storageaeffcolumns had silently lost their units.A constraint’s terms move with it.
@lhsis a list, so no slot loop reached it: aggregating regions moved a constraint’s row domain and its right-hand side but left each term’s coefficients, and the regions it sums over, naming regions that had been merged away – which then matched nothing. A coefficient that differs across the merged regions is refused, because the merged one would have to be weighted by the variable it multiplies, which is not known before the solve.An object with no size of its own is weighted by the scale. Aggregating regions took a plain mean wherever the object carried no capacity to weight by – a weather profile has none – so every region counted equally, although the documentation promised a size-weighted mean. The weight now comes from the geoscale (area, or whatever weight it declares), which a profile cannot supply for itself.
Values that add are no longer averaged. A storage start level is energy, like
stg.stock, and a per-region constraint right-hand side is the budget of the rows being merged; both were averaged across regions.paybackis a lifetime, likeolife, and is now copied rather than averaged, including storage’sout.,inp.andstg.forms, which an exact-name lookup had missed.recast_model_calendar()treatsclusteras an identifier, not as a value to recast.A wildcard row beside named rows is no longer ignored. An NA in a key column means “every member of that dimension”, but interpolation treated the NA as a member of its own: a base-year anchor written
region = NA, timeslice = NAbecame a separate series, anchored nothing, and was dropped – the later milestone’s value was back-cast over it as if the row were absent. Every class was affected (reported ondemand, reproduced onsupply). A wildcard row is now broadcast onto the members its own object operates at, with explicit rows still winning cell by cell, so the two spellings of “all regions” give the same answer. Declaring the column and omitting it already worked and is unchanged.A zero supply ceiling bound instead of reading as unbounded.
ava.up = 0was excluded frommSupAvaUp, which kept only rows withvalue != 0although the upper bound’s default isInf. The parameter carried the zero, no equation read it, and the supply solved without a limit. The gate now drops only genuinely default bounds (Infforup,0forlo), so a declared zero closes the supply as written.check_feasibility()read its tables from@dataand its declarations from the object slots directly, so it saw nothing of a table parked in the scenario’s store (save_scenario()empties@dataaboveenergyRt.ondisk_min_rows), nothing of a map defined by a rule, and nothing of an object saved on disk – and reported “no contradiction” instead of checking, silently, on exactly the large models where it matters. Every query now goes throughget_data_slot()andget_lazy_data().open_project()returns the option values it replaced, as documented. It collected them from theset_*()calls, which report the previously SET value – empty for a working default never set explicitly – so on a fresh session the list came back empty and restoring a previous project from it did nothing.clear_run()takes a path as well as a scenario, and records the abandonment in the registry. It required a loadable scenario, which the cases it exists for – a run recorded on another machine, or a store in a layout this version no longer reads – often cannot provide, although only the run’s directory is ever read. The run’s registry row is updated from the rewritten record, so a listing no longer saysrunninguntil the nextrefresh_registry().newModel()compares the model’scurrencyagainst each object’s@units$costsat construction. The check existed but ran only ininterpolate_model(), so an object priced in another currency sat in a model until something unrelated failed much later.plot_trade_network()draws routes declared at any level of a geoscalemap. It placed nodes at one level – the finest, unlesslevel =named another – so a corridor declared where its commodity is balanced was dropped with a warning about regions “not inmap”.level =still selects one level, andplot_trade_map()already drew every level – the two views now agree.autoplot()refuses a bareunitsvalue instead of dropping it.unitsnames a base unit per commodity (units = list(ELC = "GWh")); a parameter name passed there –units = "cost", whereparam = "cost"is meant – was accepted and ignored, and the chart then drew something else in silence. A style that labels from the object says thatunitshas no effect on it.A
demandnaming no year was dropped instead of read:aggregate()drops NA groups, socheck_feasibility()andautoplot(style = "area")both stopped with an aggregation error. The requirement is now checked and reported atyear = NA, andyears =keeps it; the annual stack asks foryear =when the object names no window of its own.drop_solver_outputs()could delete the working files of a solve in progress:.art_suggest()labelled anyrunningrecord stale with no check of the owning process, and the cleanup unlinks exactly the suggested rows. Only a run whose process is demonstrably gone is now treated as reclaimable scratch.A column a slot does not have is reported with the object, the slot, the columns that look meant (
stock->inp.stock,out.stock,stg.stock; a near spelling) and every column the slot accepts. An object whose slot was assigned directly (@<-) is checked when it enters a repository or a model, instead of failing later in interpolation with an unrelated message.A storage’s stock without a vintage (
inp.stock,out.stock,stg.stock) was given to every vintage, so a storage with several vintages carried its stock once per vintage. It now goes to the earliest vintage only, as a technology’s and a trade’sstockalready did.A user constraint row in which no term has a member of its variable’s domain (a technology that cannot be built yet in that year) is dropped at interpolation, with a message, when it could not bind anyway (
<=a non-negative value,>=a non-positive one,==zero). Before, it reached the matrix as an empty row, which the matrix route refuses. An empty row that would make the model infeasible, or a constraint empty in every row, is an error. Rows the check cannot decide (a region or timeslice that sums the levels beneath it, a year lag or lead) are kept.A vintage’s
endended the capacity built in it as well as its investment window: capacity of a vintage whose window closed before a later milestone was gone in that milestone. Capacity now stands from its build year for its operational life (olife), whatever the window.newConstraint()discarded a single-valuerhswheneverdefValwas set, anddefValis always set (given, or 0 /Infby default), sorhs = 100built a constraint at 0, or with no limit for<=. A single value is now the right-hand side of every row and replacesdefVal, with a warning when they differ.A weather series at a coarser timeframe than the availability bound it multiplies (
waf) read as zero and silently switched the technology off. It is now an error naming the series and the timeslices.unmark_delete()leftdelete_importanceandmarked_atbehind in the manifest, so an entry with no mark still carried an importance beside it and read as marked-at-some-tier to any reader that did not also testmarked_delete. The registry masked this, since it NAs the importance of an unmarked entry; the manifest did not. Both fields are now cleared, for an entry and for a version.interpolate_model(base =)refused every base when the caller also passedpath =. The base is dispatched before the control arguments are read out of..., sopathreached the addition check and was reported as “an object of class character is added; interpolating in full.” Every solve driver passespath, so none of them could build on a base, and because the refusal is a message it was invisible behind theirsuppressMessages(). An argument now counts as a model addition only if it is an energyRt object.A reloaded
solve_by_region()sequence served every variant the FIRST unit’s model. The scenario stored the model it was interpolated from, which the driver had already cut, while@modellives on the shell and is written only on the first save – so region R2’s results came back beside a model declaring R1, whose own R2 rows were empty.verify_solution()re-derives identities from that model, andlevcost()andreport()read its declarations. The driver now stores the full model with each unit’s region set, and the cut is rebuilt per variant.solve_by_region()accepted overlappinggroup =entries, or a repeated region inregions =, and solved and counted that region twice – including in the “sum of objectives” its print method presents as the whole-system cost. Overlaps are refused, naming the regions.sample_summary()’smeanis weighted by each sample’syear_fraction. Samples need not cover equal shares of the year –method = "sequential"folds a trailing singleton block into its predecessor – and the mean previously gave a larger block the same single vote. The quantiles remain unweighted, and a message says so when coverage varies.subset_model_regions()clears the parent’s recorded content hash. The subset keeps the model’s name on purpose andsave_model()updates an entry in place by name, so saving one could overwrite the full model’s store entry.read_sequence()no longer reports aby_regionsequence as complete while returning itsboundarystub counts asNA; they are declared missing.A spatial sample survives a variant switch: the problem cartridge records it, where before only the shell held it and a reload restored another unit’s regions.
A filtered geoscale announces the sub-territory solve unconditionally. The mode is accepted silently, so a geoscale covering only some declared regions used to yield a smaller solve – a different answer from the full model’s – with nothing said unless
verbose.About 130 fixes, most of which change results: unwired parameters now reach the solver, equations are no longer instantiated without data,
waf.fxbinds from both sides,aeff$cout2ainp/cinp2aoutbind, sub-region emissions are counted, coarse supply keeps its cost, andget_process_*(process = )is honoured.A tax or subsidy without
@regioncharged the coarse regions of a geoscale too, i.e. the roll-up of their sub-regions a second time. A commodity rate now applies at the commodity’s own regions and a process rate at the regions the process is declared in; a region off that level is an error.levcost()of a storage sized a charger with noinp2outorinp2stglike the discharger, and a discharger with nodurationat one hour of storage. Each is now sized by its own flow, as in the solved model.levcost()of a storage annualised every part over the discharger’s payback and wacc. The charger, discharger and energy now each use their own, as in the solved model; a battery whose store outlives its inverter was overpriced.Auxiliary flows (
aeff) of a process were lost when it gave the coefficient for all timeslices and another process gave the same coefficient for named timeslices.Capacity taxes and subsidies on a storage charged nothing unless it had discharger data. They are now levied by part (see above); a levy that selects storages and sets only
cap/ncapis an error.A bound declared per region on one object and for all regions on another lost the second object’s bound equation (e.g. a fixed storage duration).
Content hashes of models with a geoscale are stable between R sessions (the S7 class object was hashed), so such models match their sealed versions in a new session.
Documentation
-
?topiadocuments what the dataset actually ships: the two calendars, thedataset,regionandclustercolumns ofweatheranddemand, andtopia$grades. - The
time-resolutionandregion-aggregationarticles uses4_hp3ands4_h24; they reached fortopia_seasons, which no longer ships. -
levcost()documents that a grouped input is priced like any other and that an unconstrained group has no share frontier; it had said a grouped input reports no fuel component. - A rebuilt pkgdown site with tutorial articles, and a runnable example on every public help page.
- The testing strategy (tiers, the
@coversmatrix, goldens) is documented intests/README.mdandtests/TESTING.md.
energyRt 0.50.9-dev
Breaking changes
- Time-slice weighting is rewritten: variables with a
slicedimension are no longer weighted, for consistency between sampled and non-sampled runs. Slice weights can vary across model years. - Variables with a
yeardimension are no longer weighted to interval lengths, except cumulative variables (vSupReserveCum) and capacity variables, which represent the state at the end of the period. - New-capacity variables (
vTechNewCap) are given per year — applypPeriodLento get total new capacity by the end of each period. - System costs are regrouped by type (capital, fixed O&M, variable O&M, supply, taxes, subsidies) and by process type, and the Total Costs equation rewritten to match.
Bug fixes
-
optimizeRetirment = TRUEno longer retires new technologies at the same time as their installation. -
draw()on a trade no longer repeats arrows. -
newCosts()is debugged, with an example in the Topia tutorial. -
tsl2hour()identifies n-digit hours; it previously worked for two only.
energyRt 0.50.7-dev
Bug fixes
- Several stability issues in
draw().
energyRt 0.50.6-dev
New features
-
draw()is drafted for every process class —technology,export,import,supply,demand,trade,storage.
energyRt 0.50.5-dev
New features
-
draw()is rewritten on thegridpackage and is now a generic, with methods fortechnology,exportandimport.
energyRt 0.50.3-dev
Documentation
- A
NEWS.mdfile to track changes;technology-classandnewTechnology()documented. Development version in preparation for CRAN submission.
