def ep2dict(EP, area=1.0):
    """Format energy efficiency indicators as dict from primary energy data

    In the context of the CTE regulations, this refers to primary energy values.
    """
    areafactor = 1.0 / area
    eparen = areafactor * EP['EPpasoA']['ren']
    epanren = areafactor * EP['EPpasoA']['nren']
    epatotal = eparen + epanren
    eparer = eparen / epatotal if epatotal else 0.0
    epren = areafactor * EP['EP']['ren']
    epnren = areafactor * EP['EP']['nren']
    eptotal = epren + epnren
    eprer = epren / eptotal if eptotal else 0.0
    epdict = {'EPAren': eparen, 'EPAnren': epanren, 'EPAtotal': epatotal,
        'EPArer': eparer, 'EPren': epren, 'EPnren': epnren, 'EPtotal':
        eptotal, 'EPrer': eprer}
    return epdict
