diff --git a/source/dataset_preanalysis.py b/source/dataset_preanalysis.py index eacb48f0b0b4f8e5fa3b97f84a710276ba01be2d..0af621e83ab8d77b5e1aca0ae541e7a17bf443be 100644 --- a/source/dataset_preanalysis.py +++ b/source/dataset_preanalysis.py @@ -3,7 +3,7 @@ Class and routine for AQbench preanalysis and visualization. """ # general -import logging +# import logging # import pdb # data science @@ -88,7 +88,7 @@ class PreVis: elif this_res['data_type'] == 'str': fill = str(this_res['fill_value']) else: - logging.warning('Forgotten datatypes?') + pass # logging.warning('Forgotten datatypes?') av = round(len(this_data[this_data != fill]) / compl * 100) mis = 100 - av this_data = this_data[this_data != fill] @@ -189,7 +189,7 @@ class PreVis: self.plot_dir+column_name.replace('.', 'p')+'_'+plot_naming, dpi=175 ) - logging.info(column_name + ' plot saved') + # logging.info(column_name + ' plot saved') class PreMis: @@ -287,7 +287,7 @@ def main_previs(): previs.vis(col) plt.close() except Exception as exc: - logging.warning(col + ' no plot produced') + # logging.warning(col + ' no plot produced') print(exc) @@ -319,12 +319,12 @@ if __name__ == '__main__': """ # logging - log_file = __file__.replace('py', 'log') + # log_file = __file__.replace('py', 'log') - logging.basicConfig( - level=logging.INFO, - format="%(asctime)s [%(levelname)s] %(message)s", - handlers=[logging.FileHandler(log_dir+log_file), - logging.StreamHandler()]) + # logging.basicConfig( + # level=logging.INFO, + # format="%(asctime)s [%(levelname)s] %(message)s", + # handlers=[logging.FileHandler(log_dir+log_file), + # logging.StreamHandler()]) main_previs() main_premis() diff --git a/source/mapping_data.py b/source/mapping_data.py index 1c2afaee604d1e2f1d18ea6abb6b64ea5f817e9f..8de75c86a208ab2ee1aded9a6e31e58dc76a279b 100644 --- a/source/mapping_data.py +++ b/source/mapping_data.py @@ -3,7 +3,7 @@ import pandas as pd from sklearn import preprocessing import math -import logging +# import logging from settings import * from dataset_datasplit import DataSplit @@ -73,7 +73,7 @@ class Data: # Logging - logging.info(f'{self.data_yx.shape[0]} rows were read in.') + # logging.info(f'{self.data_yx.shape[0]} rows were read in.') def delete_rows(self): """ @@ -93,7 +93,7 @@ class Data: # Logging - logging.info(f'{self.data_yx.shape[0]} rows are remaining after deleting invalid ones.') + # logging.info(f'{self.data_yx.shape[0]} rows are remaining after deleting invalid ones.') def transform(self): """ @@ -126,7 +126,7 @@ class Data: elif column_name != self.target: print(f"!!! Warning !!! Preparation could not be found: {row['column_name']}") - logging.warning(f"!!! Warning !!! Preparation could not be found: {row['column_name']}") + # logging.warning(f"!!! Warning !!! Preparation could not be found: {row['column_name']}") def list_inputs(self): """ @@ -210,11 +210,11 @@ class Data: """ Set up logging """ -log_file = __file__.replace('py', 'log').split("/")[-1] -logging.basicConfig( - level=logging.DEBUG, - format="%(asctime)s [%(levelname)s] %(message)s", - filename=log_dir+log_file +# log_file = __file__.replace('py', 'log').split("/")[-1] +# logging.basicConfig( +# level=logging.DEBUG, +# format="%(asctime)s [%(levelname)s] %(message)s", +# filename=log_dir+log_file ) if __name__ == '__main__': diff --git a/source/utils.py b/source/utils.py index 2879da775760afaab91d227f6761687af5d1660c..9433fcbc58d03e2c40c1979920baa1c3825e97f7 100644 --- a/source/utils.py +++ b/source/utils.py @@ -5,7 +5,7 @@ Helper functions for our project """ # general -import logging +# import logging import pdb # data science @@ -28,7 +28,7 @@ def read_csv_to_df(filename, converters=None): df = pd.read_csv(filename, converters=converters) return df except Exception as exc: - logging.error(f'Error reading csv file {filename}') + # logging.error(f'Error reading csv file {filename}') print(exc) exit() @@ -41,7 +41,7 @@ def read_pkl_to_df(filename): df = pd.read_pickle(filename) return df except Exception as exc: - logging.error(f'Error reading pickle {filename}') + # logging.error(f'Error reading pickle {filename}') print(exc) @@ -52,13 +52,13 @@ def save_data_to_file(df, filename): try: if filename.endswith('pkl'): df.to_pickle(filename) - logging.info(f'Data saved to pickle {filename}') + # logging.info(f'Data saved to pickle {filename}') elif filename.endswith('csv'): df.to_csv(filename, index=False) - logging.info(f'Data saved to csv {filename}') + # logging.info(f'Data saved to csv {filename}') except Exception as exc: - logging.warning(f'Could not write file {filename}') + # logging.warning(f'Could not write file {filename}') print(exc)