Skip to content

Commit

Permalink
Merge pull request #64 from PSLmodels/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
bodiyang authored Dec 19, 2024
2 parents 1d5211c + 870db89 commit 59df59e
Show file tree
Hide file tree
Showing 49 changed files with 1,026 additions and 640 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Build
shell: bash -l {0}
run: |
pip install -e .
pip install -e . --user
pip install pytest-cov --user
pip install pytest-pycodestyle --user
Expand Down
8 changes: 4 additions & 4 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ build:
requirements:
build:
- "python>=3.10, <3.13"
- "numpy>=1.26,<1.27"
- "numpy>=1.26"
- "pandas>=2.2"
- "bokeh>=2.4"
- "paramtools>=0.18.3"
- "paramtools>=0.19.0"
- numba
- curl
- openpyxl
- behresp

run:
- "python>=3.10, <3.13"
- "numpy>=1.26,<1.27"
- "numpy>=1.26"
- "pandas>=2.2"
- "bokeh>=2.4"
- "paramtools>=0.18.3"
- "paramtools>=0.19.0"
- numba
- curl
- openpyxl
Expand Down
25 changes: 25 additions & 0 deletions docs/about/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@ Go [here](https://github.com/PSLmodels/Tax-Calculator/pulls?q=is%3Apr+is%3Aclose
for a complete commit history.


2024-12-16 Release 4.3.5
------------------------
(last merged pull request is
[#2854](https://github.com/PSLmodels/Tax-Calculator/pull/2854))

**This is a minor enhancement and bug-fix release.**

**API Changes**

**New Features**
- Update PUF and CPS input data using CBO June 2024 baseline projection
[[#2831](https://github.com/PSLmodels/Tax-Calculator/pull/2831) by Bodi Yang]
- Generalize tmd_constructor in both Records and Policy classes
[[#2850](https://github.com/PSLmodels/Tax-Calculator/pull/2850) by Martin Holmer]
- Add changes that should have been included in PR #2831
[[#2854](https://github.com/PSLmodels/Tax-Calculator/pull/2854) by Martin Holmer]

**Bug Fixes**
- Fix several broken documentation links
[[#2847](https://github.com/PSLmodels/Tax-Calculator/pull/2847) by Martin Holmer] and
[[#2849](https://github.com/PSLmodels/Tax-Calculator/pull/2849) by Martin Holmer]
- Remove incorrect use of GrowFactors() in Policy and Parameters classes
[[#2852](https://github.com/PSLmodels/Tax-Calculator/pull/2852) by Martin Holmer]


2024-11-30 Release 4.3.4
------------------------
(last merged pull request is
Expand Down
21 changes: 18 additions & 3 deletions docs/guide/assumption_params.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
Assumption parameters
=====================

This section contains documentation of several sets of parameters that characterize responses to a tax reform. Consumption parameters are used to compute marginal tax rates and to compute the consumption value of in-kind benefits. Growdiff parameters are used to specify baseline differences and/or reform responses in the annual rate of growth in economic variables. (Note that behavior parameters used to compute changes in input variables caused by a tax reform in a partial-equilibrium setting are not part of Tax-Calculator, but can be used via the Behavioral-Response `behresp` package in a Python program.)

The assumption parameters control advanced features of Tax-Calculator, so understanding the source code that uses them is essential. Default values of many assumption parameters are zero and are projected into the future at that value, which implies no response to the reform. The benefit value consumption parameters have a default value of one, which implies the consumption value of the in-kind benefits is equal to the government cost of providing the benefits.
This section contains documentation of several sets of parameters that
characterize responses to a tax reform. Consumption parameters are
used to compute marginal tax rates and to compute the consumption
value of in-kind benefits. Growdiff parameters are used to specify
baseline differences and/or reform responses in the annual rate of
growth in economic variables. (Note that behavior parameters used to
compute changes in input variables caused by a tax reform in a
partial-equilibrium setting are not part of Tax-Calculator, but can be
used via the Behavioral-Response `behresp` package in a Python
program.)

The assumption parameters control advanced features of Tax-Calculator,
so understanding the source code that uses them is essential. Default
values of many assumption parameters are zero and are projected into
the future at that value, which implies no response to the reform. The
benefit value consumption parameters have a default value of one,
which implies the consumption value of the in-kind benefits is equal
to the government cost of providing the benefits.


## Growdiff
Expand Down
487 changes: 384 additions & 103 deletions docs/guide/cli.md

Large diffs are not rendered by default.

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.4 (2024-11-30) <about/releases>`
{doc}`4.3.5 (2024-12-16) <about/releases>`

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

Expand Down
5 changes: 3 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ channels:
- conda-forge
dependencies:
- "python>=3.10, <3.13"
- "numpy>=1.26,<1.27"
- "numpy>=1.26"
- "pandas>=2.2"
- "bokeh>=2.4"
- numba
- curl
- setuptools
- pytest
- pytest-xdist
- pycodestyle
Expand All @@ -18,4 +19,4 @@ dependencies:
- pip
- pip:
- jupyter-book
- "paramtools>=0.18.3"
- "paramtools>=0.19.0"
12 changes: 5 additions & 7 deletions 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.4"
version = "4.3.5"

config = {
"description": "Tax Calculator",
Expand All @@ -18,13 +18,11 @@
"include_package_data": True,
"name": "taxcalc",
"install_requires": [
"setuptools",
"numpy",
"pandas",
"bokeh",
"numpy>=1.26",
"pandas>=2.2",
"bokeh>=2.4",
"numba",
"requests",
"paramtools>=0.18.3",
"paramtools>=0.19.0",
],
"classifiers": [
"Development Status :: 4 - Beta",
Expand Down
12 changes: 5 additions & 7 deletions 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.4
Version: 4.3.5
Summary: taxcalc
Home-page: https://github.com/PSLmodels/Tax-Calculator
Download-URL: https://github.com/PSLmodels/Tax-Calculator
Expand All @@ -18,13 +18,11 @@ Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: setuptools
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: bokeh
Requires-Dist: numpy>=1.26
Requires-Dist: pandas>=2.2
Requires-Dist: bokeh>=2.4
Requires-Dist: numba
Requires-Dist: requests
Requires-Dist: paramtools>=0.18.3
Requires-Dist: paramtools>=0.19.0

| | |
| --- | --- |
Expand Down
10 changes: 4 additions & 6 deletions taxcalc.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
setuptools
numpy
pandas
bokeh
numpy>=1.26
pandas>=2.2
bokeh>=2.4
numba
requests
paramtools>=0.18.3
paramtools>=0.19.0
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.4'
__version__ = '4.3.5a'
__min_python3_version__ = 10
__max_python3_version__ = 12
2 changes: 1 addition & 1 deletion taxcalc/assumptions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Such an economic assumption file can then be used by the `tc`
command-line interface to Tax-Calculator or be read in a Python
program that imports the Tax-Calculator `taxcalc` package, as
described in the [user
guide](https://PSLmodels.github.io/Tax-Calculator/uguide.html).
guide](https://taxcalc.pslmodels.org/guide/index.html#user-guide).

[This
document](https://github.com/PSLmodels/Tax-Calculator/blob/master/taxcalc/assumptions/ASSUMPTIONS.md#how-to-specify-economic-assumptions-in-a-json-assumption-file)
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/assumptions/economic_assumptions_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// about how individuals and the overall economy respond to a tax reform.
//
// Detailed documentation on these parameters can be found at
// <http://PSLmodels.github.io/Tax-Calculator/#params>.
// <https://taxcalc.pslmodels.org/guide/assumption_params.html>.
{
"consumption": {
"MPC_e17500": {"2017": 0.0},
Expand Down
10 changes: 7 additions & 3 deletions taxcalc/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ def read_json_param_objects(reform, assump):
return param_dict

@staticmethod
def reform_documentation(params, policy_dicts=None):
def reform_documentation(params, growfactors, policy_dicts=None):
"""
Generate reform documentation versus current-law policy.
Expand All @@ -1120,6 +1120,9 @@ def reform_documentation(params, policy_dicts=None):
dictionary is structured like dict returned from
the static Calculator.read_json_param_objects() method
growfactors: GrowFactors
GrowFactors object used to construct Calculator Policy object
policy_dicts : list of dict or None
each dictionary in list is a params['policy'] dictionary
representing second and subsequent elements of a compound
Expand Down Expand Up @@ -1255,13 +1258,14 @@ def lines(text, num_indent_spaces, max_line_length=77):
# create Policy object with current-law-policy values
gdiff_base = GrowDiff()
gdiff_base.update_growdiff(params['growdiff_baseline'])
gfactors_clp = GrowFactors()
assert isinstance(growfactors, GrowFactors)
gfactors_clp = copy.deepcopy(growfactors)
gdiff_base.apply_to(gfactors_clp)
clp = Policy(gfactors=gfactors_clp)
# create Policy object with post-reform values
gdiff_resp = GrowDiff()
gdiff_resp.update_growdiff(params['growdiff_response'])
gfactors_ref = GrowFactors()
gfactors_ref = copy.deepcopy(growfactors)
gdiff_base.apply_to(gfactors_ref)
gdiff_resp.apply_to(gfactors_ref)
ref = Policy(gfactors=gfactors_ref)
Expand Down
10 changes: 5 additions & 5 deletions taxcalc/consumption.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ class Consumption(Parameters):
Parameters
----------
none
last_budget_year: integer
user-defined last parameter extrapolation year
Returns
-------
class instance: Consumption
"""

JSON_START_YEAR = Policy.JSON_START_YEAR
DEFAULT_NUM_YEARS = Policy.DEFAULT_NUM_YEARS
DEFAULTS_FILE_NAME = 'consumption.json'
DEFAULTS_FILE_PATH = os.path.abspath(os.path.dirname(__file__))

def __init__(self):
def __init__(self, last_budget_year=Policy.LAST_BUDGET_YEAR):
super().__init__()
self.initialize(Consumption.JSON_START_YEAR,
Consumption.DEFAULT_NUM_YEARS)
nyrs = Policy.number_of_years(last_budget_year)
self.initialize(Consumption.JSON_START_YEAR, nyrs)

@staticmethod
def read_json_update(obj):
Expand Down
Binary file modified taxcalc/cps_weights.csv.gz
Binary file not shown.
15 changes: 5 additions & 10 deletions taxcalc/growdiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ class GrowDiff(Parameters):
Parameters
----------
none
last_budget_year: integer
user-defined last parameter extrapolation year
Returns
-------
class instance: GrowDiff
"""

JSON_START_YEAR = Policy.JSON_START_YEAR
DEFAULT_NUM_YEARS = Policy.DEFAULT_NUM_YEARS
DEFAULTS_FILE_NAME = 'growdiff.json'
DEFAULTS_FILE_PATH = os.path.abspath(os.path.dirname(__file__))

def __init__(self):
def __init__(self, last_budget_year=Policy.LAST_BUDGET_YEAR):
super().__init__()
self.initialize(GrowDiff.JSON_START_YEAR,
GrowDiff.DEFAULT_NUM_YEARS)
nyrs = Policy.number_of_years(last_budget_year)
self.initialize(GrowDiff.JSON_START_YEAR, nyrs)

@staticmethod
def read_json_update(obj, topkey):
Expand Down Expand Up @@ -81,8 +81,3 @@ def apply_to(self, growfactors):
cyr = i + self.start_year
diff_array = getattr(self, _gfvn)
growfactors.update(gfvn, cyr, diff_array[i])

def set_rates(self):
"""
Unimplemented base class method that is not used here.
"""
Loading

0 comments on commit 59df59e

Please sign in to comment.