cubes_lite/model/cube.py
def expand_model(cls, model_data):
        """Expands `model_data` to be as complete as possible cube model."""

        model_data = dict(model_data)

        if not 'name' in model_data:
            raise ModelError('Cube has no name')

        dimensions = model_data.get('dimensions') or []
        dimensions = ensure_list(dimensions)
        dimensions = [Dimension.expand_model(d) for d in dimensions]
        model_data['dimensions'] = dimensions

        measures = model_data.get('measures') or []
        measures = ensure_list(measures)
        measures = [Measure.expand_model(m) for m in measures]
        model_data['measures'] = measures

        aggregates = model_data.get('aggregates') or []
        aggregates = ensure_list(aggregates)
        aggregates = [Aggregate.expand_model(a) for a in aggregates]
        model_data['aggregates'] = aggregates

        return model_data
Expands `model_data` to be as complete as possible cube model.
Expands `model_data` to be as complete as possible cube model.
Expands ` model_data ` to be as complete as possible cube model .
def expand_model(cls, model_data):
        model_data = dict(model_data)
        if not 'name' in model_data:
            raise ModelError('Cube has no name')
        dimensions = model_data.get('dimensions') or []
        dimensions = ensure_list(dimensions)
        dimensions = [Dimension.expand_model(d) for d in dimensions]
        model_data['dimensions'] = dimensions
        measures = model_data.get('measures') or []
        measures = ensure_list(measures)
        measures = [Measure.expand_model(m) for m in measures]
        model_data['measures'] = measures
        aggregates = model_data.get('aggregates') or []
        aggregates = ensure_list(aggregates)
        aggregates = [Aggregate.expand_model(a) for a in aggregates]
        model_data['aggregates'] = aggregates
        return model_data
def expand_model ( cls , model_data ) : model_data = dict ( model_data ) if not 'name' in model_data : raise ModelError ( 'Cube has no name' ) dimensions = model_data . get ( 'dimensions' ) or [ ] dimensions = ensure_list ( dimensions ) dimensions = [ Dimension . expand_model ( d ) for d in dimensions ] model_data [ 'dimensions' ] = dimensions measures = model_data . get ( 'measures' ) or [ ] measures = ensure_list ( measures ) measures = [ Measure . expand_model ( m ) for m in measures ] model_data [ 'measures' ] = measures aggregates = model_data . get ( 'aggregates' ) or [ ] aggregates = ensure_list ( aggregates ) aggregates = [ Aggregate . expand_model ( a ) for a in aggregates ] model_data [ 'aggregates' ] = aggregates return model_data
Expands `model_data` to be as complete as possible cube model.
Expands ` model_data ` to be as complete as possible cube model .
"""Expands `model_data` to be as complete as possible cube model."""
cls
model_data