Skip to content

Commit

Permalink
Merge in recent changes on master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholmer committed Nov 8, 2024
2 parents 959594b + cc43319 commit 2e4591a
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 16 deletions.
18 changes: 18 additions & 0 deletions docs/about/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ Go [here](https://github.com/PSLmodels/Tax-Calculator/pulls?q=is%3Apr+is%3Aclose
for a complete commit history.


2024-10-28 Release 4.3.1
------------------------
(last merged pull request is
[#2828](https://github.com/PSLmodels/Tax-Calculator/pull/2828))

**This is a minor enhancement release.**

**API Changes**

**New Features**
- Remove PT_qbid_limit_switch parameter and it's assocated False code
[[#2823](https://github.com/PSLmodels/Tax-Calculator/pull/2823) by Martin Holmer]
- Add checking of Python version to the CLI tool, tc
[[#2827](https://github.com/PSLmodels/Tax-Calculator/pull/2827) by Martin Holmer]
- Add weights_scale attribute to the Records and Data classes
[[#2828](https://github.com/PSLmodels/Tax-Calculator/pull/2828) by Martin Holmer]


2024-10-02 Release 4.3.0
------------------------
(last merged pull request is
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The cross-model validation work with NBER's TAXSIM-27 model is described

## Latest release

{doc}`4.3.0 (2024-10-02) <about/releases>`
{doc}`4.3.1 (2024-10-28) <about/releases>`

If you are already using Tax-Calculator, upgrade using the following command:

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
with open("README.md") as f:
longdesc = f.read()

version = "4.3.0"
version = "4.3.1"

config = {
"description": "Tax Calculator",
Expand Down
2 changes: 1 addition & 1 deletion taxcalc.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: taxcalc
Version: 4.3.0
Version: 4.3.1
Summary: taxcalc
Home-page: https://github.com/PSLmodels/Tax-Calculator
Download-URL: https://github.com/PSLmodels/Tax-Calculator
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
from taxcalc.utils import *
from taxcalc.cli import *

__version__ = '4.3.0e'
__version__ = '4.3.1b'
__min_python3_version__ = 10
__max_python3_version__ = 12
12 changes: 6 additions & 6 deletions taxcalc/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,8 @@ def mtr(self, variable_str='e00200p',
self.policy_param('FICA_ss_trt_employee') +
self.policy_param('FICA_mc_trt_employer') +
self.policy_param('FICA_mc_trt_employee')),
0.5 * (self.policy_param('FICA_mc_trt_employer') + self.policy_param('FICA_mc_trt_employee')))
0.5 * (self.policy_param('FICA_mc_trt_employer') +
self.policy_param('FICA_mc_trt_employee')))
else:
adj = 0.0
# compute marginal tax rates
Expand Down Expand Up @@ -1189,11 +1190,10 @@ def lines(text, num_indent_spaces, max_line_length=77):
for pname in baseline.keys():
upda_value = getattr(updated, pname)
base_value = getattr(baseline, pname)
is_array = isinstance(upda_value, np.ndarray)
if (
(isinstance(upda_value, np.ndarray) and
np.allclose(upda_value, base_value)) or
(not isinstance(upda_value, np.ndarray) and
upda_value != base_value)
(is_array and not np.allclose(upda_value, base_value))
or (is_array == False and upda_value != base_value)
):
params_with_diff.append(pname)
if params_with_diff:
Expand Down Expand Up @@ -1248,7 +1248,7 @@ def lines(text, num_indent_spaces, max_line_length=77):
else: # if baseline is GrowDiff object
# each GrowDiff parameter has zero as default value
doc += ' baseline_value: 0.0\n'
del mdata_base
del mdata_base
return doc

# begin main logic of reform_documentation
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/growfactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class instance: GrowFactors
which is for use with puf and cps data from the taxdata repository.
"""

PACKAGE_FILE_NAMES = ['growfactors.csv', 'tmd_growfactors.csv']
PACKAGE_FILE_NAMES = ['growfactors.csv']
FILE_PATH = os.path.abspath(os.path.dirname(__file__))

VALID_NAMES = set(['ABOOK', 'ACGNS', 'ACPIM', 'ACPIU',
Expand Down
19 changes: 16 additions & 3 deletions taxcalc/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import os
import json
from pathlib import Path
import numpy as np
from taxcalc.parameters import Parameters
from taxcalc.growfactors import GrowFactors
Expand Down Expand Up @@ -80,7 +81,7 @@ class instance: Policy
# (3) specify which Policy parameters are wage (rather than price) indexed
WAGE_INDEXED_PARAMS = ['SS_Earnings_c', 'SS_Earnings_thd']

def __init__(self, gfactors=None, only_reading_defaults=False, **kwargs):
def __init__(self, gfactors=None, **kwargs):
# put JSON contents of DEFAULTS_FILE_NAME into self._vals dictionary
super().__init__()
# handle gfactors argument
Expand All @@ -92,7 +93,6 @@ def __init__(self, gfactors=None, only_reading_defaults=False, **kwargs):
raise ValueError('gfactors is not None or a GrowFactors instance')
# read default parameters and initialize
syr = Policy.JSON_START_YEAR
lyr = Policy.LAST_BUDGET_YEAR
nyrs = Policy.DEFAULT_NUM_YEARS
self._inflation_rates = None
self._wage_growth_rates = None
Expand All @@ -101,6 +101,19 @@ def __init__(self, gfactors=None, only_reading_defaults=False, **kwargs):
Policy.REDEFINED_PARAMS,
Policy.WAGE_INDEXED_PARAMS, **kwargs)

@staticmethod
def tmd_constructor(growfactors_path): # pragma: no cover
"""
Static method returns a Policy object instantiated with TMD
input data. This convenience method works in a analogous way
to Policy(), which returns a Policy object instantiated with
non-TMD input data.
"""
assert isinstance(growfactors_path, Path)
gf_filename = str(growfactors_path)
tmd_growfactors = GrowFactors(growfactors_filename=gf_filename)
return Policy(gfactors=tmd_growfactors)

@staticmethod
def read_json_reform(obj):
"""
Expand Down Expand Up @@ -129,7 +142,7 @@ def parameter_list():
Policy.DEFAULTS_FILE_PATH,
Policy.DEFAULTS_FILE_NAME
)
with open(path) as f:
with open(path, 'r', encoding='utf-8') as f:
defaults = json.loads(f.read()) # pylint: disable=protected-access
return [k for k in defaults if k != "schema"]

Expand Down
2 changes: 1 addition & 1 deletion taxcalc/reforms/ext.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REFORM TO EXTEND TEMPORARY TCJA PROVISIONS BEYOND 2025
// USING TAX-CALCULATOR 4.3.0
// USING TAX-CALCULATOR 4.3.1
// WITH 2025-to-2026 INDEXING FACTOR = 1.022000
// AND 2028-to-2029 INDEXING FACTOR = 1.019400
{
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/tests/test_taxcalcio.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def fixture_reformfile1():
"II_em": { // personal exemption amount (see indexing changes below)
"2016": 6000,
"2018": 7500,
"2020": 9000},
"2021": 9000},
"II_em-indexed": { // personal exemption amount indexing status
"2016": false, // values in future years are same as this year value
"2018": true // values in future years indexed with this year as base
Expand Down

0 comments on commit 2e4591a

Please sign in to comment.