From 282a066bb511504d33dc9abe02b7a630f569f969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Schmelczer?= Date: Sun, 10 Apr 2022 14:48:07 +0200 Subject: [PATCH] Refactor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: András Schmelczer --- example/main_batch.py | 0 good_ai/src/good_ai/good_ai/context/get_context.py | 4 ++-- good_ai/src/good_ai/good_ai/deploy/process_batch.py | 2 +- good_ai/src/good_ai/open_s3/__main__.py | 2 +- good_ai/src/good_ai/open_s3/large_file.py | 2 +- good_ai/src/good_ai/utilities/parallel_map.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) mode change 100644 => 100755 example/main_batch.py diff --git a/example/main_batch.py b/example/main_batch.py old mode 100644 new mode 100755 diff --git a/good_ai/src/good_ai/good_ai/context/get_context.py b/good_ai/src/good_ai/good_ai/context/get_context.py index 45ea651..e6185b9 100644 --- a/good_ai/src/good_ai/good_ai/context/get_context.py +++ b/good_ai/src/good_ai/good_ai/context/get_context.py @@ -41,7 +41,7 @@ def set_default_config( _set_seed(seed) if not persistence_driver.is_threadsafe: - logger.warn( + logger.warning( f"The selected persistence driver ({type(persistence_driver).__name__}) is not threadsafe" ) _context = Context( @@ -61,7 +61,7 @@ def _is_in_production_mode(override: Optional[bool], logger: Logger) -> bool: if is_production: logger.info("Running in production mode ✅") else: - logger.warn("Running in development mode ‼️") + logger.warning("Running in development mode ‼️") return is_production diff --git a/good_ai/src/good_ai/good_ai/deploy/process_batch.py b/good_ai/src/good_ai/good_ai/deploy/process_batch.py index 79076f6..2ef2330 100644 --- a/good_ai/src/good_ai/good_ai/deploy/process_batch.py +++ b/good_ai/src/good_ai/good_ai/deploy/process_batch.py @@ -20,6 +20,6 @@ def process_batch( if not get_context().persistence.is_threadsafe: concurrency = 1 - get_context().logger.warn("Concurrency is ignored") + get_context().logger.warning("Concurrency is ignored") return parallel_map(inner, batch, concurrency=concurrency) diff --git a/good_ai/src/good_ai/open_s3/__main__.py b/good_ai/src/good_ai/open_s3/__main__.py index fd3f7b9..2caacb9 100644 --- a/good_ai/src/good_ai/open_s3/__main__.py +++ b/good_ai/src/good_ai/open_s3/__main__.py @@ -14,7 +14,7 @@ if __name__ == "__main__": LargeFile.configure_credentials_from_file(args.secrets) if not args.cache and not args.push and not args.delete: - logger.warn("No action required.") + logger.warning("No action required.") parser.print_help() try: if args.cache: diff --git a/good_ai/src/good_ai/open_s3/large_file.py b/good_ai/src/good_ai/open_s3/large_file.py index 1713c87..ce5385c 100644 --- a/good_ai/src/good_ai/open_s3/large_file.py +++ b/good_ai/src/good_ai/open_s3/large_file.py @@ -317,7 +317,7 @@ class LargeFile: if self._version is None: self._version = self.version_ids[-1] - logger.info(f"Lastest version of {self._local_name} is {self._version}") + logger.info(f"Latest version of {self._name} is {self._version}") elif self._version not in self.version_ids: raise FileNotFoundError( diff --git a/good_ai/src/good_ai/utilities/parallel_map.py b/good_ai/src/good_ai/utilities/parallel_map.py index 2a58e29..7df2a74 100644 --- a/good_ai/src/good_ai/utilities/parallel_map.py +++ b/good_ai/src/good_ai/utilities/parallel_map.py @@ -32,7 +32,7 @@ def parallel_map( ) if concurrency == 1 or len(values) <= chunk_size: - logger.warn(f"Running in series, there is no reason for parallelism") + logger.warning(f"Running in series, there is no reason for parallelism") iterable = values if disable_progress else tqdm(values) return [function(v) for v in iterable]