omfpandas.blockmodels.attributes.get_attribute_by_name

omfpandas.blockmodels.attributes.get_attribute_by_name(blockmodel, attr_name)[source]

Get the variable/attribute by its name from a BlockModel.

Parameters:
  • blockmodel (BlockModel) – The BlockModel to get the data from.

  • attr_name (str) – The name of the attribute to retrieve.

Returns:

The attribute with the given name.

Return type:

Union[CategoryAttribute, NumericAttribute]

Raises:
  • ValueError – If the variable is not found as cell data in the BlockModel or if multiple variables with the

  • same name are found.