Streamline workflow #1529
Replies: 2 comments 1 reply
-
Nice that we are moving away from almost all wildcards (except for I like the idea of changing the workflow structure first, unifying the existing "compose steps" in a single "compose rule" and then using that as our workspace to modularize based on the scenario settings. Step 1. ok! For 2., one also needs to consider Step 3. (removing Step 4. seems unnecessary. Instead, one could focus on re-writing how power plants are added and make that function dependent on the config (e.g., as links or generators) after step 5. Step 6. ok! For steps 7/8., I am unsure yet if this can all be done within PyPSA (although this is not a show-stopper for starting with 1-6). I think with this approach we may run into limits with regards to including new data / custom changes between investment periods. It could also have advantages to have the investment periods as different snakemake jobs for deployment of the cluster (i.e. saving intermediate states and not starting from scratch if optimisation fails in last investment period). These are my thoughts for now. |
Beta Was this translation helpful? Give feedback.
-
Short follow up on an internal discussion: To internalize the myopic and perfect-foresight option, the compose step would allow to take a composed network from a previous horizon as input. The output of the compose would then include the previous horizon and append the current horizon. Depending on myopic versus perfect foresight, the input network is already solved or not. Example workflow for composing and solving a myopic network:
...
The output then contains a solved network with all horizons included. Example workflow for composing and solving a perfect foresight network:
... until 2050. The output then contains a composed network with all horizons included. The network is not solved yet. The final step then optimizes the composed network including all horizons.
In both cases, the final output is a solved network This setup would require to integrate |
Beta Was this translation helpful? Give feedback.
-
Hey all,
I am opening a discussion on potential routes for refactoring the workflow. I guess this is most interesting for @fneum @lkstrp @coroa and @nworbmot
This is only a draft and summarizes what I have in mind, see it as inspiration and kick-off with some random aspects rather than a fixed, clear picture.
Target
Restructuring the workflow
To have a clear set of steps I would propose to follow four steps in order to create the solved network (with arbitray combination of sectors)
base
)clustered
)composed
)solved
)The target file name of the network would then be
base_clustered_composed_solved
.The target file and thus the process are not dependent on wildcards and is configured solely through the (scenario) configuration. Logically there is now big difference to the current elec-only network, only that the
solved
step is integrates the currentprepare_network
.First Q: Are these steps sufficient? Or anything missing here, already?
Implementation strategy
If we decide for going into this direction, I would still try to
Thus the plan would include
add_electricity.py
/prepare_network.py
/prepare_sector_network.py
/add_existing_base_year.py
standalone functions (not dependent on wildcards or thesnakemake
object).{clusters}
wildcard to "clustered" with the value taken from the configuration.add_electricity
to optionally create carrier hubs for thermal generation as we know it fromprepare_sector_network.py
. This is not fully necessary, as far as I see itcompose_network.py
which contains the composition of the network. It is importing all the functions from the original scripts (add_electricity
,prepare_sector_network
,add_existing_baseyear
) and essentially combining theirmain
sections.compose.smk
which defines the rule for composing the network and possibly others. The rule input isbase_clustered
and the output isbase_clustered_composed
.compose
step for multiple horizons in thecompose.smk
file. Which are then merged into onebase_clustered_composed
network. This contains all the components of the network for all horizons. This should likely be a separate rule in thecompose.smk
file.Open points
compose
for each horizon with the previous horizon result as input.Beta Was this translation helpful? Give feedback.
All reactions