message_ix_models.model.transport.factor.Keep

class message_ix_models.model.transport.factor.Keep(**kwargs)[source]

Bases: Omit

A layer that preserves values for 1 or more labels along dim.

__init__(**kwargs)

Methods

__init__(**kwargs)

apply(other, coords)

quantify() this layer and combine it with other.

operation(b, /)

Same as a ** b.

quantify(coords)

Return a quantification of the layer.

Attributes

dim

Dimension along which to omit labels.

labels

Specific labels or coords to omit.

apply(other: AttrSeries, coords: Mapping[str, Any]) AttrSeries

quantify() this layer and combine it with other.

Subclasses may override this method. The default implementation combines other with the results of quantify() using operation.

dim: str

Dimension along which to omit labels.

labels: list

Specific labels or coords to omit.

operation(b, /)

Same as a ** b.

quantify(coords)[source]

Return a quantification of the layer.

The returned value:

  • May have any of the dimensions indicated by coords.

  • For such dimensions, should have some or all of the labels in coords.

Subclasses must implement this method.