@@ -51,6 +51,17 @@ def parse_args():
5151        "--output" , "-o" , required = False , default = "metadata.json" , help = "Output file" 
5252    )
5353    parser .add_argument ("--hier" , "-x" , action = "store_true" , help = "Hierarchical JSON" )
54+     parser .add_argument ("--logs" , help = "Path to logs" , default = None )
55+     parser .add_argument (
56+         "--reports" ,
57+         help = "Path to reports" ,
58+         default = None ,
59+     )
60+     parser .add_argument (
61+         "--results" ,
62+         help = "Path to results" ,
63+         default = None ,
64+     )
5465    args  =  parser .parse_args ()
5566
5667    return  args 
@@ -190,13 +201,11 @@ def merge_jsons(root_path, output, files):
190201        file .close ()
191202
192203
193- def  extract_metrics (cwd , platform , design , flow_variant , output , hier_json ):
204+ def  extract_metrics (
205+     cwd , platform , design , flow_variant , output , hier_json , logPath , rptPath , resultPath 
206+ ):
194207    baseRegEx  =  "^{}\n ^-*\n ^{}" 
195208
196-     logPath  =  os .path .join (cwd , "logs" , platform , design , flow_variant )
197-     rptPath  =  os .path .join (cwd , "reports" , platform , design , flow_variant )
198-     resultPath  =  os .path .join (cwd , "results" , platform , design , flow_variant )
199- 
200209    metrics_dict  =  defaultdict (dict )
201210    metrics_dict ["run__flow__generate_date" ] =  now .strftime ("%Y-%m-%d %H:%M" )
202211    metrics_dict ["run__flow__metrics_version" ] =  "Metrics_2.1.2" 
@@ -404,7 +413,20 @@ def extract_metrics(cwd, platform, design, flow_variant, output, hier_json):
404413                    continue 
405414                print (f"Extract Metrics for { plt }  , { des }  , { variant }  " )
406415                file  =  "/" .join (["reports" , plt , des , variant , "metrics.json" ])
407-                 metrics , df  =  extract_metrics (cwd , plt , des , variant , file , args .hier )
416+                 logPath  =  os .path .join (cwd , "logs" , plt , des , variant )
417+                 rptPath  =  os .path .join (cwd , "reports" , plt , des , variant )
418+                 resultPath  =  os .path .join (cwd , "results" , plt , des , variant )
419+                 metrics , df  =  extract_metrics (
420+                     cwd ,
421+                     plt ,
422+                     des ,
423+                     variant ,
424+                     file ,
425+                     args .hier ,
426+                     logPath ,
427+                     rptPath ,
428+                     resultPath ,
429+                 )
408430                all_d .append (metrics )
409431                if  all_df .shape [0 ] ==  0 :
410432                    all_df  =  df 
@@ -424,4 +446,7 @@ def extract_metrics(cwd, platform, design, flow_variant, output, hier_json):
424446        args .flowVariant ,
425447        args .output ,
426448        args .hier ,
449+         args .logs ,
450+         args .reports ,
451+         args .results ,
427452    )
0 commit comments