Skip to content

Commit ee33259

Browse files
committed
use new meta data in tables
1 parent c160f20 commit ee33259

1 file changed

Lines changed: 29 additions & 4 deletions

File tree

ogcore/parameter_tables.py

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pandas as pd
22
import numpy as np
33
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
55

66

77
def tax_rate_table(
@@ -188,9 +188,34 @@ def param_table(p, table_format="tex", path=None):
188188
table (string or DataFrame): table of tax rates
189189
"""
190190
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)
194219
value = getattr(p, k)
195220
if hasattr(value, "__len__") and not isinstance(value, str):
196221
if value.ndim > 1:

0 commit comments

Comments
 (0)