Skip to content
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

Provide more specific information in error/warning messages #1545

Closed
wants to merge 4 commits into from
Closed

Provide more specific information in error/warning messages #1545

wants to merge 4 commits into from

Conversation

martinholmer
Copy link
Collaborator

@martinholmer martinholmer commented Sep 7, 2017

This pull request is an attempt to provide more information about which element of a non-scalar policy parameter is being discussed in an error or warning message. There are three kinds of non-scalar parameters: some are indexed by MARS, others are indexed by EIC, and a few are indexed by itemized-deduction-type. The need for more information in the messages was pointed out by @hdoupe in the discussion of TaxBrain pull request 641.

Using the revised code in this pull request, the error and warning messages look like this:

tax-calculator$ cat ref.json
{"policy": {
    "_II_rt2": {"2020": [0.0]},
    "_II_brk2": {"2020": [[10000, 10000, 10000, 10000, 10000]]},
    "_STD_Dep": {"2020": [200]}
}}

tax-calculator$ tc cps.csv 2020 --reform ref.json
ERROR: 2020 _II_brk2_1 value 10000.0 < min value 19954.96 for _II_brk1_1
ERROR: 2020 _II_brk2_3 value 10000.0 < min value 14284.11 for _II_brk1_3
ERROR: 2020 _II_brk2_4 value 10000.0 < min value 19954.96 for _II_brk1_4
ERROR: 2021 _II_brk2_1 value 10233.0 < min value 20419.91 for _II_brk1_1
ERROR: 2021 _II_brk2_3 value 10233.0 < min value 14616.93 for _II_brk1_3
ERROR: 2021 _II_brk2_4 value 10233.0 < min value 20419.91 for _II_brk1_4
ERROR: 2022 _II_brk2_1 value 10470.41 < min value 20893.65 for _II_brk1_1
ERROR: 2022 _II_brk2_3 value 10470.41 < min value 14956.04 for _II_brk1_3
ERROR: 2022 _II_brk2_4 value 10470.41 < min value 20893.65 for _II_brk1_4
ERROR: 2023 _II_brk2_1 value 10714.37 < min value 21380.47 for _II_brk1_1
ERROR: 2023 _II_brk2_3 value 10714.37 < min value 15304.52 for _II_brk1_3
ERROR: 2023 _II_brk2_4 value 10714.37 < min value 21380.47 for _II_brk1_4
ERROR: 2024 _II_brk2_1 value 10964.01 < min value 21878.63 for _II_brk1_1
ERROR: 2024 _II_brk2_3 value 10964.01 < min value 15661.12 for _II_brk1_3
ERROR: 2024 _II_brk2_4 value 10964.01 < min value 21878.63 for _II_brk1_4
ERROR: 2025 _II_brk2_1 value 11220.57 < min value 22390.59 for _II_brk1_1
ERROR: 2025 _II_brk2_3 value 11220.57 < min value 16027.59 for _II_brk1_3
ERROR: 2025 _II_brk2_4 value 11220.57 < min value 22390.59 for _II_brk1_4
ERROR: 2026 _II_brk2_1 value 11484.25 < min value 22916.77 for _II_brk1_1
ERROR: 2026 _II_brk2_3 value 11484.25 < min value 16404.24 for _II_brk1_3
ERROR: 2026 _II_brk2_4 value 11484.25 < min value 22916.77 for _II_brk1_4
WARNING: 2020 _STD_Dep value 200.0 < min value 1123.47
WARNING: 2021 _STD_Dep value 204.66 < min value 1149.65
WARNING: 2022 _STD_Dep value 209.41 < min value 1176.32
WARNING: 2023 _STD_Dep value 214.29 < min value 1203.73
WARNING: 2024 _STD_Dep value 219.28 < min value 1231.78
WARNING: 2025 _STD_Dep value 224.41 < min value 1260.6
WARNING: 2026 _STD_Dep value 229.68 < min value 1290.22
USAGE: tc --help

@martinholmer martinholmer deleted the fix-error-warning-messages branch September 8, 2017 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants