From af33efcfff5822b03e6b5c9cb6cdedba86053f71 Mon Sep 17 00:00:00 2001 From: Sherman Siu Date: Sat, 27 Apr 2024 05:21:51 -0400 Subject: [PATCH 1/3] Add type hints to initialize function. --- pandarallel/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandarallel/core.py b/pandarallel/core.py index c54ec14..96a72bb 100644 --- a/pandarallel/core.py +++ b/pandarallel/core.py @@ -454,8 +454,8 @@ def initialize( cls, shm_size_mb=None, nb_workers=NB_PHYSICAL_CORES, - progress_bar=False, - verbose=2, + progress_bar: bool = False, + verbose: int = 2, use_memory_fs: Optional[bool] = None, ) -> None: show_progress_bars = progress_bar From 4784c26f0cfb0a9cfca2cdd5b9e095f4626b723e Mon Sep 17 00:00:00 2001 From: Sherman Siu Date: Sat, 27 Apr 2024 05:22:06 -0400 Subject: [PATCH 2/3] Remove unused variable. --- pandarallel/core.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pandarallel/core.py b/pandarallel/core.py index 96a72bb..838aaeb 100644 --- a/pandarallel/core.py +++ b/pandarallel/core.py @@ -452,7 +452,6 @@ class pandarallel: @classmethod def initialize( cls, - shm_size_mb=None, nb_workers=NB_PHYSICAL_CORES, progress_bar: bool = False, verbose: int = 2, From dcb05d8dd623ba123da80deb9c194fb9641a2833 Mon Sep 17 00:00:00 2001 From: Sherman Siu Date: Sat, 27 Apr 2024 05:49:33 -0400 Subject: [PATCH 3/3] Add deprecation warning. --- pandarallel/core.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pandarallel/core.py b/pandarallel/core.py index 838aaeb..7e6acd4 100644 --- a/pandarallel/core.py +++ b/pandarallel/core.py @@ -6,6 +6,7 @@ from pathlib import Path from tempfile import NamedTemporaryFile from typing import Any, Callable, Dict, Iterator, Optional, Tuple, Type, cast +import warnings import dill import pandas as pd @@ -452,11 +453,15 @@ class pandarallel: @classmethod def initialize( cls, + shm_size_mb=None, nb_workers=NB_PHYSICAL_CORES, progress_bar: bool = False, verbose: int = 2, use_memory_fs: Optional[bool] = None, ) -> None: + if shm_size_mb is not None: + warnings.warn("shm_size_mb not used by Pandarallel and will be removed in a future release.", warnings.DeprecationWarning) + show_progress_bars = progress_bar is_memory_fs_available = Path(MEMORY_FS_ROOT).exists()