|
14 | 14 | # import cchardet # TODO: may be useful in future |
15 | 15 |
|
16 | 16 | from ddcuimap.utils import helper |
17 | | -from ddcuimap.utils.decorators import log |
18 | | -from ddcuimap.curation import logger |
| 17 | +from ddcuimap.curation import cur_logger, log, copy_log |
19 | 18 |
|
20 | 19 |
|
21 | 20 | # TEXT PROCESSING FUNCTIONS |
@@ -74,10 +73,10 @@ def remove_stopwords_cols(df, columns, preprocessing_settings): |
74 | 73 | cols_query_terms = [] |
75 | 74 | if preprocessing_settings.remove_stopwords: |
76 | 75 | if preprocessing_settings.stopwords_filepath: |
77 | | - logger.warning("Loading stopwords file from configs") |
| 76 | + cur_logger.warning("Loading stopwords file from configs") |
78 | 77 | fp_stopwords = preprocessing_settings.stopwords_filepath |
79 | 78 | else: |
80 | | - logger.warning("Opening dialog box to choose stopwords file") |
| 79 | + cur_logger.warning("Opening dialog box to choose stopwords file") |
81 | 80 | fp_stopwords = helper.choose_file("Select Stopwords csv file") |
82 | 81 | df_stopwords = pd.read_csv(fp_stopwords) |
83 | 82 | ls_stopwords = list( |
@@ -106,18 +105,18 @@ def remove_vars_cheatsheet(df, preprocessing_settings): # TODO: not yet impleme |
106 | 105 |
|
107 | 106 | if preprocessing_settings.use_cheatsheet: |
108 | 107 | if preprocessing_settings.cheatsheet_filepath: |
109 | | - logger.warning("Loading cheatsheet file from configs") |
| 108 | + cur_logger.warning("Loading cheatsheet file from configs") |
110 | 109 | fp_cheatsheet = preprocessing_settings.cheatsheet_filepath |
111 | 110 | else: |
112 | | - logger.warning("Opening dialog box to choose cheatsheet file") |
| 111 | + cur_logger.warning("Opening dialog box to choose cheatsheet file") |
113 | 112 | fp_cheatsheet = helper.choose_file(title="Select Cheatsheet csv file") |
114 | 113 | df_cheatsheet = pd.read_csv(fp_cheatsheet) |
115 | 114 | curated_vars = df_cheatsheet[ |
116 | 115 | "variable name" |
117 | 116 | ] # TODO: need to add consistent formatting for use of a cheatsheet |
118 | 117 | df = df[~df["variable name"].isin(curated_vars)] |
119 | 118 | else: |
120 | | - logger.warning("Cheatsheet not used") |
| 119 | + cur_logger.warning("Cheatsheet not used") |
121 | 120 | pass |
122 | 121 | return df |
123 | 122 |
|
|
0 commit comments