jkushwaha commited on
Commit
608f8d2
·
verified ·
1 Parent(s): 57e8624

Update multiprocessing_in_date_ingestion.py

Browse files
multiprocessing_in_date_ingestion.py CHANGED
@@ -71,7 +71,8 @@ def report_date_insertion(dict_list, df_list, logging_df):
71
 
72
  return dict_list, logging_df
73
 
74
- def process_biomarker_detail(biomarker_detail):
 
75
  attributes = biomarker_detail['attribute']
76
  for attribute in attributes:
77
  attribute_details = attribute['attribute_details']
@@ -81,6 +82,7 @@ def process_biomarker_detail(biomarker_detail):
81
  def json_report_date_insertion(json_data, df_list, logging_df):
82
  biomarker_details = json_data['patient_level']['biomarkers']['details']
83
  with Pool() as pool:
84
- updated_biomarker_details = pool.map(process_biomarker_detail, biomarker_details)
85
  json_data['patient_level']['biomarkers']['details'] = updated_biomarker_details
86
  return json_data, logging_df
 
 
71
 
72
  return dict_list, logging_df
73
 
74
+ def process_biomarker_detail(args):
75
+ biomarker_detail, df_list, logging_df = args
76
  attributes = biomarker_detail['attribute']
77
  for attribute in attributes:
78
  attribute_details = attribute['attribute_details']
 
82
  def json_report_date_insertion(json_data, df_list, logging_df):
83
  biomarker_details = json_data['patient_level']['biomarkers']['details']
84
  with Pool() as pool:
85
+ updated_biomarker_details = pool.map(process_biomarker_detail, [(biomarker_detail, df_list, logging_df) for biomarker_detail in biomarker_details])
86
  json_data['patient_level']['biomarkers']['details'] = updated_biomarker_details
87
  return json_data, logging_df
88
+