Skip to content

Commit

Permalink
Add weights_scale documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholmer committed Oct 25, 2024
1 parent b20bf77 commit 27c62bd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
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.0'
__version__ = '4.3.0a'
__min_python3_version__ = 10
__max_python3_version__ = 12
7 changes: 7 additions & 0 deletions taxcalc/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ class Data():
NOTE: when using custom weights, set this argument to a DataFrame.
NOTE: assumes weights are integers that are 100 times the real weights.
weights_scale: float
specifies the weights scaling factor used to convert contents
of weights file into the s006 variable. PUF and CPS input data
generated in the taxdata repository use a weights_scale of 0.01,
while TMD input data generated in the tax-microdata repository
use a 1.0 weights_scale value.
Raises
------
ValueError:
Expand Down
4 changes: 2 additions & 2 deletions taxcalc/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Records(Data):
None creates empty sample-weights DataFrame;
default value is filename of the PUF weights.
NOTE: when using custom weights, set this argument to a DataFrame.
NOTE: assumes weights are integers that are 100 times the real weights.
NOTE: see weights_scale documentation below.
adjust_ratios: string or Pandas DataFrame or None
string describes CSV file in which adjustment ratios reside;
Expand Down Expand Up @@ -139,7 +139,7 @@ def __init__(self,
# pylint: disable=no-member,too-many-branches
if isinstance(weights, str):
weights = os.path.join(Records.CODE_PATH, weights)
super().__init__(data, start_year, gfactors, weights)
super().__init__(data, start_year, gfactors, weights, weights_scale)
if data is None:
return # because there are no data
# read adjustment ratios
Expand Down

0 comments on commit 27c62bd

Please sign in to comment.