leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline ======================================================== .. py:module:: leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline Attributes ---------- .. autoapisummary:: leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.AdaptPostprocessingException leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.BENEFIT_CAPS leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.BENEFIT_TYPE leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.DATA_DRIVEN_BENEFIT_ASSUMPTIONS leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.MANUAL_BENEFIT_ASSUMPTIONS leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.MARKET_VARIANCE_IMPLEMENTABILITY leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.MIN_LANE_LENGTH leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.NETWORK_BENEFIT_IMPLEMENTABILITY Functions --------- .. autoapisummary:: leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.get_annualization leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.get_business_impact leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.get_business_objectives leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.get_co2_emissions leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.get_company_stats leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.get_daily_pattern_benefit leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.get_flex_lane_summary leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.get_lane_summary leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.get_market_rate_variance_benefit leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.get_network_benefit leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.get_network_moves leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.get_observations leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.get_portfolio leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.get_ships leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.get_total_loads leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.get_total_spend leaf_engine.adapt.pipeline.adapt_postprocessing_pipeline.postprocessing_pipeline Module Contents --------------- .. py:function:: get_annualization(ships_df: pandas.DataFrame) -> float Returns annualization factor. .. py:function:: get_business_impact(case_df: pandas.DataFrame) -> pandas.DataFrame .. py:function:: get_business_objectives(ships_df: pandas.DataFrame, case_df: pandas.DataFrame) -> pandas.DataFrame Builds high-level overview of business objectives. .. py:function:: get_co2_emissions(ships_df: pandas.DataFrame) -> int Converts total shipment miles to million kilograms CO2. .. py:function:: get_company_stats(ships_df: pandas.DataFrame) -> pandas.DataFrame Builds high-level overview of total benefits. .. py:function:: get_daily_pattern_benefit(ships_df, action_context: leaf_engine.adapt.context.adapt_contexts.AdaptActionContext) -> pandas.DataFrame Computes lane-level daily flex pattern benefit. .. py:function:: get_flex_lane_summary(case_df: pandas.DataFrame) -> pandas.DataFrame Formats lane level summary to match expected output. .. py:function:: get_lane_summary(etl_context: leaf_engine.adapt.context.adapt_contexts.AdaptETLContext, explorer_context: leaf_engine.adapt.context.adapt_contexts.AdaptExplorerContext) -> pandas.DataFrame Gets and formats lane-level summary from explorer context. .. py:function:: get_market_rate_variance_benefit(observation_context: leaf_engine.adapt.context.adapt_contexts.AdaptObservationContext) -> pandas.DataFrame Computes lane-level market rate variance benefit. .. py:function:: get_network_benefit(ships_df: pandas.DataFrame, action_context: leaf_engine.adapt.context.adapt_contexts.AdaptActionContext) -> pandas.DataFrame Aggregates network moves and computes lane-level network benefit. .. py:function:: get_network_moves(action_context: leaf_engine.adapt.context.adapt_contexts.AdaptActionContext) -> pandas.DataFrame Gets and formats network moves from actions context. .. py:function:: get_observations(observation_context: leaf_engine.adapt.context.adapt_contexts.AdaptObservationContext) -> pandas.DataFrame Gets and aggregates observations from observation context. .. py:function:: get_portfolio(ships_df: pandas.DataFrame, case_df: pandas.DataFrame) -> pandas.DataFrame Builds adapt portfolio output. .. py:function:: get_ships(data_context: leaf_engine.adapt.context.adapt_contexts.AdaptDataContext) -> pandas.DataFrame Gets shipments DataFrame from data_context. .. py:function:: get_total_loads(ships_df: pandas.DataFrame) -> int Computes number of unique shipments. .. py:function:: get_total_spend(ships_df: pandas.DataFrame) -> float Computes total shipment spend. .. py:function:: postprocessing_pipeline(etl_cxt: leaf_engine.adapt.context.adapt_contexts.AdaptETLContext, data_cxt: leaf_engine.adapt.context.adapt_contexts.AdaptDataContext, action_cxt: leaf_engine.adapt.context.adapt_contexts.AdaptActionContext, observation_cxt: leaf_engine.adapt.context.adapt_contexts.AdaptObservationContext, explorer_cxt: leaf_engine.adapt.context.adapt_contexts.AdaptExplorerContext) Runs postprocessing logic. .. py:data:: AdaptPostprocessingException .. py:data:: BENEFIT_CAPS .. py:data:: BENEFIT_TYPE .. py:data:: DATA_DRIVEN_BENEFIT_ASSUMPTIONS :value: ['network_moves', 'market_rate_variance', 'daily_flex_contract_priced'] .. py:data:: MANUAL_BENEFIT_ASSUMPTIONS .. py:data:: MARKET_VARIANCE_IMPLEMENTABILITY :value: 0.5 .. py:data:: MIN_LANE_LENGTH :value: 250 .. py:data:: NETWORK_BENEFIT_IMPLEMENTABILITY :value: 0.1