Skip to content

Commit

Permalink
Merge pull request #798 from hdoupe/comment_param_mapping
Browse files Browse the repository at this point in the history
Merged #798
  • Loading branch information
hdoupe authored Jan 10, 2018
2 parents ba97f32 + 0bb36cb commit 647dae4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webapp/apps/taxbrain/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,18 +364,18 @@ def get_default_policy_param_name(param, default_params):
returns: Tax-Calculator param name
"""
if '_' + param in default_params:
if '_' + param in default_params: # ex. EITC_indiv --> _EITC_indiv
return '_' + param
param_pieces = param.split('_')
end_piece = param_pieces[-1]
no_suffix = '_' + '_'.join(param_pieces[:-1])
if end_piece == 'cpi':
if end_piece == 'cpi': # ex. SS_Earnings_c_cpi --> _SS_Earnings_c_cpi
if no_suffix in default_params:
return '_' + param
else:
msg = "Received unexpected parameter: {}"
raise ValueError(msg.format(param))
if no_suffix in default_params:
if no_suffix in default_params: # ex. STD_0 --> _STD_single
try:
ix = int(end_piece)
except ValueError:
Expand Down

0 comments on commit 647dae4

Please sign in to comment.