

def write_groups_to_hdf5(group, name, value):
    global str_dtype
    filename = group.file.filename
    if isinstance(value, dict):
        dict_grp = create_group(group, name)
        dict_grp = group.create_group(name)
        for (k, v) in value.items():
            write_groups_to_hdf5(dict_grp, k, v)
    elif isinstance(value, VariableTree):
        vartree_grp = create_group(group, name)
        vartree_grp = group.create_group(name)
        vartree_grp.attrs['__vartree__'] = True
        for k in value.list_vars():
            write_groups_to_hdf5(vartree_grp, k, value.get(k))
    elif isinstance(value, np.ndarray):
        if (group.file.driver == 'mpio'):
            create_dataset(group, name, data=value)
            if (value.shape == (0,)):
                group.create_dataset(name, data=value, maxshape=(1,))
            else:
                group.create_dataset(name, data=value)
        else:
            create_dataset(group, name, data=value, compression='gzip', chunks=True)
            group.create_dataset(name, data=value, compression='gzip', chunks=True)
    elif isinstance(value, list):
        if (len(value) > 0):
            if isinstance(value[0], str):
                create_dataset(group, name, (len(value),), str_dtype)
                group.create_dataset(dict_grp, (len(value),), str_dtype)
        else:
            create_dataset(group, name, (0,))
            group.create_dataset(name, (0,))
    elif (value == None):
        create_dataset(group, name, (0,))
        group.create_dataset(name, (0,))
    elif isinstance(value, (np.float64, float)):
        create_dataset(group, name, (), dtype=np.float64)
        group.create_dataset(name, (), dtype=np.float64)
    elif isinstance(value, int):
        create_dataset(group, name, (), dtype=np.int64)
        group.create_dataset(name, (), dtype=np.int64)
    elif isinstance(value, str):
        dset = create_dataset(group, name, (), dtype=str_dtype)
        dset = group.create_dataset(name, (), dtype=str_dtype)
    elif isinstance(value, bool):
        dset = create_dataset(group, name, (), dtype=np.bool)
        dset = group.create_dataset(name, (), dtype=np.bool)

dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/casehandlers/hdf5case.py write_groups_to_hdf5/VarMisuse@329/398 `name`->`dict_grp`