@das.register(BaseType)
@das.register(GridType)
def _basetypegridtype(var, level=0):
    (yield '{indent}{name} {{\n'.format(indent=(level * INDENT), name=var.name))
    for attr in sorted(var.attributes.keys()):
        values = var.attributes[attr]
        if (np.asarray(values).size > 0):
            for line in build_attributes(attr, values, (level + 1)):
                (yield line)
    (yield '{indent}}}\n'.format(indent=(level * INDENT)))
@das.register(BaseType)
@das.register(GridType)
def _basetypegridtype(var, level=0):
    (yield '{indent}{name} {{\n'.format(indent=(level * INDENT), name=var.name))
    for attr in sorted(var.attributes.keys()):
        values = var.attributes[attr]
        if (np.asarray(values).size > 0):
            for line in build_attributes(attr, values, (level + 1)):
                (yield line)
    (yield '{indent}}}\n'.format(indent=(level * INDENT)))