leaf_engine.adapt.adapt_synthetic_rates

Functions

calculate_reefer_rates(→ pandas.DataFrame)

Calculates reefer rates.

drop_duplicate_months(date_cols)

Takes in a list of datetime values Returns a list with no more than one

get_city_state_to_region_mappings(→ pandas.DataFrame)

Returns the mappings for city+state->zip3->kma->region.

get_rates_for_our_lanes(_lanes, ...)

get_region_to_region_reefer_multiples()

Gets region-to-region multiples of reefer rates from DB.

get_spot_rates(→ pandas.DataFrame)

get_synthetic_rates(→ pandas.DataFrame)

This function uses DAT rate data to extrapolate spot rates for Leaf lanes.

populate_dat_table_zip3(→ pandas.DataFrame)

Adds origin and destination zip3 from reference city/state pairs.

query_dat_table(→ pandas.DataFrame)

Pulls synthetic rate data from the synspot schema.

Module Contents

leaf_engine.adapt.adapt_synthetic_rates.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

Parameters:

dat_table (pandas.DataFrame) –

Return type:

pandas.DataFrame

leaf_engine.adapt.adapt_synthetic_rates.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.

leaf_engine.adapt.adapt_synthetic_rates.get_city_state_to_region_mappings() pandas.DataFrame

Returns the mappings for city+state->zip3->kma->region.

Return type:

pandas.DataFrame

leaf_engine.adapt.adapt_synthetic_rates.get_rates_for_our_lanes(_lanes, _dat_zip3_kma_all_rates, _dat_fuel)
leaf_engine.adapt.adapt_synthetic_rates.get_region_to_region_reefer_multiples()

Gets region-to-region multiples of reefer rates from DB.

leaf_engine.adapt.adapt_synthetic_rates.get_spot_rates(dat_table, _kma_markets, _dat_fuel) pandas.DataFrame
Return type:

pandas.DataFrame

leaf_engine.adapt.adapt_synthetic_rates.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.

Parameters:
Return type:

pandas.DataFrame

leaf_engine.adapt.adapt_synthetic_rates.populate_dat_table_zip3(dat_table: pandas.DataFrame) pandas.DataFrame

Adds origin and destination zip3 from reference city/state pairs.

Parameters:

dat_table (pandas.DataFrame) –

Return type:

pandas.DataFrame

leaf_engine.adapt.adapt_synthetic_rates.query_dat_table() pandas.DataFrame

Pulls synthetic rate data from the synspot schema.

Return type:

pandas.DataFrame