combine several tables recorded in the table path into one comprehensive record table and return. give the literature path, table path and the exploring topic as the input.
( literature_path: str, table_path: str, topic: str)
| 471 | |
| 472 | @tool.get('/combine_table') |
| 473 | def combine_table( literature_path: str, table_path: str, topic: str):#( table_path_and_topic: str ): |
| 474 | """combine several tables recorded in the table path into one comprehensive record table and return. give the literature path, table path and the exploring topic as the input. |
| 475 | """ |
| 476 | #if len(table_path_and_topic.split('&&&'))!=2: |
| 477 | # js = {'error': "input path cannot recognize the table path and the topic. please input 'TABLE_PATH&&&TOPIC'. "} |
| 478 | # return js |
| 479 | #table_path, topic = table_path_and_topic.split('&&&') |
| 480 | try: |
| 481 | finaldocs = pickle.load(open(literature_path, 'rb')) |
| 482 | except Exception as e: |
| 483 | js = {'error': "cannot open the given literature path!"} |
| 484 | return js |
| 485 | orig_tab, dicrec, extra = get_table(table_path.strip(' '), topic) |
| 486 | extra_draw('extra_'+table_path.strip(' '), finaldocs, extra) |
| 487 | final_tab = final_table('extra_'+table_path.strip(' '), dicrec) |
| 488 | allcon = print_table(final_tab) |
| 489 | fw = open('big_'+table_path, 'w') |
| 490 | fw.write(allcon) |
| 491 | fw.close() |
| 492 | js = {'big table path': 'big_'+table_path} |
| 493 | return js |
| 494 | |
| 495 | @tool.get('/generate_summary') |
| 496 | def generate_summary(topic: str, table_path: str): |
nothing calls this directly
no test coverage detected