Matic Lubej
01/18/2021, 1:46 PMGreg Roche
01/18/2021, 1:52 PMMatic Lubej
01/18/2021, 1:59 PMGreg Roche
01/18/2021, 2:05 PMMatic Lubej
01/18/2021, 2:25 PMdef get_tiles():
return [['T1_1','T1_2','T1_3'], ['T2_1','T2_2','T2_3'], ...]
def process_tile(tile):
# do stuff to `tile`
# create further tasks from single tile
return [(tile, p1), (tile, p2), ...]
def merge_same_param_over_tiles(specific_tiles, params):
# merge [(T1_1, p1), (T1_2, p1), (T1_3, p1)]
return merged_output
with Flow("flow name") as flow:
nested_list = get_tiles() # output is nested list
processed_tiles_with_params = process_tile(flatten(nested_list)) # input is flattened list, output is [(T1_1, p1), (T1_1, p1), ... (T1_1, p2), ... (T2_1, p1), ... (T2_2, p2), ...]
...
# how to now reduce only specific part of `all_processed_tiles` and map over these subgroups?
# i.e. reduce [(T1_1, p1), (T1_2, p1), ..., (T1_N, p1)]
# reduce [(T1_1, p2), (T1_2, p2), ..., (T1_N, p2)]
# ...
# reduce [(T2_1, pM), (T2_2, pM), ..., (T2_N, pM)]
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.
Powered by