diff --git a/GANDLF/entrypoints/cli_tool.py b/GANDLF/entrypoints/cli_tool.py index 7a61e58eb..c1a5122ae 100644 --- a/GANDLF/entrypoints/cli_tool.py +++ b/GANDLF/entrypoints/cli_tool.py @@ -3,7 +3,7 @@ import click from .subcommands import cli_subcommands from GANDLF.entrypoints import append_copyright_to_help -from GANDLF.utils import gandlf_logger_setup +from GANDLF.utils import logger_setup from GANDLF import version diff --git a/GANDLF/entrypoints/collect_stats.py b/GANDLF/entrypoints/collect_stats.py index 81da499b9..a418686a1 100644 --- a/GANDLF/entrypoints/collect_stats.py +++ b/GANDLF/entrypoints/collect_stats.py @@ -14,7 +14,7 @@ from GANDLF.cli import copyrightMessage from GANDLF.entrypoints import append_copyright_to_help -from GANDLF.utils import gandlf_logger_setup +from GANDLF.utils import logger_setup def plot_all(df_training, df_validation, df_testing, output_plot_dir): @@ -206,7 +206,7 @@ def new_way(model_dir: str, output_dir: str): + "`gandlf_collectStats` script would be deprecated soon." ) def old_way(): - gandlf_logger_setup() + logger_setup() parser = argparse.ArgumentParser( prog="GANDLF_CollectStats", formatter_class=argparse.RawTextHelpFormatter, diff --git a/GANDLF/entrypoints/config_generator.py b/GANDLF/entrypoints/config_generator.py index 7be011790..7b0031336 100644 --- a/GANDLF/entrypoints/config_generator.py +++ b/GANDLF/entrypoints/config_generator.py @@ -4,7 +4,7 @@ from GANDLF.cli import config_generator, copyrightMessage from GANDLF.entrypoints import append_copyright_to_help -from GANDLF.utils.gandlf_logger import gandlf_logger_setup +from GANDLF.utils.logging import logger_setup def _generate_config(config: str, strategy: str, output: str): @@ -47,7 +47,7 @@ def new_way(config, strategy, output): + "`gandlf_configGenerator` script would be deprecated soon." ) def old_way(): - gandlf_logger_setup() + logger_setup() parser = argparse.ArgumentParser( prog="GANDLF_ConfigGenerator", formatter_class=argparse.RawTextHelpFormatter, diff --git a/GANDLF/entrypoints/construct_csv.py b/GANDLF/entrypoints/construct_csv.py index 342825180..3e7514dcf 100644 --- a/GANDLF/entrypoints/construct_csv.py +++ b/GANDLF/entrypoints/construct_csv.py @@ -14,7 +14,7 @@ from GANDLF.utils import writeTrainingCSV from GANDLF.cli import copyrightMessage -from GANDLF.utils.gandlf_logger import gandlf_logger_setup +from GANDLF.utils.logging import logger_setup def _construct_csv( @@ -120,7 +120,7 @@ def new_way( + "`gandlf_constructCSV` script would be deprecated soon." ) def old_way(): - gandlf_logger_setup() + logger_setup() parser = argparse.ArgumentParser( prog="GANDLF_ConstructCSV", formatter_class=argparse.RawTextHelpFormatter, diff --git a/GANDLF/entrypoints/debug_info.py b/GANDLF/entrypoints/debug_info.py index e5f2d8a25..a179513a1 100644 --- a/GANDLF/entrypoints/debug_info.py +++ b/GANDLF/entrypoints/debug_info.py @@ -7,7 +7,7 @@ from GANDLF import __version__ from GANDLF.entrypoints import append_copyright_to_help from GANDLF.utils import get_git_hash -from GANDLF.utils import gandlf_logger_setup +from GANDLF.utils import logger_setup def _debug_info(): @@ -39,7 +39,7 @@ def new_way(): ) def old_way(): _debug_info() - gandlf_logger_setup() + logger_setup() if __name__ == "__main__": diff --git a/GANDLF/entrypoints/deploy.py b/GANDLF/entrypoints/deploy.py index dba542ee1..fdab44db4 100644 --- a/GANDLF/entrypoints/deploy.py +++ b/GANDLF/entrypoints/deploy.py @@ -16,7 +16,7 @@ copyrightMessage, ) from GANDLF.entrypoints import append_copyright_to_help -from GANDLF.utils.gandlf_logger import gandlf_logger_setup +from GANDLF.utils.logging import logger_setup def _deploy( @@ -158,7 +158,7 @@ def new_way( + "`gandlf_deploy` script would be deprecated soon." ) def old_way(): - gandlf_logger_setup() + logger_setup() parser = argparse.ArgumentParser( prog="GANDLF_Deploy", formatter_class=argparse.RawTextHelpFormatter, diff --git a/GANDLF/entrypoints/generate_metrics.py b/GANDLF/entrypoints/generate_metrics.py index d863ed44a..4cedea5ca 100644 --- a/GANDLF/entrypoints/generate_metrics.py +++ b/GANDLF/entrypoints/generate_metrics.py @@ -10,7 +10,7 @@ from GANDLF.cli import copyrightMessage from GANDLF.cli.generate_metrics import generate_metrics_dict from GANDLF.entrypoints import append_copyright_to_help -from GANDLF.utils.gandlf_logger import gandlf_logger_setup +from GANDLF.utils.logging import logger_setup def _generate_metrics( @@ -82,7 +82,7 @@ def new_way( + "`gandlf_generateMetrics` script would be deprecated soon." ) def old_way(): - gandlf_logger_setup() + logger_setup() parser = argparse.ArgumentParser( prog="GANDLF_Metrics", formatter_class=argparse.RawTextHelpFormatter, diff --git a/GANDLF/entrypoints/optimize_model.py b/GANDLF/entrypoints/optimize_model.py index 4afbbc398..8a21ec0cc 100644 --- a/GANDLF/entrypoints/optimize_model.py +++ b/GANDLF/entrypoints/optimize_model.py @@ -9,7 +9,7 @@ from GANDLF.cli import copyrightMessage, post_training_model_optimization from GANDLF.entrypoints import append_copyright_to_help -from GANDLF.utils.gandlf_logger import gandlf_logger_setup +from GANDLF.utils.logging import logger_setup def _optimize_model( @@ -61,7 +61,7 @@ def new_way( + "`gandlf_optimizeModel` script would be deprecated soon." ) def old_way(): - gandlf_logger_setup() + logger_setup() parser = argparse.ArgumentParser( prog="GANDLF_OptimizeModel", formatter_class=argparse.RawTextHelpFormatter, diff --git a/GANDLF/entrypoints/patch_miner.py b/GANDLF/entrypoints/patch_miner.py index 44e7f4239..dd0f060eb 100644 --- a/GANDLF/entrypoints/patch_miner.py +++ b/GANDLF/entrypoints/patch_miner.py @@ -10,7 +10,7 @@ from GANDLF.cli.patch_extraction import patch_extraction from GANDLF.cli import copyrightMessage from GANDLF.entrypoints import append_copyright_to_help -from GANDLF.utils.gandlf_logger import gandlf_logger_setup +from GANDLF.utils.logging import logger_setup def _mine_patches(input_path: str, output_dir: str, config: Optional[str]): @@ -56,7 +56,7 @@ def new_way(input_csv: str, output_dir: str, config: Optional[str]): + "`gandlf_patchMiner` script would be deprecated soon." ) def old_way(): - gandlf_logger_setup() + logger_setup() parser = argparse.ArgumentParser( prog="GANDLF_PatchMiner", formatter_class=argparse.RawTextHelpFormatter, diff --git a/GANDLF/entrypoints/preprocess.py b/GANDLF/entrypoints/preprocess.py index eccb00fb4..1cc19d7f6 100644 --- a/GANDLF/entrypoints/preprocess.py +++ b/GANDLF/entrypoints/preprocess.py @@ -8,7 +8,7 @@ from deprecated import deprecated from GANDLF.cli import preprocess_and_save, copyrightMessage from GANDLF.entrypoints import append_copyright_to_help -from GANDLF.utils.gandlf_logger import gandlf_logger_setup +from GANDLF.utils.logging import logger_setup def _preprocess( @@ -111,7 +111,7 @@ def new_way( + "`gandlf_preprocess` script would be deprecated soon." ) def old_way(): - gandlf_logger_setup() + logger_setup() parser = argparse.ArgumentParser( prog="GANDLF_Preprocess", formatter_class=argparse.RawTextHelpFormatter, diff --git a/GANDLF/entrypoints/recover_config.py b/GANDLF/entrypoints/recover_config.py index 36bed0070..db9922c16 100644 --- a/GANDLF/entrypoints/recover_config.py +++ b/GANDLF/entrypoints/recover_config.py @@ -9,7 +9,7 @@ from GANDLF.cli import copyrightMessage, recover_config from GANDLF.entrypoints import append_copyright_to_help -from GANDLF.utils.gandlf_logger import gandlf_logger_setup +from GANDLF.utils.logging import logger_setup def _recover_config(model_dir: Optional[str], mlcube: bool, output_file: str): @@ -64,7 +64,7 @@ def new_way(model_dir, mlcube, output_file): + "`gandlf_recoverConfig` script would be deprecated soon." ) def old_way(): - gandlf_logger_setup() + logger_setup() parser = argparse.ArgumentParser( prog="GANDLF_RecoverConfig", formatter_class=argparse.RawTextHelpFormatter, diff --git a/GANDLF/entrypoints/run.py b/GANDLF/entrypoints/run.py index 5c11a7091..3577cd5d3 100644 --- a/GANDLF/entrypoints/run.py +++ b/GANDLF/entrypoints/run.py @@ -14,7 +14,7 @@ from GANDLF import version from GANDLF.cli import main_run, copyrightMessage from GANDLF.entrypoints import append_copyright_to_help -from GANDLF.utils.gandlf_logger import gandlf_logger_setup +from GANDLF.utils.logging import logger_setup def _run( @@ -185,7 +185,7 @@ def new_way( + "`gandlf_run` script would be deprecated soon." ) def old_way(): - gandlf_logger_setup() + logger_setup() parser = argparse.ArgumentParser( prog="GANDLF", formatter_class=argparse.RawTextHelpFormatter, diff --git a/GANDLF/entrypoints/split_csv.py b/GANDLF/entrypoints/split_csv.py index eecda7c6c..5c6f1e29f 100644 --- a/GANDLF/entrypoints/split_csv.py +++ b/GANDLF/entrypoints/split_csv.py @@ -12,7 +12,7 @@ from GANDLF.cli import copyrightMessage, split_data_and_save_csvs from GANDLF.entrypoints import append_copyright_to_help -from GANDLF.utils.gandlf_logger import gandlf_logger_setup +from GANDLF.utils.logging import logger_setup def _split_csv(input_csv: str, output_dir: str, config_path: Optional[str]): @@ -65,7 +65,7 @@ def new_way(input_csv: str, output_dir: str, config: Optional[str]): + "`gandlf_splitCSV` script would be deprecated soon." ) def old_way(): - gandlf_logger_setup() + logger_setup() parser = argparse.ArgumentParser( prog="GANDLF_SplitCSV", formatter_class=argparse.RawTextHelpFormatter, diff --git a/GANDLF/entrypoints/verify_install.py b/GANDLF/entrypoints/verify_install.py index 549ad2ad8..c65da205c 100644 --- a/GANDLF/entrypoints/verify_install.py +++ b/GANDLF/entrypoints/verify_install.py @@ -6,7 +6,7 @@ from deprecated import deprecated from GANDLF.entrypoints import append_copyright_to_help -from GANDLF.utils.gandlf_logger import gandlf_logger_setup +from GANDLF.utils.logging import logger_setup def _verify_install(): @@ -43,7 +43,7 @@ def new_way(): + "`gandlf_verifyInstall` script would be deprecated soon." ) def old_way(): - gandlf_logger_setup() + logger_setup() argparse.ArgumentParser( prog="GANDLF_VerifyInstall", formatter_class=argparse.RawTextHelpFormatter, diff --git a/GANDLF/utils/__init__.py b/GANDLF/utils/__init__.py index 2466b1435..6b105e490 100644 --- a/GANDLF/utils/__init__.py +++ b/GANDLF/utils/__init__.py @@ -68,4 +68,4 @@ ) from .data_splitter import split_data -from .gandlf_logger import gandlf_logger_setup, InfoOnlyFilter +from .logging import logger_setup, InfoOnlyFilter diff --git a/GANDLF/utils/gandlf_logger.py b/GANDLF/utils/logging.py similarity index 95% rename from GANDLF/utils/gandlf_logger.py rename to GANDLF/utils/logging.py index b7370b365..5360e64bf 100644 --- a/GANDLF/utils/gandlf_logger.py +++ b/GANDLF/utils/logging.py @@ -26,7 +26,7 @@ def _save_logs_in_file(log_file, config_path): logging.config.dictConfig(config_dict) -def gandlf_logger_setup(log_file=None, config_path="logging_config.yaml") -> None: +def logger_setup(log_file=None, config_path="logging_config.yaml") -> None: """ It sets up the logger. Reads from logging_config.