leaf_engine.etl.fsc =================== .. py:module:: leaf_engine.etl.fsc Functions --------- .. autoapisummary:: leaf_engine.etl.fsc._get_lane_level_fuel_surcharge_schedule leaf_engine.etl.fsc._get_shipment_level_fuel_surcharge_schedule leaf_engine.etl.fsc._match_fsc leaf_engine.etl.fsc._match_lane_level_fsc leaf_engine.etl.fsc._match_shipment_level_fsc leaf_engine.etl.fsc.fsc_pipeline Module Contents --------------- .. py:function:: _get_lane_level_fuel_surcharge_schedule(df: pandas.DataFrame) -> pandas.DataFrame Retrieves the latest applicable fuel surcharge schedule. Retrieved on an origin state/shipment date basis. :param df: shipments to operate on. :returns: shipments with fuel schedule columns. :rtype: df .. py:function:: _get_shipment_level_fuel_surcharge_schedule(df: pandas.DataFrame) -> pandas.DataFrame Retrieves the latest applicable fuel surcharge schedule. Retrieved on an origin state/shipment date basis. :param df: shipments to operate on. :returns: shipments with fuel schedule columns. :rtype: df .. py:function:: _match_fsc(fsc_df: pandas.DataFrame, company_id: int, ship_date: str, o_state: str) -> pandas.Series Matches the shipment to the proper fuel surcharge schedule. :param fsc_df: fuel surcharge schedules. :param company_id: company id. :param ship_date: shipment date. :param o_state: origin state. .. py:function:: _match_lane_level_fsc(row: pandas.Series, fsc_df: pandas.DataFrame) -> pandas.Series Matches the row to the proper fuel surcharge schedule. Finds the closest valid_from date that is <= shipment date. If there are multiple matches, it will choose the one with the highest hierarchy level. Rows are matched on the origin state or NA (matches all origin states). .. py:function:: _match_shipment_level_fsc(row: pandas.Series, fsc_df: pandas.DataFrame) -> pandas.Series Matches the row to the proper fuel surcharge schedule. Finds the closest valid_from date that is <= shipment date. If there are multiple matches, it will choose the one with the highest hierarchy level. Rows are matched on the origin state or NA (matches all origin states). .. py:function:: fsc_pipeline(df: pandas.DataFrame, lane_level: bool = False) -> pandas.DataFrame