8
8
9
9
# import dag
10
10
import os .path as op
11
+ import os
11
12
import sys
12
13
13
14
def clone_repo (module_name ):
@@ -108,6 +109,9 @@ def get_initial_dataset_paths(dataset):
108
109
109
110
return (sum (filled , []))
110
111
112
+
113
+ ## playground -------------
114
+
111
115
# dirty, fix
112
116
def write_module_flag_for_dirty_module_wildcards (module ):
113
117
## creates an empty file
@@ -117,8 +121,33 @@ def write_module_flag_for_dirty_module_wildcards(module):
117
121
def tokenize_parameters ():
118
122
print ('todo' )
119
123
120
- def exclude_items_from_explicit_outputs ():
121
- print ('todo' )
124
+ def count_path_depth (path ):
125
+ return (path .count (os .sep ))
126
+
127
+ ## if a module (stage) gets inputs from different modules, i.e. counts from 'processed' after 'raw'
128
+ ## and 'meta' from raw, then we have to nest outputs after the longest (deepest) folder -
129
+ ## that is, raw/processed/here, and not to raw/here
130
+ def get_deepest_input_dirname (stage ):
131
+ i = get_stage_explicit_inputs (stage )
132
+ deepest_input = '.'
133
+ if i is not None :
134
+ deepest_input_depth = 0
135
+ for item in i .keys ():
136
+ curr_depth = count_path_depth (i [item ])
137
+ if curr_depth > deepest_input_depth :
138
+ deepest_input_depth = curr_depth
139
+ deepest_input = op .dirname (i [item ])
140
+ return ('this breaks because explicit inputs are lists - raw vs processed; iterate instead' )
141
+
142
+
143
+ ## with substituted module/stage/ids
144
+ def fill_explicit_outputs (stage , module ):
145
+ i = get_stage_explicit_outputs (stage )
146
+ idir = get_deepest_input_dirname (stage )
122
147
123
- def nest_deliverable_paths ():
124
- print ('todo' )
148
+ oe = get_stage_outputs (stage )
149
+ excludes = get_module_excludes (stage = stage , module = module )
150
+ return ('todo' )
151
+
152
+ def nest_deliverable_path (parent , path ):
153
+ return (op .join (parent , path ))
0 commit comments