CoreModel.get_aggregation(
set=None,
classification=None,
level='section',
*,
unresolved='keep',
)#

Build a proposed aggregation from this database’s concordances.

Parameters:
  • set (str, optional) – Activity or Commodity for SUTs; Sector for IOTs. Defaults follow get_concordances().

  • classification (str, optional) – Target edition. Defaults to NACE Rev. 2.1 for activities and CPA 2.2 for commodities. See available_aggregations.

  • level (str, default "section") – Official hierarchy level: section, division, group or class; CPA also has category and subcategory. Aliases such as "2 digits" select division.

  • unresolved ({"keep", "raise"}, default "keep") – Keep unverified items and items spanning several target groups individually, or raise WrongInput if any remain unresolved.

Returns:

{set_name: mapping}, ready for db.aggregate(mapping, levels=list(mapping), inplace=False). Each frame has an Aggregation column and a native-item index, or a (region, item) index for regional sets. Its attrs["concordance"] report contains group descriptions, hierarchy source and unresolved items with reasons.

Return type:

dict[str, pandas.DataFrame]

Notes

No matrices or settings are changed. Several linked codes can collapse to one ancestor group; an item is never duplicated or split between targets. Names include the classification edition, e.g. "NACE Rev. 2.1:A". Correspondence footprints retain their source qualifications: this is a reviewable grouping proposal, not certified native containment or an allocation model. Inspect get_concordances(details=True) before applying it.

Prepares the complete selected native set; item and region filters are not accepted. With unresolved=”keep”, the proposal can mix standard groups and retained native labels. Unit compatibility is checked when the mapping is applied by aggregate, not during preparation.

See Aggregating by classification for hierarchy levels, a worked GLORIA example, unresolved-item reports and application with aggregate. get_aggregation prepares the complete selected set; it does not accept an item or region filter.

unresolved="keep" retains original labels alongside standard groups. Use unresolved="raise" to require one target group for every item. Availability of a correspondence alone does not establish availability of a hierarchy preset; inspect available_aggregations.