This is really painful if there are a lot of years before the simulation's start and you want to specify them individually, rather than with all.
I think we should check for flows eagerly in the case of milestone years (we don't know which years the process will actually be commissioned in, so we assume it could be any of them) and lazily in the case of non-milestone years (i.e. check whether the flows are valid when constructing the assets in assets.csv). This means if a user omits some or all process flows for a non-milestone year, it's fine as long as they don't have an asset of that process type commissioned in that particular year listed in assets.csv. This seems like the only reasonable way to do it. We can't just check that flows are valid for any year that has flows as we allow users to put all in the years column, so if one flow has years==all and another is just specified for a few years, then it would complain.
diff --git a/examples/simple/process_flows.csv b/examples/simple/process_flows.csv
index 88c03c51..8186a3e2 100644
--- a/examples/simple/process_flows.csv
+++ b/examples/simple/process_flows.csv
@@ -1,5 +1,7 @@
process_id,commodity_id,regions,years,coeff,type,cost
-GASDRV,GASPRD,all,all,1.0,fixed,
+GASDRV,GASPRD,all,2020,1.0,fixed,
+GASDRV,GASPRD,all,2030,1.0,fixed,
+GASDRV,GASPRD,all,2040,1.0,fixed,
GASPRC,GASPRD,all,all,-1.05,fixed,
GASPRC,GASNAT,all,all,1.0,fixed,
WNDFRM,ELCTRI,all,all,1.0,fixed,
diff --git a/examples/simple/processes.csv b/examples/simple/processes.csv
index 63f48a97..f305d252 100644
--- a/examples/simple/processes.csv
+++ b/examples/simple/processes.csv
@@ -1,5 +1,5 @@
id,description,regions,primary_output,start_year,end_year,capacity_to_activity
-GASDRV,Dry gas extraction,all,GASPRD,2020,2040,1.0
+GASDRV,Dry gas extraction,all,GASPRD,2010,2040,1.0
GASPRC,Gas processing,all,GASNAT,2020,2040,1.0
WNDFRM,Wind farm,all,ELCTRI,2020,2040,31.54
GASCGT,Gas combined cycle turbine,all,ELCTRI,2020,2040,31.54
This is really painful if there are a lot of years before the simulation's start and you want to specify them individually, rather than with
all.I think we should check for flows eagerly in the case of milestone years (we don't know which years the process will actually be commissioned in, so we assume it could be any of them) and lazily in the case of non-milestone years (i.e. check whether the flows are valid when constructing the assets in
assets.csv). This means if a user omits some or all process flows for a non-milestone year, it's fine as long as they don't have an asset of that process type commissioned in that particular year listed inassets.csv. This seems like the only reasonable way to do it. We can't just check that flows are valid for any year that has flows as we allow users to putallin theyearscolumn, so if one flow hasyears==alland another is just specified for a few years, then it would complain.Reproducer
If you make the below changes to the
simpleexample it currently fails validation, but it should be accepted: