This pull request adds a years.py file (and imports it into the other modules) so that the magic numbers2014, 2027, 2028, and 14 can be replaced with named constants. This makes the code easier to read and, more importantly, easier to maintain because the last simulation year will be increased in the future. Using these named constants is also essential for developing a Business-Taxation Policy class.
So, all these changes are cosmetic in the sense that there is no change in Business-Taxation logic. This means that the pytest results and the results generated by the example.py script are unchanged.
Since using the named constants required cosmetic editing of each biztax/*py file, it seemed sensible to also begin bringing the code closer to being in compliance with the PEP8 coding style (which focuses mostly on the vertical and horizontal placement of code elements). Eventually, this coding-style test will be part of the GitHub check-in testing (along with running the pytest suite and code-coverage calculations). The code in this pull request generates these coding-style errors:
iMac:Business-Taxation mrh$ pycodestyle biztax | grep -v E501 | grep -v preTCJA
biztax/btaxmini.py:114:13: E741 ambiguous variable name 'I'
biztax/btaxmini.py:116:13: E741 ambiguous variable name 'I'
biztax/debt.py:128:9: E741 ambiguous variable name 'O'
biztax/debt.py:148:13: E741 ambiguous variable name 'O'
iMac:Business-Taxation mrh$
The grep statements weed out the E501 errors (lines longer than 79 characters) and weed out spacing errors in the biztax/brcparams_preTCJA.json and biztax/brcparams_preTCJA_special.json files, which appear to be unused in the Business-Taxation code.
@codykallen, I'm not planning any additional changes to this pull request unless you identify needed changes.
This pull request adds a
years.py
file (and imports it into the other modules) so that the magic numbers2014
,2027
,2028
, and14
can be replaced with named constants. This makes the code easier to read and, more importantly, easier to maintain because the last simulation year will be increased in the future. Using these named constants is also essential for developing a Business-Taxation Policy class.So, all these changes are cosmetic in the sense that there is no change in Business-Taxation logic. This means that the pytest results and the results generated by the
example.py
script are unchanged.Since using the named constants required cosmetic editing of each
biztax/*py
file, it seemed sensible to also begin bringing the code closer to being in compliance with thePEP8
coding style (which focuses mostly on the vertical and horizontal placement of code elements). Eventually, this coding-style test will be part of the GitHub check-in testing (along with running thepytest
suite and code-coverage calculations). The code in this pull request generates these coding-style errors:The
grep
statements weed out the E501 errors (lines longer than 79 characters) and weed out spacing errors in thebiztax/brcparams_preTCJA.json
andbiztax/brcparams_preTCJA_special.json
files, which appear to be unused in the Business-Taxation code.@codykallen, I'm not planning any additional changes to this pull request unless you identify needed changes.