Improve how we analyze results #104
Labels
dev-tools
Related to tools and features used during development
discussion
enhancement
Medium Priority
Problem
Creating output tables for analysis is cumbersome. Right now, output tables (csv files) are created in
post_solve()
. Howeverpost_solve()
only gets run once after the model is solved. What if we want to create a table after we already have our results?We don't have a mechanism for creating comparison tables. Currently, running
switch comapre
will create comparison graphs but not tables. Yet often we want to compare specific values across multiple scenarios.We can't easily re-use graphing helper functions outside of the
switch graph
workflow. Currently, there are many useful graphing helper functions (e.g.switch_model.tools.graph.main.TransformTools.timestamp()
will automatically convert a dataframe with a timestamp to a dataframe will all the time information include timeseries, period, hour of day, proper time zones, etc.). However these functions are only accessible when using the@graph
decorator which is mainly built for functions within a switch module, not a custom graphing function you are writing locally.Proposed Solution
There are many approaches to this problem but this is what I propose. Please share your thoughts!
Change
switch graph
toswitch analyze
which would create the graphs that already exist and create comparison tables.Create an
@table
decorator that would indicate that a function should generate a table similarly to how the@graph
decorator works. These tables should get generated when we runswitch analyze
andswitch compare
.Extend the existing graphing framework (now more generally an analysis framework) to allow it to work with custom code outside of SWITCH.
Cleanup
post_solve()
to only output the essential information and calculate everything else in@table
functions. Currently, post solve tries to do a lot at once since it is both used to save results from Gurobi but also to create a user friendly format that we can analyze.I have more details in my head of how this could look like so feel free to reach out! This should give someone a starting idea of what I'm trying to get to.
The text was updated successfully, but these errors were encountered: