Org | |
Package | |
Testing |
Training materials for United Nations country-specific overlapping generations model. The online rendered Jupyter Book for these training materials is at https://www.openrg.com/UN-OG-Training.
This project forked from jdebacker/un-og-training
Training materials for United Nations country-specific overlapping generations model
Home Page: https://eapd-drb.github.io/UN-OG-Training/
License: GNU Affero General Public License v3.0
Org | |
Package | |
Testing |
Training materials for United Nations country-specific overlapping generations model. The online rendered Jupyter Book for these training materials is at https://www.openrg.com/UN-OG-Training.
How much detail should we add about calibrating tax functions? We must assume most countries won't have microsimulation models to link to. Given that, do we present just linear? Show how to estimate Gouveia-Strauss with aggregate data?
The GitHub chapter should include a link to GitHub's instructions to install git.
We should explain the calibration of pensions. OG-Core now allows for defined benefits, notional defined contributions, points system, and a US-style SS system.
In PR #24, I inserted the following code block into the OG/Ouput.md
chapter:
import ogcore.output_tables as ot
from io import BytesIO
import pickle
import requests
path_dict = {
"TPI": [
"https://github.com/PSLmodels/OG-Core/blob/master/tests/test_io_data/TPI_vars_baseline.pkl?raw=true",
"https://github.com/PSLmodels/OG-Core/blob/master/tests/test_io_data/TPI_vars_reform.pkl?raw=true"
],
"Params": [
"https://github.com/PSLmodels/OG-Core/blob/master/tests/test_io_data/model_params_baseline.pkl?raw=true",
"https://github.com/PSLmodels/OG-Core/blob/master/tests/test_io_data/model_params_reform.pkl?raw=true"
]
}
output_dict = {
"TPI": [],
"Params": []
}
for key in path_dict.keys():
for path in path_dict[key]:
r = requests.get(path)
output_dict[key].append(pickle.load(BytesIO(r.content)))
# make table
table = ot.macro_table(output_dict["TPI"][0], output_dict["Params"][0], output_dict["TPI"][1], output_dict["Params"][1], output_type="pct_diff", num_years=10, start_year= output_dict["Params"][0].start_year)
I have no issue executing this in Python 3.10. But with Python 3.11, there is an error with the pickle.load
command when trying to read the pickle file containing the model parameters (which is a ogcore.parameters.Specifications
object pickled with Cloudpickle). The traceback is:
TypeError Traceback (most recent call last)
Cell In[2], line 24
22 for path in path_dict[key]:
23 r = requests.get(path)
---> 24 output_dict[key].append(pickle.load(BytesIO(r.content)))
25 # make table
26 table = ot.macro_table(output_dict["TPI"][0], output_dict["Params"][0], output_dict["TPI"][1], output_dict["Params"][1], output_type="pct_diff", num_years=10, start_year= output_dict["Params"][0].start_year)
TypeError: code() argument 13 must be str, not int
I've tried just using cloudpickle
and pickle.loads
to unpack and still get an error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.