|
1 | 1 | import pandas as pd |
2 | 2 | import numpy as np |
3 | 3 | from ogcore.utils import save_return_table |
4 | | -from ogcore.constants import VAR_LABELS, PARAM_LABELS, DEFAULT_START_YEAR |
| 4 | +from ogcore.constants import VAR_LABELS, DEFAULT_START_YEAR |
5 | 5 |
|
6 | 6 |
|
7 | 7 | def tax_rate_table( |
@@ -188,9 +188,34 @@ def param_table(p, table_format="tex", path=None): |
188 | 188 | table (string or DataFrame): table of tax rates |
189 | 189 | """ |
190 | 190 | table = {"Symbol": [], "Description": [], "Value": []} |
191 | | - for k, v in PARAM_LABELS.items(): |
192 | | - table["Symbol"].append(v[1]) |
193 | | - table["Description"].append(v[0]) |
| 191 | + param_metadata = p.specification( |
| 192 | + meta_data=True, include_empty=True, serializable=True, use_state=True |
| 193 | + ) |
| 194 | + skip_params = [ |
| 195 | + "starting_age", |
| 196 | + "ending_age", |
| 197 | + "constant_demographics", |
| 198 | + "constant_rates", |
| 199 | + "zero_taxes", |
| 200 | + "theta", |
| 201 | + "k", |
| 202 | + "fert_rates", |
| 203 | + "N", |
| 204 | + "Gamma", |
| 205 | + ] |
| 206 | + |
| 207 | + for k, v in param_metadata.items(): |
| 208 | + if not isinstance(v, dict): |
| 209 | + continue |
| 210 | + if k in skip_params: |
| 211 | + continue |
| 212 | + short_description = v.get("short_description") |
| 213 | + param_notation = v.get("param_notation") |
| 214 | + if not short_description or not param_notation: |
| 215 | + continue |
| 216 | + |
| 217 | + table["Symbol"].append(param_notation) |
| 218 | + table["Description"].append(short_description) |
194 | 219 | value = getattr(p, k) |
195 | 220 | if hasattr(value, "__len__") and not isinstance(value, str): |
196 | 221 | if value.ndim > 1: |
|
0 commit comments