leaf_engine.adapt.adapt_synthetic_rates ======================================= .. py:module:: leaf_engine.adapt.adapt_synthetic_rates Functions --------- .. autoapisummary:: leaf_engine.adapt.adapt_synthetic_rates.calculate_reefer_rates leaf_engine.adapt.adapt_synthetic_rates.drop_duplicate_months leaf_engine.adapt.adapt_synthetic_rates.get_city_state_to_region_mappings leaf_engine.adapt.adapt_synthetic_rates.get_rates_for_our_lanes leaf_engine.adapt.adapt_synthetic_rates.get_region_to_region_reefer_multiples leaf_engine.adapt.adapt_synthetic_rates.get_spot_rates leaf_engine.adapt.adapt_synthetic_rates.get_synthetic_rates leaf_engine.adapt.adapt_synthetic_rates.populate_dat_table_zip3 leaf_engine.adapt.adapt_synthetic_rates.query_dat_table Module Contents --------------- .. py:function:: calculate_reefer_rates(dat_table: pandas.DataFrame) -> pandas.DataFrame Calculates reefer rates. This uses a combination of dry rates, and region-to-region variances between dry and reefer. For more information see: https://leaflogistics.atlassian.net/wiki/spaces/AN/pages/3121905665/Reefer+Analysis .. py:function:: drop_duplicate_months(date_cols) Takes in a list of datetime values Returns a list with no more than one date per month per year. .. py:function:: get_city_state_to_region_mappings() -> pandas.DataFrame Returns the mappings for city+state->zip3->kma->region. .. py:function:: get_rates_for_our_lanes(_lanes, _dat_zip3_kma_all_rates, _dat_fuel) .. py:function:: get_region_to_region_reefer_multiples() Gets region-to-region multiples of reefer rates from DB. .. py:function:: get_spot_rates(dat_table, _kma_markets, _dat_fuel) -> pandas.DataFrame .. py:function:: get_synthetic_rates(_dat_table: pandas.DataFrame, _kma_markets: pandas.DataFrame, _dat_fuel: float, _lanes: pandas.DataFrame) -> pandas.DataFrame This function uses DAT rate data to extrapolate spot rates for Leaf lanes. .. py:function:: populate_dat_table_zip3(dat_table: pandas.DataFrame) -> pandas.DataFrame Adds origin and destination zip3 from reference city/state pairs. .. py:function:: query_dat_table() -> pandas.DataFrame Pulls synthetic rate data from the synspot schema.