MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / draw_table

Function draw_table

bmtools/tools/meta_analysis/api.py:456–470  ·  view source on GitHub ↗

extract the important elements of the literatures recorded in the literature path and return the path of table records. concatenate the literature path and the analysis topic with '&&&' as the input.

( literature_path_and_topic:str)

Source from the content-addressed store, hash-verified

454
455 @tool.get('/draw_table')
456 def draw_table( literature_path_and_topic:str):
457 """extract the important elements of the literatures recorded in the literature path and return the path of table records. concatenate the literature path and the analysis topic with '&&&' as the input.
458 """
459 if len(literature_path_and_topic.split('&&&'))!=2:
460 js = {'error': "input path cannot recognize the literature path and the topic. please input 'LITERATURE_PATH&&&TOPIC'. "}
461 return js
462 literature_path, topic = literature_path_and_topic.split('&&&')
463 try:
464 finaldocs = pickle.load(open(literature_path.strip(' '), 'rb'))
465 except Exception as e:
466 js = {'error': 'cannot open the given literature path!'}
467 return js
468 draw_subtable('subtable_'+literature_path.strip(' ').strip('.pkl')+'.txt', topic, finaldocs)
469 js = {'table_path': 'subtable_'+literature_path.strip('.pkl')+'.txt'}
470 return js
471
472 @tool.get('/combine_table')
473 def combine_table( literature_path: str, table_path: str, topic: str):#( table_path_and_topic: str ):

Callers

nothing calls this directly

Calls 1

draw_subtableFunction · 0.85

Tested by

no test coverage detected