diff --git a/lingvodoc/schema/query.py b/lingvodoc/schema/query.py index ec6a912b..353a7846 100644 --- a/lingvodoc/schema/query.py +++ b/lingvodoc/schema/query.py @@ -367,8 +367,6 @@ # Setting up logging. log = logging.getLogger(__name__) -logging.disable(level=logging.INFO) - # Trying to set up celery logging. celery_log = get_task_logger(__name__) @@ -13056,7 +13054,11 @@ def export_dataframe(result_pool, distance_data_array, bundles): group_num = entry['group'] entry_text = f"{entry['swadesh']} [ {entry['transcription']} ] {entry['translation']}" if group_num and group_num in bundles: - groups.loc[group_num, dict_name] = entry_text + value = "" + if dict_name in groups: + cell = groups[dict_name].get(group_num) + value = cell if pd.notnull(cell) else value + groups.loc[group_num, dict_name] = f"{value}\n{entry_text}".strip() else: singles.loc[row_index, dict_name] = entry_text row_index += 1 @@ -13295,8 +13297,7 @@ def split_lex(lex): for group_index, group in enumerate(group_list): # Select etimologically linked entries linked = entries & group - if linked: - entry_id = linked.pop() + for entry_id in linked: result_pool[perspective_id][entry_id]['group'] = group_index swadesh = result_pool[perspective_id][entry_id]['swadesh'] # Store the correspondence: perspective { means(1/2/3) { etimological_groups(1.1/1.2/2.1/3.1) @@ -13349,9 +13350,10 @@ def split_lex(lex): del result_pool xlsx_url = SwadeshAnalysis.export_xlsx(result, base_language_name, storage) - result_tables = (build_table(result['Distances'], 'orange_light', width="300px", index=True), - build_table(result['Cognates'], 'blue_light', width="300px"), - build_table(result['Singles'], 'green_light', width="300px")) + result_tables = ( + build_table(result['Distances'], 'orange_light', width="300px", index=True), + build_table(result['Cognates'], 'blue_light', width="300px").replace("\\n","
"), + build_table(result['Singles'], 'green_light', width="300px")) # Control output size huge_size = 1048576 diff --git a/server-requirements-1.txt b/server-requirements-1.txt index 0441a615..f57e0ada 100644 --- a/server-requirements-1.txt +++ b/server-requirements-1.txt @@ -48,9 +48,11 @@ numpy==1.22.0 odfpy==1.4.0 openpyxl==2.6.4 packaging==20.3 +pandas==1.4.3 passlib==1.6.5 PasteDeploy==2.0.1 pathvalidate==0.8.3 +pretty_html_table==0.9.16 promise==2.1 psycopg2==2.8.6 pycparser==2.16 diff --git a/server-requirements-final.txt b/server-requirements-final.txt index 1a41656e..460af8a7 100644 --- a/server-requirements-final.txt +++ b/server-requirements-final.txt @@ -1,4 +1 @@ matplotlib==1.5.3 -pandas==1.4.3 -pretty_html_table -xlsxwriter