ogeth 0.1.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ogeth-0.1.0/ogeth.egg-info → ogeth-0.3.0}/PKG-INFO +89 -18
- {ogeth-0.1.0 → ogeth-0.3.0}/README.md +85 -13
- {ogeth-0.1.0 → ogeth-0.3.0}/ogeth/__init__.py +1 -1
- ogeth-0.3.0/ogeth/calibrate.py +647 -0
- ogeth-0.3.0/ogeth/data/demographic_gradients_ETH.csv +9 -0
- ogeth-0.3.0/ogeth/data/ilostat_employment_ratio_by_age.csv +45 -0
- ogeth-0.3.0/ogeth/data/lfms2021_hours_by_age.csv +13 -0
- ogeth-0.3.0/ogeth/data/nta_labor_income_by_age.csv +178 -0
- ogeth-0.3.0/ogeth/data/wid_pretax_income_2021.csv +33 -0
- ogeth-0.3.0/ogeth/income.py +608 -0
- ogeth-0.3.0/ogeth/labor.py +336 -0
- ogeth-0.3.0/ogeth/macro_params.py +1654 -0
- ogeth-0.3.0/ogeth/ogeth_default_parameters.json +874768 -0
- ogeth-0.3.0/ogeth/update_baseline.py +84 -0
- {ogeth-0.1.0 → ogeth-0.3.0/ogeth.egg-info}/PKG-INFO +89 -18
- {ogeth-0.1.0 → ogeth-0.3.0}/ogeth.egg-info/SOURCES.txt +12 -1
- {ogeth-0.1.0 → ogeth-0.3.0}/ogeth.egg-info/requires.txt +2 -2
- {ogeth-0.1.0 → ogeth-0.3.0}/pyproject.toml +22 -6
- ogeth-0.3.0/tests/test_default_parameters.py +137 -0
- ogeth-0.3.0/tests/test_demographic_gradients.py +86 -0
- ogeth-0.3.0/tests/test_fiscal_program.py +296 -0
- ogeth-0.3.0/tests/test_income.py +241 -0
- ogeth-0.3.0/tests/test_labor.py +98 -0
- {ogeth-0.1.0 → ogeth-0.3.0}/tests/test_macro_params.py +31 -52
- ogeth-0.3.0/tests/test_remittances.py +204 -0
- ogeth-0.3.0/tests/test_taxes_pensions_wealth.py +143 -0
- ogeth-0.3.0/tests/test_update_baseline.py +162 -0
- ogeth-0.1.0/ogeth/calibrate.py +0 -136
- ogeth-0.1.0/ogeth/income.py +0 -201
- ogeth-0.1.0/ogeth/labor.py +0 -195
- ogeth-0.1.0/ogeth/macro_params.py +0 -513
- ogeth-0.1.0/ogeth/ogeth_default_parameters.json +0 -103789
- ogeth-0.1.0/ogeth/test_est_chi_n.py +0 -46
- ogeth-0.1.0/ogeth/update_baseline.py +0 -35
- ogeth-0.1.0/tests/test_update_baseline.py +0 -50
- {ogeth-0.1.0 → ogeth-0.3.0}/LICENSE +0 -0
- {ogeth-0.1.0 → ogeth-0.3.0}/MANIFEST.in +0 -0
- {ogeth-0.1.0 → ogeth-0.3.0}/ogeth/constants.py +0 -0
- {ogeth-0.1.0 → ogeth-0.3.0}/ogeth/data/IFPRI_SAM_ETH_2022_SAM.csv +0 -0
- {ogeth-0.1.0 → ogeth-0.3.0}/ogeth/input_output.py +0 -0
- {ogeth-0.1.0 → ogeth-0.3.0}/ogeth/ogeth_multi_industry_parameters.json +0 -0
- {ogeth-0.1.0 → ogeth-0.3.0}/ogeth/utils.py +0 -0
- {ogeth-0.1.0 → ogeth-0.3.0}/ogeth.egg-info/dependency_links.txt +0 -0
- {ogeth-0.1.0 → ogeth-0.3.0}/ogeth.egg-info/top_level.txt +0 -0
- {ogeth-0.1.0 → ogeth-0.3.0}/setup.cfg +0 -0
- {ogeth-0.1.0 → ogeth-0.3.0}/tests/test_calibrate.py +0 -0
- {ogeth-0.1.0 → ogeth-0.3.0}/tests/test_import_smoke.py +0 -0
- {ogeth-0.1.0 → ogeth-0.3.0}/tests/test_input_output.py +0 -0
- {ogeth-0.1.0 → ogeth-0.3.0}/tests/test_run_example.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ogeth
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Ethiopia Calibration for OG-Core
|
|
5
5
|
Author: Marcelo LaFleur, Richard W. Evans, and Jason DeBacker
|
|
6
6
|
License: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
|
|
@@ -14,12 +14,11 @@ Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
|
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
15
|
Classifier: Programming Language :: Python
|
|
16
16
|
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.13
|
|
20
19
|
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
21
20
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
-
Requires-Python: <3.14,>=3.
|
|
21
|
+
Requires-Python: <3.14,>=3.12
|
|
23
22
|
Description-Content-Type: text/markdown
|
|
24
23
|
License-File: LICENSE
|
|
25
24
|
Requires-Dist: numpy
|
|
@@ -36,7 +35,7 @@ Requires-Dist: openpyxl>=3.1.2
|
|
|
36
35
|
Requires-Dist: statsmodels
|
|
37
36
|
Requires-Dist: linearmodels
|
|
38
37
|
Requires-Dist: linecheck
|
|
39
|
-
Requires-Dist: ogcore>=0.
|
|
38
|
+
Requires-Dist: ogcore>=0.20.0
|
|
40
39
|
Provides-Extra: dev
|
|
41
40
|
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
42
41
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
@@ -47,7 +46,7 @@ Requires-Dist: ipython; extra == "dev"
|
|
|
47
46
|
Requires-Dist: ipykernel; extra == "dev"
|
|
48
47
|
Requires-Dist: jupyter; extra == "dev"
|
|
49
48
|
Provides-Extra: docs
|
|
50
|
-
Requires-Dist: jupyter-book<2.0.0; extra == "docs"
|
|
49
|
+
Requires-Dist: jupyter-book<2.0,>=1.0; extra == "docs"
|
|
51
50
|
Requires-Dist: sphinx>=3.5.4; extra == "docs"
|
|
52
51
|
Requires-Dist: sphinx-book-theme>=0.1.3; extra == "docs"
|
|
53
52
|
Requires-Dist: sphinx-argparse; extra == "docs"
|
|
@@ -69,28 +68,100 @@ OG-ETH is an overlapping-generations (OG) model that allows for dynamic general
|
|
|
69
68
|
|
|
70
69
|
## Using and contributing to OG-ETH
|
|
71
70
|
|
|
72
|
-
|
|
71
|
+
Install and run OG-ETH by cloning this GitHub repository and installing the `ogeth` package with its dependencies using [`uv`](https://docs.astral.sh/uv/), as detailed below. (Installing the `ogeth` package from [PyPI](https://pypi.org/project/ogeth/) with `pip` is no longer the recommended path: on the Python versions many machines ship, `pip` either refuses the current release outright — as on the Python 3.9 built into macOS — or silently pairs it with an older `ogcore` than the model is tested against, and even on a supported Python the PyPI route does not pin the `ogcore` version the repository is tested against. The `uv` workflow installs the exact tested versions of every dependency, including a compatible Python interpreter.)
|
|
73
72
|
|
|
74
|
-
###
|
|
73
|
+
### Installation
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
* Open your terminal and install the [`ogeth`](https://pypi.org/project/ogeth/) package from the Python Package Index by typing `pip install ogeth`.
|
|
78
|
-
* Navigate to a folder `./YourFolderName/` where you want to save scripts to run OG-ETH and output from the simulations in those scripts.
|
|
79
|
-
* Copy the python script [`run_og_eth.py`](https://github.com/EAPD-DRB/OG-ETH/blob/main/examples/run_og_eth.py) from the OG-ETH GitHub repository into your folder as `./YourFolderName/run_og_eth.py`.
|
|
80
|
-
* Run the model with an example reform from terminal/command prompt by typing `python run_og_eth.py`.
|
|
75
|
+
There are two ways to install OG-ETH: the easy way, using the OG model family's universal installer, and a manual install that runs the same steps one command at a time. Both start from a terminal, put the model in a new OG-ETH folder inside your current directory (a freshly opened terminal starts in your home folder), and need git.
|
|
81
76
|
|
|
82
|
-
|
|
77
|
+
#### Before you start: git
|
|
78
|
+
|
|
79
|
+
On a Mac where you have never used git before, run this line first and accept the dialog that appears:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
xcode-select --install
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
On Windows, install Git first (skip this if you already have it):
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
winget install --id Git.Git -e --source winget
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### The easy way: the universal installer
|
|
92
|
+
|
|
93
|
+
The OG model family has a [universal installer](https://github.com/PSLmodels/OG-Core/blob/master/scripts/QUICK_INSTALL.md) that installs the uv tool, downloads the model, builds its environment, and verifies it — for OG-ETH or any of its sibling country models.
|
|
94
|
+
|
|
95
|
+
On macOS and Linux, paste:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
curl -fsSL https://raw.githubusercontent.com/PSLmodels/OG-Core/master/scripts/install.sh -o og-install.sh
|
|
99
|
+
bash og-install.sh --repo og-eth --yes
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
On Windows (PowerShell), paste:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
$f = "$env:TEMP\og-install.ps1"; irm https://raw.githubusercontent.com/PSLmodels/OG-Core/master/scripts/install.ps1 -OutFile $f; powershell -ExecutionPolicy Bypass -File $f -Repo og-eth -Yes
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
When the installer finishes, run the example. On macOS and Linux, paste:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
source $HOME/.local/bin/env
|
|
112
|
+
cd OG-ETH
|
|
113
|
+
uv run python examples/run_og_eth.py
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
On Windows, open a new PowerShell window (so the just-installed tools are found) and paste:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
cd OG-ETH
|
|
120
|
+
uv run python examples/run_og_eth.py
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### Manual install
|
|
124
|
+
|
|
125
|
+
The same setup as individual commands. On macOS and Linux, paste:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
129
|
+
source $HOME/.local/bin/env
|
|
130
|
+
git clone https://github.com/EAPD-DRB/OG-ETH.git
|
|
131
|
+
cd OG-ETH
|
|
132
|
+
uv run python examples/run_og_eth.py
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
The second line makes the just-installed uv available in the current terminal; from your next terminal session it is available automatically.
|
|
136
|
+
|
|
137
|
+
On Windows (PowerShell), install uv:
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Then open a new PowerShell window (so the just-installed tools are found) and paste:
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
git clone https://github.com/EAPD-DRB/OG-ETH.git
|
|
147
|
+
cd OG-ETH
|
|
148
|
+
uv run python examples/run_og_eth.py
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### What happens
|
|
152
|
+
|
|
153
|
+
The first `uv run` creates the project environment if it does not exist yet — downloading a compatible Python interpreter if needed and installing the exact locked dependencies — and then runs the example. Early in the run you may be asked for a UN API token; just press return, and the model reads the same population data from a public mirror and continues. A full baseline-plus-reform run takes from 35 minutes to more than two hours; when it finishes, its plots and tables are saved under `./examples/OG-ETH-Example/` (see the list of outputs below).
|
|
154
|
+
|
|
155
|
+
### Installing for development or contributing
|
|
83
156
|
|
|
84
|
-
* On macOS, first install Xcode Command Line Tools (in Terminal: `xcode-select --install`).
|
|
85
|
-
* Install [`uv`](https://docs.astral.sh/uv/) by following the [installation instructions](https://docs.astral.sh/uv/getting-started/installation/) for your platform (or simply run `pip install uv`).
|
|
86
157
|
* Fork this repository and clone your fork to a directory on your computer.
|
|
87
|
-
* From the terminal, navigate to the cloned directory and run `uv sync --extra dev` to create a local `.venv` and install OG-ETH with its development dependencies
|
|
158
|
+
* From the terminal, navigate to the cloned directory and run `uv sync --extra dev` to create a local `.venv` and install OG-ETH with its development dependencies (`uv` downloads a compatible Python if you don't already have one).
|
|
88
159
|
* For docs/Jupyter Book work, also run `uv sync --extra dev --extra docs`.
|
|
160
|
+
* Run commands in the environment with `uv run <command>`, or activate it first with `source .venv/bin/activate` (macOS/Linux) or `.\.venv\Scripts\Activate.ps1` (Windows).
|
|
89
161
|
|
|
90
162
|
### Run an example of the model
|
|
91
163
|
|
|
92
|
-
*
|
|
93
|
-
* Run the model with an example reform: `uv run python run_og_eth.py` (or activate the venv first with `source .venv/bin/activate` on macOS/Linux or `.\.venv\Scripts\Activate.ps1` on Windows, then `python run_og_eth.py`).
|
|
164
|
+
* From the repository root, run the model with an example reform: `uv run python examples/run_og_eth.py`.
|
|
94
165
|
* You can adjust the `./examples/run_og_eth.py` by modifying model parameters specified in the dictionary passed to the `p.update_specifications()` calls.
|
|
95
166
|
* Model outputs will be saved in the following files:
|
|
96
167
|
* `./examples/OG-ETH-Example/OG-ETH_example_plots`
|
|
@@ -11,28 +11,100 @@ OG-ETH is an overlapping-generations (OG) model that allows for dynamic general
|
|
|
11
11
|
|
|
12
12
|
## Using and contributing to OG-ETH
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Install and run OG-ETH by cloning this GitHub repository and installing the `ogeth` package with its dependencies using [`uv`](https://docs.astral.sh/uv/), as detailed below. (Installing the `ogeth` package from [PyPI](https://pypi.org/project/ogeth/) with `pip` is no longer the recommended path: on the Python versions many machines ship, `pip` either refuses the current release outright — as on the Python 3.9 built into macOS — or silently pairs it with an older `ogcore` than the model is tested against, and even on a supported Python the PyPI route does not pin the `ogcore` version the repository is tested against. The `uv` workflow installs the exact tested versions of every dependency, including a compatible Python interpreter.)
|
|
15
15
|
|
|
16
|
-
###
|
|
16
|
+
### Installation
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
* Open your terminal and install the [`ogeth`](https://pypi.org/project/ogeth/) package from the Python Package Index by typing `pip install ogeth`.
|
|
20
|
-
* Navigate to a folder `./YourFolderName/` where you want to save scripts to run OG-ETH and output from the simulations in those scripts.
|
|
21
|
-
* Copy the python script [`run_og_eth.py`](https://github.com/EAPD-DRB/OG-ETH/blob/main/examples/run_og_eth.py) from the OG-ETH GitHub repository into your folder as `./YourFolderName/run_og_eth.py`.
|
|
22
|
-
* Run the model with an example reform from terminal/command prompt by typing `python run_og_eth.py`.
|
|
18
|
+
There are two ways to install OG-ETH: the easy way, using the OG model family's universal installer, and a manual install that runs the same steps one command at a time. Both start from a terminal, put the model in a new OG-ETH folder inside your current directory (a freshly opened terminal starts in your home folder), and need git.
|
|
23
19
|
|
|
24
|
-
|
|
20
|
+
#### Before you start: git
|
|
21
|
+
|
|
22
|
+
On a Mac where you have never used git before, run this line first and accept the dialog that appears:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
xcode-select --install
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
On Windows, install Git first (skip this if you already have it):
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
winget install --id Git.Git -e --source winget
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
#### The easy way: the universal installer
|
|
35
|
+
|
|
36
|
+
The OG model family has a [universal installer](https://github.com/PSLmodels/OG-Core/blob/master/scripts/QUICK_INSTALL.md) that installs the uv tool, downloads the model, builds its environment, and verifies it — for OG-ETH or any of its sibling country models.
|
|
37
|
+
|
|
38
|
+
On macOS and Linux, paste:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
curl -fsSL https://raw.githubusercontent.com/PSLmodels/OG-Core/master/scripts/install.sh -o og-install.sh
|
|
42
|
+
bash og-install.sh --repo og-eth --yes
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
On Windows (PowerShell), paste:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
$f = "$env:TEMP\og-install.ps1"; irm https://raw.githubusercontent.com/PSLmodels/OG-Core/master/scripts/install.ps1 -OutFile $f; powershell -ExecutionPolicy Bypass -File $f -Repo og-eth -Yes
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
When the installer finishes, run the example. On macOS and Linux, paste:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
source $HOME/.local/bin/env
|
|
55
|
+
cd OG-ETH
|
|
56
|
+
uv run python examples/run_og_eth.py
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
On Windows, open a new PowerShell window (so the just-installed tools are found) and paste:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
cd OG-ETH
|
|
63
|
+
uv run python examples/run_og_eth.py
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Manual install
|
|
67
|
+
|
|
68
|
+
The same setup as individual commands. On macOS and Linux, paste:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
72
|
+
source $HOME/.local/bin/env
|
|
73
|
+
git clone https://github.com/EAPD-DRB/OG-ETH.git
|
|
74
|
+
cd OG-ETH
|
|
75
|
+
uv run python examples/run_og_eth.py
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The second line makes the just-installed uv available in the current terminal; from your next terminal session it is available automatically.
|
|
79
|
+
|
|
80
|
+
On Windows (PowerShell), install uv:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Then open a new PowerShell window (so the just-installed tools are found) and paste:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
git clone https://github.com/EAPD-DRB/OG-ETH.git
|
|
90
|
+
cd OG-ETH
|
|
91
|
+
uv run python examples/run_og_eth.py
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
#### What happens
|
|
95
|
+
|
|
96
|
+
The first `uv run` creates the project environment if it does not exist yet — downloading a compatible Python interpreter if needed and installing the exact locked dependencies — and then runs the example. Early in the run you may be asked for a UN API token; just press return, and the model reads the same population data from a public mirror and continues. A full baseline-plus-reform run takes from 35 minutes to more than two hours; when it finishes, its plots and tables are saved under `./examples/OG-ETH-Example/` (see the list of outputs below).
|
|
97
|
+
|
|
98
|
+
### Installing for development or contributing
|
|
25
99
|
|
|
26
|
-
* On macOS, first install Xcode Command Line Tools (in Terminal: `xcode-select --install`).
|
|
27
|
-
* Install [`uv`](https://docs.astral.sh/uv/) by following the [installation instructions](https://docs.astral.sh/uv/getting-started/installation/) for your platform (or simply run `pip install uv`).
|
|
28
100
|
* Fork this repository and clone your fork to a directory on your computer.
|
|
29
|
-
* From the terminal, navigate to the cloned directory and run `uv sync --extra dev` to create a local `.venv` and install OG-ETH with its development dependencies
|
|
101
|
+
* From the terminal, navigate to the cloned directory and run `uv sync --extra dev` to create a local `.venv` and install OG-ETH with its development dependencies (`uv` downloads a compatible Python if you don't already have one).
|
|
30
102
|
* For docs/Jupyter Book work, also run `uv sync --extra dev --extra docs`.
|
|
103
|
+
* Run commands in the environment with `uv run <command>`, or activate it first with `source .venv/bin/activate` (macOS/Linux) or `.\.venv\Scripts\Activate.ps1` (Windows).
|
|
31
104
|
|
|
32
105
|
### Run an example of the model
|
|
33
106
|
|
|
34
|
-
*
|
|
35
|
-
* Run the model with an example reform: `uv run python run_og_eth.py` (or activate the venv first with `source .venv/bin/activate` on macOS/Linux or `.\.venv\Scripts\Activate.ps1` on Windows, then `python run_og_eth.py`).
|
|
107
|
+
* From the repository root, run the model with an example reform: `uv run python examples/run_og_eth.py`.
|
|
36
108
|
* You can adjust the `./examples/run_og_eth.py` by modifying model parameters specified in the dictionary passed to the `p.update_specifications()` calls.
|
|
37
109
|
* Model outputs will be saved in the following files:
|
|
38
110
|
* `./examples/OG-ETH-Example/OG-ETH_example_plots`
|