settings module provides comprehensive utilities for loading, validating, and accessing configuration settings for OpenAVM Kit, including field classifications, model groups, and locality-specific configurations.
Settings Loading
load_settings()
Load settings file from disk and merge with templates.Path to the settings file
Already loaded settings object (if provided, settings_file is ignored)
Whether to raise errors or emit warnings if something is wrong
Whether to emit warnings if something is wrong
The settings object, merged with templates and with variables replaced. Returns
None if settings cannot be loaded.Field Classification
get_fields_land()
Get all fields classified as pertaining to land.Settings dictionary
Optional DataFrame to filter fields by presence
Dictionary containing:
categorical: list of categorical land fieldsnumeric: list of numerical land fieldsboolean: list of boolean land fields
dist_to_*, within_*, proximity_to_*, and spatial_lag_*.get_fields_land_as_list()
Get all land fields as a single flat list.Settings dictionary
Optional DataFrame to filter fields
Flat list of all land field names
get_fields_impr()
Get all fields classified as pertaining to buildings/improvements.Settings dictionary
Optional DataFrame to filter fields
Dictionary with
categorical, numeric, and boolean keysget_fields_categorical()
Retrieve categorical field names based on settings.Settings dictionary
DataFrame to filter fields by presence
Whether to include boolean fields
Field classification types to include
List of categorical field names
get_fields_numeric()
Retrieve numeric field names based on settings.Settings dictionary
DataFrame to filter fields by presence
Whether to include boolean fields
Field classification types to include
List of numeric field names
get_fields_boolean()
Retrieve boolean field names based on settings.Settings dictionary
DataFrame to filter fields by presence
Field classification types to include
List of boolean field names
Model Configuration
get_model_group()
Get a model group definition object from settings.Settings dictionary
The name of the model group
Model group definition containing configuration for that model group
get_model_group_ids()
Get all model group IDs in the preferred order.Settings dictionary
Optional DataFrame to filter by model groups present in the data
Ordered list of model group IDs
Locality Settings
get_valuation_date()
Get the valuation date from settings.Settings dictionary
The valuation date. Defaults to January 1 of current year if not specified in settings.
get_look_back_dates()
Get the look-back date range for ratio studies.Settings dictionary
Tuple containing:
look_back_date: Start of the look-back periodval_date: Valuation date (end of period)
get_center()
Get the centroid of the locality.Settings dictionary
Optional parcel geometry to calculate centroid from if not in settings
Tuple of (longitude, latitude)
Unit Conversions
area_unit()
Get the designated small area unit.Settings dictionary
'sqft' if units are imperial, 'sqm' if metricbig_area_unit()
Get the designated large area unit.Settings dictionary
'acre' if units are imperial, 'ha' (hectare) if metriclength_unit()
Get the designated small length unit.Settings dictionary
'ft' if units are imperial, 'm' if metricbig_length_unit()
Get the designated large length unit.Settings dictionary
'mi' if units are imperial, 'km' if metricData Dictionary
get_data_dictionary()
Get the data dictionary object.Settings dictionary
The data dictionary for this locality, mapping field names to their metadata
get_grouped_fields_from_data_dictionary()
Get all field names from a specific group in the data dictionary.The data dictionary
Name of a particular group in the data dictionary
Optional list of types to filter by:
'boolean', 'str', 'number', 'percent', 'date'List of field names belonging to the specified group
Variable Interactions
get_variable_interactions()
Get variable interaction information from a model group configuration.Model group dictionary that may contain variable interactions
Global settings dictionary
Your dataset
Dictionary mapping field names to other field names for variable interactions.For example,
{'neighborhood': 'land_area_sqft'} means each one-hot-encoded neighborhood dummy will be multiplied by the land area value.