|
1 | 1 | import re |
2 | 2 | import sys |
3 | 3 | import hashlib |
4 | | -import pandas as pd |
| 4 | +import logging |
| 5 | +import pandas as pd # type: ignore[reportMissingImports] |
5 | 6 |
|
6 | 7 | from pathlib import Path |
7 | 8 | from .helpers.coordinates import get_row_coordinates_with_collision_offset |
| 9 | +from .helpers.text_content_validation import has_meaningful_value |
8 | 10 | from .constants.constants import COLUMNS |
9 | 11 |
|
| 12 | +logger = logging.getLogger(__name__) |
| 13 | + |
10 | 14 | PATH_TO_FOLDER_IN_CONTAINER = "common/common/aquanavi/" |
11 | 15 | CSV_PATH_WITH_REAL_DATA = f"{PATH_TO_FOLDER_IN_CONTAINER}mesocosm_data_cleaned.csv" |
12 | 16 | CSV_PATH_WITH_TEST_DATA = f"{PATH_TO_FOLDER_IN_CONTAINER}mesocosm_test_data.csv" |
@@ -182,28 +186,28 @@ def get_not_available_message_and_increase_counter(name): |
182 | 186 | count_of_not_available_parts += 1 |
183 | 187 | return f"{name}: description not available" |
184 | 188 |
|
185 | | - if (row[COLUMNS['description']]): |
| 189 | + if has_meaningful_value(row, COLUMNS['description']): |
186 | 190 | abstract_parts.append(f"Facility description: {get_and_process_value(row, COLUMNS['description'], True, JOIN_PARTS_WITH['description'])}") |
187 | 191 | else: |
188 | 192 | abstract_parts.append(get_not_available_message_and_increase_counter("Facility description")) |
189 | 193 |
|
190 | | - if (row[COLUMNS['equipment']]): |
| 194 | + if has_meaningful_value(row, COLUMNS['equipment']): |
191 | 195 | abstract_parts.append(f"Equipment: {get_and_process_value(row, COLUMNS['equipment'], True, JOIN_PARTS_WITH['equipment'])}") |
192 | 196 | else: |
193 | 197 | abstract_parts.append(get_not_available_message_and_increase_counter('Equipment')) |
194 | 198 |
|
195 | | - if (row[COLUMNS['controlled_parameters']]): |
| 199 | + if has_meaningful_value(row, COLUMNS['controlled_parameters']): |
196 | 200 | abstract_parts.append(f"Controlled parameters: {get_and_process_value(row, COLUMNS['controlled_parameters'], True, JOIN_PARTS_WITH['controlled_parameters'])}") |
197 | 201 | else: |
198 | 202 | abstract_parts.append(get_not_available_message_and_increase_counter('Controlled Parameters')) |
199 | 203 |
|
200 | | - if (row[COLUMNS['grand_challenges']]): |
201 | | - abstract_parts.append(f"Grand challenges: {get_and_process_value(row, COLUMNS['grand_challenges'], True, JOIN_PARTS_WITH['grand_challenges'])}") |
| 204 | + if has_meaningful_value(row, COLUMNS['grand_challenges']): |
| 205 | + abstract_parts.append(f"Grand challenges: {get_and_process_value(row, COLUMNS['grand_challenges'], True, JOIN_PARTS_WITH['grand_challenges'])}") |
202 | 206 | else: |
203 | 207 | abstract_parts.append(get_not_available_message_and_increase_counter('Grand challenges')) |
204 | 208 |
|
205 | | - if (row[COLUMNS['research_topics']]): |
206 | | - abstract_parts.append(f"Research topics: {get_and_process_value(row, COLUMNS['research_topics'], True, JOIN_PARTS_WITH['research_topics'])}") |
| 209 | + if has_meaningful_value(row, COLUMNS['research_topics']): |
| 210 | + abstract_parts.append(f"Research topics: {get_and_process_value(row, COLUMNS['research_topics'], True, JOIN_PARTS_WITH['research_topics'])}") |
207 | 211 | else: |
208 | 212 | abstract_parts.append(get_not_available_message_and_increase_counter('Research topics')) |
209 | 213 |
|
|
0 commit comments