Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ogusa/parameter_plots.py to og_uk_calibrate/parameter_plots.py #9

Open
rickecon opened this issue Apr 21, 2021 · 3 comments
Open

Comments

@rickecon
Copy link
Member

PR #2 uses ogusa/parameter_plots.py in the txfunc.py module. PR #3 creates a parameter_plots.py file in the og_uk_calibrate/ directory. We should make all parameter plots go through the og_uk_calibrate/ directory so that file can be modified for each country.

@jdebacker

@jdebacker
Copy link
Member

@rickecon This is worth some discussion, I think.

Since each calibration repo needs to put parameters in the same format (so they can be input into OG-MOD) and since OG-USA (soon to be OG-MOD) will be a dependency of each OG calibration repo, would it be helpful to avoid duplicate code keeping the parameter plots with OG-MOD?

This issue of duplicated code comes up in other places too: e.g., txfunc.py is almost entirely the same for the USA and UK calibrations except for the get_micro_data. And I can imagine that we'll have a lot of duplication of utility functions like the MVKDE function in all of these calibration repos.

Should we try to make efforts to keep functions that will be common to all calibration repos in the OG-MOD package?

I would say "yes" as it reduces the costs associated with maintaining these functions.

@jdebacker
Copy link
Member

Ah, I see an issue with some of the parameter plots. When you plot the data, it maybe in a different format (e.g., in demographics.py, the fertility rates maybe measured with different frequency in the underlying data). So while one can plot the parameters the same across models, to plot the data with the parameters may be more custom.

Still, there may be a way around this (e.g., passing an matplotlib axis object to represent the data to the general, OG-MOD plotting function).

@rickecon
Copy link
Member Author

@jdebacker The principle you outline is correct. All functions that are common across countries should be centralized in OG-MOD. In the case of parameter_plots.py, I think it is likely that this will not be common across countries. However, if it is common across country calibrations, it will be easy to transfer it out of the country calibration repos into the central OG-MOD repo. But a module should first clear the hurdle of proving to be common across country calibrations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants