-
-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Vectorize all tax calculation functions #2585
Conversation
I may not get the chance to finish this PR, so here's the current status of the test suite (last thing to take care of before merging). The following tests are still failing: test_calcfunctions.py::test_calc_and_used_vars
test_calcfunctions.py::test_function_args_usage
test_cpscsv.py::test_agg
test_utils.py::test_create_tables
test_utils.py::test_table_columns_labels The most common problems have been the following:
Tax-Calculator/taxcalc/calcfunctions.py Lines 2186 to 2188 in 0bc4d2b
In line 2188,
Tax-Calculator/taxcalc/calcfunctions.py Lines 835 to 848 in 4698c29
Line 846 previously did not specify the nested np.logical_and(DSI != 1, MIDR == 1) What was missing was the fact that |
@MattHJensen @rickecon @jdebacker I think that Additionally, some additional arguments have been added to certain functions (they're in the function body but weren't previously specified in function arguments) and all output variables have been removed from function arguments. |
Closing for lack of interest in moving the code in this direction. |
This PR does the following:
pandas
dataframe attached to the underlyingRecords
objectcalcfunctions.py
from theiterate_jit
decorator and implements either (a) a function that takes advantage ofnumpy
/pandas
broadcasting or (b) a function thatnumpy
will manually vectorize through the@np.vectorize
decorator.The tax logic within some functions may be less clear due to the introduction of
np.where
andnp.select
.Thanks @hdoupe for updating the
Records
andData
classes from beingnumpy
- topandas
- dependentTODO:
Clean up(causes loss of speed)calcfunctions
by creating a function that collects each tax function's relevant arguments, parameters and outputs.