Database.keep_extensions(extensions, *, inplace=True)#

Keep only the selected satellite accounts in every scenario.

Parameters:
  • extensions – One Satellite account label or an iterable of labels to retain. Labels must exist and must not be repeated. Their original database order is preserved. An empty list removes all satellite accounts.

  • inplace – When True, modify this database. When False, return an independent copy with the selected accounts.

Returns:

Filtered database when inplace=False, otherwise None.

Return type:

Database | None

Notes

Filters stored satellite flows, coefficients, multipliers and footprints, including final-demand accounts, in all scenarios. Units, index mappings and satellite clusters are updated. Sparse storage is preserved, and no missing matrices are calculated. Cached custom operator results depending on the affected blocks are discarded for on-demand recalculation.

This selects Satellite accounts, not Factors of production. Economic nodes and the size of the linear system remain unchanged; selecting one account reduces the number of right-hand sides needed for multipliers. Import reports remain records of the original input data.

Examples

Keep one account before computing multipliers:

db.keep_extensions(["CO2"])
co2_multipliers = db.f  # Use db.fc on a SUT.

Call this before requesting multipliers when only a few satellite accounts are needed. For example, on a database containing a CO2 account:

db.keep_extensions(["CO2"])

# One indicator row, instead of all original satellite accounts.
multipliers = db.fc  # SUT; use db.f for an IOT.

To retain the original database:

reduced = db.keep_extensions(["CO2"], inplace=False)

Use the exact labels returned by db.get_index("Satellite account"). The operation applies to every scenario, including direct final-demand accounts and already calculated satellite matrices. Economic and value-added matrices are retained. Keeping fewer accounts reduces the number of indicator systems to solve, but does not change the size or conditioning of the economic system.