Skip to content
Snippets Groups Projects
Commit 6ce3bd80 authored by Felix Kleinert's avatar Felix Kleinert
Browse files

fix missing branch loop to create bootcollection

parent e7c2c32b
Branches
Tags
No related merge requests found
......@@ -198,32 +198,17 @@ class BootstrapIteratorVariableSets(BootstrapIterator):
@classmethod
def create_collection(cls, data, dim):
# l = set()
# for i, x in enumerate(data.get_X(as_numpy=False)):
# l.update(x.indexes[dim].to_list())
# # l.update(['O3Sect', 'O3SectLeft', 'O3SectRight']) # ToDo Remove : just for testing
# return [[var for var in to_list(l) if var.endswith(collection_name)] for collection_name in cls._variable_set_splitters]
l = []
for i, x in enumerate(data.get_X(as_numpy=False)):
l.append(x.indexes[dim].to_list())
# l[0] = l[0] + ['o3Sect', 'o3SectLeft', 'o3SectRight', 'no2Sect', 'no2SectLeft', 'no2SectRight']
res = [[var for var in l[i] if var.endswith(collection_name)] for collection_name in cls._variable_set_splitters]
base_vars = [var for var in l[i] if not var.endswith(tuple(cls._variable_set_splitters))]
res = [[var for var in l[i] if var.endswith(collection_name)] for i, _ in enumerate(data.get_X(as_numpy=False))
for collection_name in cls._variable_set_splitters]
base_vars = [var for var in l[i] if not var.endswith(tuple(cls._variable_set_splitters)) for i, _ in
enumerate(data.get_X(as_numpy=False))]
res.append(base_vars)
res = [(i, dimensions) for i, _ in enumerate(data.get_X(as_numpy=False)) for dimensions in res]
return res
# return list(chain(*res))
# [[(0, 'o3'), (0, 'relhum'), (0, 'temp'), (0, 'u'), (0, 'v'), (0, 'no'), (0, 'no2'), (0, 'cloudcover'),
# (0, 'pblheight')]]
# l = []
# for i, x in enumerate(data.get_X(as_numpy=False)):
# l.append(list(map(lambda y: (i, y), x.indexes[dim])))
# return list(chain(*l))
class ShuffleBootstraps:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment