call_report.fca.DomainDatasetDerived#

class call_report.fca.DomainDatasetDerived(*, column: str, operation: Literal['sum', 'difference'], components: tuple[str, ...])[source]#

Bases: object

One output column computed from other output columns.

Derived columns are part of the curation rather than the source data. Declaring the components here keeps two definitions of the same idea (a narrow and a wide nonperforming total, say) visible side by side instead of buried in the code that computes them.

Attributes:
columnstr

The output column this produces.

operation{“sum”, “difference”}

How components combine.

componentstuple[str, …]

The output columns this is computed from, in order.

Examples

>>> from call_report.fca._domain_datasets import DomainDatasetDerived
>>> net_charge_off = DomainDatasetDerived(
...     column="net_charge_off",
...     operation="difference",
...     components=("charge_off", "recovery"),
... )
>>> net_charge_off.operation
'difference'