def get_dimension_by_unit_measure_or_abbreviation(measure_or_unit_abbreviation,**kwargs):
    """
        Return the physical dimension a given unit abbreviation of a measure, or the measure itself, refers to.
        The search key is the abbreviation or the full measure
    """

    unit_abbreviation, factor = _parse_unit(measure_or_unit_abbreviation)

    units = db.DBSession.query(Unit).filter(Unit.abbreviation==unit_abbreviation).all()

    if len(units) == 0:
        raise HydraError('Unit %s not found.'%(unit_abbreviation))
    elif len(units) > 1:
        raise HydraError('Unit %s has multiple dimensions not found.'%(unit_abbreviation))
    else:
        dimension = db.DBSession.query(Dimension).filter(Dimension.id==units[0].dimension_id).one()
        return str(dimension.name)
def get_dimension_by_unit_measure_or_abbreviation ( measure_or_unit_abbreviation , ** kwargs ) : unit_abbreviation , factor = _parse_unit ( measure_or_unit_abbreviation ) units = db . DBSession . query ( Unit ) . filter ( Unit . abbreviation == unit_abbreviation ) . all ( ) if len ( units ) == 0 : raise HydraError ( 'Unit %s not found.' % ( unit_abbreviation ) ) elif len ( units ) > 1 : raise HydraError ( 'Unit %s has multiple dimensions not found.' % ( unit_abbreviation ) ) else : dimension = db . DBSession . query ( Dimension ) . filter ( Dimension . id == units [ 0 ] . dimension_id ) . one ( ) return str ( dimension . name )
Return the physical dimension a given unit abbreviation of a measure, or the measure itself, refers to.
        The search key is the abbreviation or the full measure