Skip to main content

Model-Year Transitions

Two assets under <oem>/<market>/transitions/ record what changed between each base model's newest model year and the year before it. The synthetic-candidate rules and demand rules for a new model year are written from these changes.

AssetComponentOne row per
transitions/featuresFeatureTransitionsComponentoption code of a base model
transitions/attributesAttributeTransitionsComponentattribute of a base model

The logic is in ai_dagster.derived.feature_transitions and ai_dagster.derived.attribute_transitions.

Which years are compared​

The years come from each base model (base_model_id). The newer year is the base model's newest model_year. The older year is the latest year before it that the base model has, so a base model that skipped a year is compared across the gap. A base model with one year has a null prev_model_year, and each of its codes has the change type BASE_MODEL_ADDED.

An OEM publishes the base models of one model group in a new model year at different times. If the years were chosen per model group, a base model not yet published in the group's newest year would be compared against that year and reported as removed.

model_group_newest_model_year is the newest model_year of any base model in the base model's model group. A base model whose model_year is older than model_group_newest_model_year either has not been published in that year yet or has been discontinued. No column of the models table distinguishes the two cases.

Base models pair across years on base_model_id. An OEM that renames a model code between years maps the new code to the old one in the base_model_id_aliases setting of its consolidated component, so the two years still pair.

Feature transitions​

A row is keyed by (base_model_id, option_code). model_group_id is the base model's model group in the newer year. A code can appear on several feature rows in one year, one outside every package and one inside each package that includes it. Those rows are combined into one value for each year:

ColumnValue for one year
feature_idsthe feature_id of every feature row of the code
is_configurabletrue if any row is configurable
pricethe price of the row outside every package; null if every row is inside a package
parent_package_codesthe packages that include the code
package_childrenthe codes inside the code, when the code is a package

Each column is written once for each year, as new_<column> and prev_<column>. A code missing from one year has nulls in that year's new_ or prev_ columns.

change_types lists every change that applies:

ChangeMeaning
BASE_MODEL_ADDEDthe base model has no earlier year
FEATURE_ADDED, FEATURE_REMOVEDthe code is in one of the base model's two years
BECAME_CONFIGURABLE, BECAME_STANDARDis_configurable changed
PARENT_CHANGEDparent_package_codes changed
NOW_PACKAGE_ONLY, NOW_STANDALONEthe configured standalone_field changed
PRICE_CHANGEDthe price outside every package changed
PACKAGE_CONTENT_CHANGEDthe package's codes changed, including a package emptied or newly filled
NO_CHANGEnone of the above

new_in_model_group is true when any base model of model_group_id has the code in model_year. prev_in_model_group is true when any base model of the base model's model group in prev_model_year has the code in that year. prev_in_model_group is null when prev_model_year is null. These columns distinguish a code removed from every base model of the group from a code that only one base model lost. A base model of the group not yet published in model_year does not count toward new_in_model_group.

Attribute transitions​

A row is keyed by (base_model_id, attribute_type, attribute_value). A code counts toward an attribute in a year only where the code is configurable that year. The attributes come from featurization/features.

The codes that map to each attribute are listed by what happened to them:

  • entered_features lists the codes that gained the attribute. Each code's provenance is the code's own change (BASE_MODEL_ADDED, FEATURE_ADDED or BECAME_CONFIGURABLE), or MAPPING_ONLY when only the code's attributes changed.
  • exited_features lists the codes that lost the attribute. Each code's provenance is FEATURE_REMOVED, BECAME_STANDARD or MAPPING_ONLY.
  • carryover_features lists the codes that have the attribute in both years.
  • price_changes lists the carryover codes whose price changed.
  • package_changes lists the carryover codes whose package membership changed.

change_types lists every change that applies:

ChangeMeaning
ATTRIBUTE_ADDEDthe attribute is in the newer year only
ATTRIBUTE_REMOVEDthe attribute is in the older year only
COMPOSITION_CHANGEDthe attribute is in both years, and a code entered or exited it
PRICE_CHANGEDthe attribute is in both years, and price_changes is not empty
PACKAGE_MEMBERSHIP_CHANGEDthe attribute is in both years, and package_changes is not empty
NO_CHANGEnone of the above