Refactoring thread

Fair warning: this code is not intended to run just yet. As I was refactoring the functions I realized I had questions for Dan and Co. and decided to put them up on github in order to avoid another long email thread. I'll try to tag people in specific comments to make those salient to relevant folks.

The foreign earned income exclusion is called that for historical 
purposes, but is actually a credit. The credit is the amount of tax that 
would have been paid on the foreign earned income (up to 92,300) without 
any deductions or exemptions. The SAS code is correct.

I don't think there is any information about foreign earned income on the 
PUF, so _feided and _feitax should be zero for the PUF. If you are making 
up data, can you take a single example and print out all the values for 
me?

dan

On Thu, 4 Sep 2014, Ilia Kurenkov wrote:

> 
> In translation.py:
> 
> > +    # x02900 = c02900  # IK: for now leaving out
> > +
> > +    return cd
> > +
> > +
> > +def CapGains(cd):
> > +    #Capital Gains
> > + 
> > +    cd['c23650'] = puf_dict['c23250'] + puf_dict['e22250'] + puf_dict['e23660'] 
> > +    cd['c01000'] = np.maximum(-3000/ cd['sep'], cd['c23650'])
> > +    # feimax = maximum foreign earned income exclusion
> > +    # this variable is problematic: in the SAS code it's defined as an array
> > +    # that has 20 members, covering the period of 1993-2013
> > +    # In our current PlanX, however, it's just a one-member array, having
> > +    # only retained the last feimax value from before
> > +    mod_feimax = planX['feimax'][2013-puf_dict['FLPDYR']] * puf_dict['f2555']
> 
> @feenberg could you tell me more about the maximum foreign earned income variable
> and how we should be calculating it? I'm getting conflicting evidence from the SAS
> code and @SameerSarkar's python translation.
> 
> —
> Reply to this email directly or view it onGitHub.[8114261__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyNTUwNjcxOSwiZ
> GF0YSI6eyJpZCI6NDE2Mjg2NDl9fQ==--bebcc471bc030d3bfde235e293c88e4617fb302c.gif]
> 
> 
>