PSLmodels / OG-USA

Overlapping-generations macroeconomic model for evaluating fiscal policy in the United States
https://pslmodels.github.io/OG-USA/
Creative Commons Zero v1.0 Universal
19 stars 34 forks source link

Demographics plotting issues and documentation #77

Closed rickecon closed 7 months ago

rickecon commented 11 months ago

Since updating the mortality rates rho object to allow for time varying mortality rates in PR #73, the plotting functions in demographics.py functions get_fert(), get_mort(), and get_imm_rates() have stopped working. This has caused the documentation to stop building because much of the executable code in the calibration: demographics section depends on those plotting functions. We need to fix those plotting functions.

cc: @jdebacker

jdebacker commented 10 months ago

@rickecon I tested this with my ogusa-dev environment, which has

(ogusa-dev) jason.debacker@JDEBACKER-7 OG-USA % python --version
Python 3.11.6
(ogusa-dev) jason.debacker@JDEBACKER-7 OG-USA % conda list matplotlib
# packages in environment at /Users/jason.debacker/anaconda3/envs/ogusa-dev:
#
# Name                    Version                   Build  Channel
matplotlib                3.8.0           py311h6eed73b_2    conda-forge
matplotlib-base           3.8.0           py311hd316c10_2    conda-forge
matplotlib-inline         0.1.6                    pypi_0    pypi

And I am able to successfully produce plots to the default directory. Code to reproduce:

import ogusa.demographics as demog
demog.get_fert(graph=True)
demog.get_mort(graph=True)
demog.get_imm_rates(graph=True)

If you are having issues, can you share the version of Python and Matplotlib being used (or other packages you think are relevant to the error)?

jdebacker commented 7 months ago

We moved the demographics module to OG-Core (PR #86 removes it from OG-USA) and these issues have been solved.