Exemplo n.º 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)
Exemplo n.º 2
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)
Exemplo n.º 3
0
def projected(jobs, adjusted=False):
    reference = sw.get_job_properties(jobs)  # basic job properties

    if not adjusted:
        end_dates = sw.get_end_dates(jobs)
        return _map_pto(_map_inspect(end_dates, reference), reference)
    else:
        # adjust forecasts to account for actuals and to push projections further out if necessary
        pto_stage = actuals(jobs)
        leftover = list(set(jobs) - set(list(pto_stage["InstallationID"].values)))

        inspect_stage = _map_pto(get_inspection_dates(leftover), reference)
        _reapply(inspect_stage, reference)
        leftover = list(set(leftover) - set(list(inspect_stage["InstallationID"].values)))

        install_stage = _map_pto(_map_inspect(sw.get_end_dates(leftover), reference), reference)
        _reapply(install_stage, reference)

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