caf.van.lgv_inputs#

Module containing functionality for reading and pre-processing the LGV inputs which are used for multiple segments.

Module Attributes

HH_PROJECTIONS_HEADER

Column names (and data types) for input CSV to household_projections function.

LGV_PARAMETERS_SHEET

Name of the sheet containing the main LGV parameters.

LGV_PARAMETERS_COLUMNS

Column names in the LGV_PARAMETERS_SHEET.

LGV_PARAMETERS

Names of the parameters (values) expected and their internal code name (keys).

TIME_PERIOD_SHEET

Name of the Excel Worksheet containing the time period factors.

TIME_PERIOD_COLUMNS

Name and dtype of the expected columns in the time period table.

GM_PARAMS_SHEET

Name of the Excel Worksheet containing the gravity model parameters.

GM_PARAMS_COLUMNS

Name and dtype of the expected columns in the gravity model parameters table.

LGV_SEGMENTS

Names of the LGV segments.

EXAMPLE_CONFIG_NAME

Name of the example config file to write.

DEFAULT_PERSONAL_PURPOSES

Default personal purposes to include in the LGV model.

Functions

filtered_employment(paths, aggregation)

Read and aggregated the TfN employment land-use DVector.

household_projections(occupied_paths, ...[, ...])

Reads and aggregates the household DVectors and converts to model zone system.

lgv_parameters(path)

Read the LGV Parameters sheet from the Excel workbook.

load_warehouse_floorspace(path, zone_lookup)

Load warehouse floorspace data and convert to model zone system.

read_study_area(path)

Reads model study area CSV.

read_time_factors(path)

Read time period factors from Excel Worksheet.

Classes

CommuteWarehousePaths(medium[, low, high])

Paths to LSOA warehouse data for the commute segment.

DwellingPaths(occupied, zc_path[, unoccupied])

Paths to the TfN dwelling CSVs and zone correspondence.

EmploymentPaths(path, zc_path)

Path to the TfN employment land-use data and zone correspondence.

GMInputs(trip_length_distribution_path, ...)

Defines the input paths and parameters for the gravity model.

InfillMethod(value)

Options for filling in NaN values in warehouse data.

LGVInputPaths(*, zoning, model_zones, ...[, ...])

Dataclass storing paths to all the input files for the LGV model.

PersonalArgs(normits_pa_folder, ...[, ...])

Input arguments for the personal matrix calculation.

Rezone()

Class for rezoning a matrix when given a lookup with splitting factors.

ZoneTranslationDefinition(path, from_zoning, ...)

Contains the path and column names of the zone translation.

Attributes Documentation

caf.van.lgv_inputs.HH_PROJECTIONS_HEADER = {'Area Description': <class 'str'>, 'HHs': <class 'float'>}#

Column names (and data types) for input CSV to household_projections function.

caf.van.lgv_inputs.LGV_PARAMETERS_SHEET = 'Parameters'#

Name of the sheet containing the main LGV parameters.

caf.van.lgv_inputs.LGV_PARAMETERS_COLUMNS = {'Parameter': <class 'str'>, 'Value': <class 'float'>}#

Column names in the LGV_PARAMETERS_SHEET.

caf.van.lgv_inputs.LGV_PARAMETERS = {'avg_new_house_size': 'Average new house size', 'lgv_growth': 'LGV growth', 'scotland_soc82_ratio': 'Scotland SOC821/SOC82', 'year': 'Model Year'}#

Names of the parameters (values) expected and their internal code name (keys).

caf.van.lgv_inputs.TIME_PERIOD_SHEET = 'Time Period Factors'#

Name of the Excel Worksheet containing the time period factors.

caf.van.lgv_inputs.TIME_PERIOD_COLUMNS = {'commuting_drivers': ('Commuting Drivers', <class 'float'>), 'commuting_skilled_trades': ('Commuting Skilled Trades', <class 'float'>), 'delivery_grocery': ('Delivery Grocery', <class 'float'>), 'delivery_parcel_bush': ('Delivery Parcel Bush', <class 'float'>), 'delivery_parcel_stem': ('Delivery Parcel Stem', <class 'float'>), 'personal': ('Personal', <class 'float'>), 'service': ('Service', <class 'float'>), 'time_period': ('Time Period', <class 'str'>)}#

Name and dtype of the expected columns in the time period table.

caf.van.lgv_inputs.GM_PARAMS_SHEET = 'Gravity Model Parameters'#

Name of the Excel Worksheet containing the gravity model parameters.

caf.van.lgv_inputs.GM_PARAMS_COLUMNS = {'calibrate': ('Run Calibration', <class 'str'>), 'function': ('Cost Function', <class 'str'>), 'furness_type': ('Furness Constraint Type', <class 'str'>), 'param1': ('Cost Function Parameter 1', <class 'float'>), 'param2': ('Cost Function Parameter 2', <class 'float'>), 'segment': ('Segment', <class 'str'>)}#

Name and dtype of the expected columns in the gravity model parameters table.

caf.van.lgv_inputs.LGV_SEGMENTS = ['service', 'delivery_parcel_stem', 'delivery_parcel_bush', 'delivery_grocery', 'commuting_drivers', 'commuting_skilled_trades']#

Names of the LGV segments.

caf.van.lgv_inputs.EXAMPLE_CONFIG_NAME = 'LGV_config_example.yml'#

Name of the example config file to write.

caf.van.lgv_inputs.DEFAULT_PERSONAL_PURPOSES = (3, 4, 5, 6, 7, 8, 13, 14, 15, 16, 18)#

Default personal purposes to include in the LGV model.