Check-in [09b7b92fe5]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Revise kaiser_ptc.py script to write cap_frac output as a percentage fraction rather than as a decimal fraction.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:09b7b92fe58ae60edf398ba699336bcbc71ccd85
User & Date: mrh 2015-05-20 23:23:51
Context
2015-05-20
23:44
Convert cap_fraction from decimal to percentage fraction in all test/*output file as described in ticket [d7804c068e]. check-in: d4b6caf8ea user: mrh tags: trunk
23:23
Revise kaiser_ptc.py script to write cap_frac output as a percentage fraction rather than as a decimal fraction. check-in: 09b7b92fe5 user: mrh tags: trunk
23:22
Simplify ostr format in ptc_out_diff.py script now that cap_frac output is expressed as a percentage instead of a decimal fraction. check-in: 85ee7ad5b0 user: mrh tags: trunk
Changes

Changes to kaiser_ptc.py.

248
249
250
251
252
253
254

255
256
257
258

259
260
261
262
263
264
265
266
267
268
269
270
271
272
    -covfam_size: number individuals in the ACA coverage family.
    -results_dict: dictionary of results information returned from either the
                   select_and_scrape() function or the no_scrape() function.
    """
    magi = funit['modified_agi']
    cap_frac = results_dict['cap_frac']
    if cap_frac > 1.0:

        cf_fmt = '{:.4g}'
        contrib_amt = 9.9e99 # no (that is, 'infinite') contribution amount
        ca_fmt = '{:.4g}'
    else:

        cf_fmt = '{:.4f}'
        contrib_amt = magi * cap_frac
        ca_fmt = '{:.2f}'
    record = ' '.join([str(funit['id']),
                       '{:.2f}'.format(results_dict['tax_credit']),
                       '{:d}'.format(results_dict['magi_pct']),
                       cf_fmt.format(cap_frac),
                       ca_fmt.format(contrib_amt),
                       '{:d}'.format(covfam_size),
                       '{:.2f}'.format(results_dict['silver_prem'])])
    sys.stdout.write(record + '\n')
# end of write_output function code









>




>
|





|







248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
    -covfam_size: number individuals in the ACA coverage family.
    -results_dict: dictionary of results information returned from either the
                   select_and_scrape() function or the no_scrape() function.
    """
    magi = funit['modified_agi']
    cap_frac = results_dict['cap_frac']
    if cap_frac > 1.0:
        cap_frac_pct = cap_frac
        cf_fmt = '{:.4g}'
        contrib_amt = 9.9e99 # no (that is, 'infinite') contribution amount
        ca_fmt = '{:.4g}'
    else:
        cap_frac_pct = cap_frac * 100.0
        cf_fmt = '{:.2f}'
        contrib_amt = magi * cap_frac
        ca_fmt = '{:.2f}'
    record = ' '.join([str(funit['id']),
                       '{:.2f}'.format(results_dict['tax_credit']),
                       '{:d}'.format(results_dict['magi_pct']),
                       cf_fmt.format(cap_frac_pct),
                       ca_fmt.format(contrib_amt),
                       '{:d}'.format(covfam_size),
                       '{:.2f}'.format(results_dict['silver_prem'])])
    sys.stdout.write(record + '\n')
# end of write_output function code