'Apply the name or unit mapping if configured.'

def _map(self, s, attr):

    mapped = None
    from_ = self.source.get('map_from')
    to_ = self.target.get('map_to')
    if (from_ and to_):
        if (from_.get(attr) and to_.get(attr)):
            try:
                mapped = re.sub(from_[attr], to_[attr], getattr(s, attr))
            except Exception:
                pass
    return (mapped or self.target.get(attr, getattr(s, attr)))
