From b60e4856912afbe648ea0b9ff094f9a0011d7005 Mon Sep 17 00:00:00 2001 From: guanjihuan Date: Fri, 15 Aug 2025 15:40:19 +0800 Subject: [PATCH] 0.1.186 --- PyPI/setup.cfg | 2 +- PyPI/src/guan.egg-info/PKG-INFO | 2 +- PyPI/src/guan/data_processing.py | 19 +++++++++---------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/PyPI/setup.cfg b/PyPI/setup.cfg index fc2ab9a..5b9d938 100644 --- a/PyPI/setup.cfg +++ b/PyPI/setup.cfg @@ -1,7 +1,7 @@ [metadata] # replace with your username: name = guan -version = 0.1.185 +version = 0.1.186 author = guanjihuan author_email = guanjihuan@163.com description = An open source python package diff --git a/PyPI/src/guan.egg-info/PKG-INFO b/PyPI/src/guan.egg-info/PKG-INFO index 5a0a7eb..e3b1a00 100644 --- a/PyPI/src/guan.egg-info/PKG-INFO +++ b/PyPI/src/guan.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: guan -Version: 0.1.185 +Version: 0.1.186 Summary: An open source python package Home-page: https://py.guanjihuan.com Author: guanjihuan diff --git a/PyPI/src/guan/data_processing.py b/PyPI/src/guan/data_processing.py index 07cffef..771ad05 100644 --- a/PyPI/src/guan/data_processing.py +++ b/PyPI/src/guan/data_processing.py @@ -29,16 +29,15 @@ def try_except(function_name, *args, **kwargs): # 使用 multiprocessing.Pool 实现自动分配任务并行 def parallel_calculation_with_multiprocessing_Pool(func, args_list=[1, 2, 3], show_time=0): - if __name__ == '__main__': - import multiprocessing - import time - start_time = time.time() - with multiprocessing.Pool() as pool: - result_array = pool.map(func, args_list) - end_time = time.time() - if show_time: - print(end_time - start_time) - return result_array + import multiprocessing + import time + start_time = time.time() + with multiprocessing.Pool() as pool: + result_array = pool.map(func, args_list) + end_time = time.time() + if show_time: + print(end_time - start_time) + return result_array # 循环一个参数计算某个函数,并返回计算结果的数组 def loop_calculation_with_one_parameter(function_name, parameter_array):