OG-Core
OG-Core copied to clipboard
Fix `num_years_to_plot` in `output_plots.plot_all`
Several of the plots in output_plots.plot_all assume that the time path is at least 150 periods (see here). This causes issues if a user sets T to a value less than 150.
A solution to this would be to replace num_years_to_plot=150 to num_years_to_plot=min(base_params.T, 150).
@jdebacker I have made the following changes to run_og_core_example.py to allow us to supply a different set of parameters to the example. I also included an option to send an email when the code has finished running.



This required changes in output_plots.py

The ability_bar also needed to be changed as it was accessing constants.py to access the GROUP_LABELS for the bar plot which was hard coded. I created a function to generate the labels from the lambdas.

@sebastiansajie I like your fixes to the output_plots.py.plot_all() function and the lambda_labels (really creative solution there!). Thank you for proposing these.
I'd recommend adding the lambda_labels() function to utils.py as it it can then be imported and used in output_plots.py and parameter_plots.py (both of which currently import the GROUP_LABELS from constants.py and therefore have issues without J in [7, 9, 10].
I think the changes your propose to the example script are best left out of OG-Core for now. I like having the example script produce output with a more realistic calibration, even if it does take more time to run. You can just keep your modified script around for your own use (I have a bunch of these for different simulations I've run).
Let me know if you'd like to open a PR (here or at Revenue-Academy/OG-Core) or if you prefer, I can do it.
@jdebacker, I can open a PR for 1) updates to output_plots.py and 2) Making changes to utils.py (adding lambda_labels()) in OG-Core and then eventually syncing it to Revenue Academy.
Addressed in PR #923.