@@ -27,8 +27,9 @@ def load_mapping(mapping_file='improve_drug_mapping.json'):
2727 "drugs" : []
2828 }, False
2929
30- def save_mapping (mapping_data , mapping_file = 'improve_drug_mapping.json' ):
30+ def save_mapping (mapping_data ):
3131 """Saves mapping data to disk as JSON."""
32+ mapping_file = 'tmp/improve_drug_mapping.json'
3233 with open (mapping_file , 'w' ) as f :
3334 json .dump (mapping_data , f , indent = 2 )
3435 print (f"Saved mapping data to { mapping_file } ." )
@@ -381,7 +382,7 @@ def main():
381382 # Set build_date
382383 build_date = args .build_date or datetime .utcnow ().strftime ("%Y-%m-%d" )
383384 # Mapping file path
384- mapping_file = 'improve_drug_mapping.json'
385+ mapping_file = 'build/ improve_drug_mapping.json'
385386
386387 # Load or initialize improve_drug_mapping.json
387388 mapping_data , had_prior = load_mapping (mapping_file )
@@ -425,7 +426,7 @@ def main():
425426
426427 # Sort final "drugs" by numeric portion if SMI_#, or lexically
427428 mapping_data ["drugs" ].sort (key = lambda d : parse_smi_num (d ["stable_id" ]) or 999999999 )
428- save_mapping (mapping_data , mapping_file )
429+ save_mapping (mapping_data )
429430 print (f"Updated { mapping_file } with { len (mapping_data ['drugs' ])} drugs." )
430431
431432 # Rewrite files
0 commit comments