示例#1
0
def projected(jobs, adjusted=False):
    reference = sw.get_job_properties(jobs)

    if not adjusted:
        pto_dates = pto.projected(jobs, adjusted)
        grant_dates = _map_award(_map_submit(pto_dates,reference),reference)
        return pd.merge(grant_dates, _amounts(jobs)) 
    else:
        award_stage = actuals(jobs)[['InstallationID','Date']]
        leftover = list(set(jobs) - set(list(award_stage['InstallationID'].values)))
        
        submit_stage = _map_award(get_submit_dates(leftover), reference)
        submit_stage = pd.merge(submit_stage,_amounts(leftover))
        _reapply(submit_stage, reference)
        leftover = list(set(leftover)-set(list(submit_stage['InstallationID'].values)))
        
        pto_stage = _map_award(_map_submit(pto.projected(leftover,adjusted),reference),reference)
        pto_stage = pd.merge(pto_stage, _amounts(leftover))
        _reapply(pto_stage, reference)
        
        # concatenating empty data frames raises an error
        if pto_stage.empty and submit_stage.empty and award_stage.empty:
            return award_stage
        else:
            return pd.concat([pto_stage,submit_stage,award_stage],ignore_index=True)
示例#2
0
文件: ppa.py 项目: jephdo/ledgermodel
def projected(jobs, adjusted=False, renewal=False):
    reference = pd.merge(sw.get_ppa_data(jobs), pto.projected(jobs,adjusted))

    if not adjusted:
        return _payment_calculator(reference,renewal)
    else:
        return _payment_calculator(reference,renewal)
示例#3
0
def projected(jobs, adjusted=False):
    reference = sw.get_job_properties(jobs)

    if not adjusted:
        rebate_dates = _map_rebate(pto.projected(jobs, adjusted), reference)
        return pd.merge(rebate_dates, _amounts(jobs))
    else:
        receive_stage = actuals(jobs)
        leftover = list(set(jobs) - set(list(receive_stage["InstallationID"].values)))

        pto_stage = _map_rebate(pto.projected(leftover, adjusted), reference)
        pto_stage = pd.merge(pto_stage, _amounts(leftover))
        _reapply(pto_stage, reference)

        # concatenating empty data frames raises an error
        if receive_stage.empty and pto_stage.empty:
            return receive_stage
        else:
            return pd.concat([pto_stage, receive_stage], ignore_index=True)