From 2953c6910099472578f462aea2c99a6d281ec41e Mon Sep 17 00:00:00 2001 From: "martin.holmer@gmail.com" Date: Tue, 12 Nov 2024 08:44:24 -0500 Subject: [PATCH] Add more uses of Policy.tmd_constructor --- tmd/create_taxcalc_cached_files.py | 2 +- tmd/utils/taxcalc_utils.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tmd/create_taxcalc_cached_files.py b/tmd/create_taxcalc_cached_files.py index 8f292cbb..ddb959f4 100644 --- a/tmd/create_taxcalc_cached_files.py +++ b/tmd/create_taxcalc_cached_files.py @@ -19,7 +19,7 @@ def create_cached_files(): for each variable in the CACHED_TAXCALC_VARIABLES list. """ # calculate all Tax-Calculator variables for TAX_YEAR - pol = tc.Policy() + pol = tc.Policy.tmd_constructor(growfactors_path=GFFILE_PATH) rec = tc.Records.tmd_constructor( data_path=INFILE_PATH, weights_path=WTFILE_PATH, diff --git a/tmd/utils/taxcalc_utils.py b/tmd/utils/taxcalc_utils.py index 26a6507d..b5079a2a 100644 --- a/tmd/utils/taxcalc_utils.py +++ b/tmd/utils/taxcalc_utils.py @@ -80,7 +80,10 @@ def add_taxcalc_outputs( exact_calculations=True, weights_scale=1.0, ) - policy = tc.Policy() + if isinstance(growfactors, pathlib.PosixPath): + policy = tc.Policy.tmd_constructor(growfactors_path=growfactors) + else: + policy = tc.Policy() if reform: policy.implement_reform(reform) simulation = tc.Calculator(records=rec, policy=policy)