stouputils 1.19.5__tar.gz → 1.20.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {stouputils-1.19.5 → stouputils-1.20.0}/PKG-INFO +2 -1
- {stouputils-1.19.5 → stouputils-1.20.0}/pyproject.toml +2 -1
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/multi.py +24 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/multi.pyi +12 -1
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/subprocess.py +11 -2
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/subprocess.pyi +4 -2
- {stouputils-1.19.5 → stouputils-1.20.0}/README.md +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/__init__.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/__init__.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/__main__.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/_deprecated.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/_deprecated.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/all_doctests.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/all_doctests.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/__init__.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/__init__.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/automatic_docs.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/automatic_docs.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/upscaler/__init__.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/upscaler/__init__.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/upscaler/config.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/upscaler/config.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/upscaler/image.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/upscaler/image.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/upscaler/video.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/upscaler/video.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/archive.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/archive.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/backup.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/backup.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/collections.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/collections.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/__init__.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/__init__.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/cd_utils.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/cd_utils.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/github.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/github.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/pypi.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/pypi.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/pyproject.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/pyproject.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/stubs.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/stubs.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/ctx.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/ctx.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/config/get.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/config/set.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/__init__.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/auto_contrast.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/axis_flip.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/bias_field_correction.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/binary_threshold.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/blur.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/brightness.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/canny.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/clahe.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/common.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/contrast.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/curvature_flow_filter.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/denoise.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/histogram_equalization.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/invert.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/laplacian.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/median_blur.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/noise.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/normalize.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/random_erase.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/resize.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/rotation.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/salt_pepper.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/sharpening.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/shearing.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/threshold.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/translation.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/zoom.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image_augmentation.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image_preprocess.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/prosthesis_detection.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/technique.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/dataset/__init__.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/dataset/dataset.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/dataset/dataset_loader.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/dataset/grouping_strategy.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/dataset/image_loader.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/dataset/xy_tuple.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/metric_dictionnary.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/metric_utils.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/mlflow_utils.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/abstract_model.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/all.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/base_keras.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/all.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/convnext.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/densenet.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/efficientnet.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/mobilenet.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/resnet.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/squeezenet.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/vgg.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/xception.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/callbacks/__init__.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/callbacks/colored_progress_bar.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/callbacks/learning_rate_finder.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/callbacks/model_checkpoint_v2.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/callbacks/progressive_unfreezing.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/callbacks/warmup_scheduler.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/losses/__init__.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/losses/next_generation_loss.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/visualizations.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/model_interface.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/sandbox.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/range_tuple.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/scripts/augment_dataset.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/scripts/exhaustive_process.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/scripts/preprocess_dataset.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/scripts/routine.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/utils.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/decorators.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/decorators.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/image.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/image.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/__init__.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/__init__.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/common.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/common.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/downloader.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/downloader.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/linux.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/linux.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/main.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/main.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/windows.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/windows.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/io.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/io.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/__init__.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/__init__.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/base.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/base.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/queue.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/queue.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/re_entrant.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/re_entrant.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/redis_fifo.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/redis_fifo.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/shared.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/shared.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/__init__.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/__init__.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/capturer.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/capturer.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/common.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/common.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/print.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/print.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/py.typed +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/typing.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/typing.pyi +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/version_pkg.py +0 -0
- {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/version_pkg.pyi +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: stouputils
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.20.0
|
|
4
4
|
Summary: Stouputils is a collection of utility modules designed to simplify and enhance the development process. It includes a range of tools for tasks such as execution of doctests, display utilities, decorators, as well as context managers, and many more.
|
|
5
5
|
Keywords: utilities,tools,helpers,development,python
|
|
6
6
|
Author: Stoupy51
|
|
@@ -17,6 +17,7 @@ Requires-Dist: msgspec[toml,yaml]>=0.20.0
|
|
|
17
17
|
Requires-Dist: pillow>=12.0.0
|
|
18
18
|
Requires-Dist: python-box>=7.0.0
|
|
19
19
|
Requires-Dist: argcomplete>=3.0.0
|
|
20
|
+
Requires-Dist: setproctitle
|
|
20
21
|
Requires-Dist: numpy
|
|
21
22
|
Requires-Dist: opencv-python ; extra == 'data-science'
|
|
22
23
|
Requires-Dist: scikit-image ; extra == 'data-science'
|
|
@@ -8,7 +8,7 @@ module-root = ""
|
|
|
8
8
|
|
|
9
9
|
[project]
|
|
10
10
|
name = "stouputils"
|
|
11
|
-
version = "1.
|
|
11
|
+
version = "1.20.0"
|
|
12
12
|
description = "Stouputils is a collection of utility modules designed to simplify and enhance the development process. It includes a range of tools for tasks such as execution of doctests, display utilities, decorators, as well as context managers, and many more."
|
|
13
13
|
readme = "README.md"
|
|
14
14
|
keywords = ["utilities", "tools", "helpers", "development", "python"]
|
|
@@ -28,6 +28,7 @@ dependencies = [
|
|
|
28
28
|
"pillow>=12.0.0",
|
|
29
29
|
"python-box>=7.0.0",
|
|
30
30
|
"argcomplete>=3.0.0",
|
|
31
|
+
"setproctitle",
|
|
31
32
|
"numpy",
|
|
32
33
|
]
|
|
33
34
|
authors = [
|
|
@@ -28,6 +28,7 @@ def multiprocessing[T, R](
|
|
|
28
28
|
capture_output: bool = False,
|
|
29
29
|
delay_first_calls: float = 0,
|
|
30
30
|
nice: int | None = None,
|
|
31
|
+
process_title: str | None = None,
|
|
31
32
|
color: str = MAGENTA,
|
|
32
33
|
bar_format: str = BAR_FORMAT,
|
|
33
34
|
ascii: bool = False,
|
|
@@ -61,6 +62,7 @@ def multiprocessing[T, R](
|
|
|
61
62
|
Positive values reduce priority, negative values increase it.
|
|
62
63
|
Automatically converted to appropriate priority class on Windows.
|
|
63
64
|
If None, no priority adjustment is made.
|
|
65
|
+
process_title (str | None): If provided, sets the process title for worker processes.
|
|
64
66
|
color (str): Color of the progress bar (Defaults to MAGENTA)
|
|
65
67
|
bar_format (str): Format of the progress bar (Defaults to BAR_FORMAT)
|
|
66
68
|
ascii (bool): Whether to use ASCII or Unicode characters for the progress bar
|
|
@@ -139,6 +141,11 @@ def multiprocessing[T, R](
|
|
|
139
141
|
wrapped_args = args
|
|
140
142
|
wrapped_func = func
|
|
141
143
|
|
|
144
|
+
# Wrap function with process_title if specified
|
|
145
|
+
if process_title is not None:
|
|
146
|
+
wrapped_args = [(process_title, i, wrapped_func, arg) for i, arg in enumerate(wrapped_args)]
|
|
147
|
+
wrapped_func = process_title_wrapper
|
|
148
|
+
|
|
142
149
|
# Capture output if specified
|
|
143
150
|
capturer: CaptureOutput | None = None
|
|
144
151
|
if capture_output:
|
|
@@ -307,3 +314,20 @@ def capture_subprocess_output[T, R](args: tuple[CaptureOutput, Callable[[T], R],
|
|
|
307
314
|
capturer.redirect()
|
|
308
315
|
return func(arg)
|
|
309
316
|
|
|
317
|
+
|
|
318
|
+
# "Private" function for setting process title in multiprocessing subprocess
|
|
319
|
+
def process_title_wrapper[T, R](args: tuple[str, int, Callable[[T], R], T]) -> R:
|
|
320
|
+
""" Wrapper function to set the process title before executing the target function.
|
|
321
|
+
|
|
322
|
+
Args:
|
|
323
|
+
tuple[str,int,Callable,T]: Tuple containing:
|
|
324
|
+
str: Process title to set
|
|
325
|
+
int: Worker index to append to title
|
|
326
|
+
Callable: Target function to execute
|
|
327
|
+
T: Argument to pass to the target function
|
|
328
|
+
"""
|
|
329
|
+
process_title, index, func, arg = args
|
|
330
|
+
import setproctitle
|
|
331
|
+
setproctitle.setproctitle(f"{process_title} #{index}")
|
|
332
|
+
return func(arg)
|
|
333
|
+
|
|
@@ -7,7 +7,7 @@ from typing import Any
|
|
|
7
7
|
|
|
8
8
|
def doctest_square(x: int) -> int: ...
|
|
9
9
|
def doctest_slow(x: int) -> int: ...
|
|
10
|
-
def multiprocessing[T, R](func: Callable[..., R] | list[Callable[..., R]], args: Iterable[T], use_starmap: bool = False, chunksize: int = 1, desc: str = '', max_workers: int | float = ..., capture_output: bool = False, delay_first_calls: float = 0, nice: int | None = None, color: str = ..., bar_format: str = ..., ascii: bool = False, smooth_tqdm: bool = True, **tqdm_kwargs: Any) -> list[R]:
|
|
10
|
+
def multiprocessing[T, R](func: Callable[..., R] | list[Callable[..., R]], args: Iterable[T], use_starmap: bool = False, chunksize: int = 1, desc: str = '', max_workers: int | float = ..., capture_output: bool = False, delay_first_calls: float = 0, nice: int | None = None, process_title: str | None = None, color: str = ..., bar_format: str = ..., ascii: bool = False, smooth_tqdm: bool = True, **tqdm_kwargs: Any) -> list[R]:
|
|
11
11
|
''' Method to execute a function in parallel using multiprocessing
|
|
12
12
|
|
|
13
13
|
\t- For CPU-bound operations where the GIL (Global Interpreter Lock) is a bottleneck.
|
|
@@ -35,6 +35,7 @@ def multiprocessing[T, R](func: Callable[..., R] | list[Callable[..., R]], args:
|
|
|
35
35
|
\t\t\tPositive values reduce priority, negative values increase it.
|
|
36
36
|
\t\t\tAutomatically converted to appropriate priority class on Windows.
|
|
37
37
|
\t\t\tIf None, no priority adjustment is made.
|
|
38
|
+
\t\tprocess_title\t\t(str | None):\t\tIf provided, sets the process title for worker processes.
|
|
38
39
|
\t\tcolor\t\t\t\t(str):\t\t\t\tColor of the progress bar (Defaults to MAGENTA)
|
|
39
40
|
\t\tbar_format\t\t\t(str):\t\t\t\tFormat of the progress bar (Defaults to BAR_FORMAT)
|
|
40
41
|
\t\tascii\t\t\t\t(bool):\t\t\t\tWhether to use ASCII or Unicode characters for the progress bar
|
|
@@ -136,3 +137,13 @@ def capture_subprocess_output[T, R](args: tuple[CaptureOutput, Callable[[T], R],
|
|
|
136
137
|
\t\t\tCallable: Target function to execute
|
|
137
138
|
\t\t\tT: Argument to pass to the target function
|
|
138
139
|
\t"""
|
|
140
|
+
def process_title_wrapper[T, R](args: tuple[str, int, Callable[[T], R], T]) -> R:
|
|
141
|
+
""" Wrapper function to set the process title before executing the target function.
|
|
142
|
+
|
|
143
|
+
\tArgs:
|
|
144
|
+
\t\ttuple[str,int,Callable,T]: Tuple containing:
|
|
145
|
+
\t\t\tstr: Process title to set
|
|
146
|
+
\t\t\tint: Worker index to append to title
|
|
147
|
+
\t\t\tCallable: Target function to execute
|
|
148
|
+
\t\t\tT: Argument to pass to the target function
|
|
149
|
+
\t"""
|
|
@@ -24,6 +24,7 @@ def run_in_subprocess[R](
|
|
|
24
24
|
timeout: float | None = None,
|
|
25
25
|
no_join: bool = False,
|
|
26
26
|
capture_output: bool = False,
|
|
27
|
+
process_title: str | None = None,
|
|
27
28
|
**kwargs: Any
|
|
28
29
|
) -> R:
|
|
29
30
|
""" Execute a function in a subprocess with positional and keyword arguments.
|
|
@@ -42,6 +43,7 @@ def run_in_subprocess[R](
|
|
|
42
43
|
capture_output (bool): If True, capture the subprocess' stdout/stderr and relay it
|
|
43
44
|
in real time to the parent's stdout. This enables seeing print() output
|
|
44
45
|
from the subprocess in the main process.
|
|
46
|
+
process_title (str | None): If provided, sets the process title visible in process lists.
|
|
45
47
|
**kwargs (Any): Keyword arguments to pass to the function.
|
|
46
48
|
|
|
47
49
|
Returns:
|
|
@@ -89,7 +91,7 @@ def run_in_subprocess[R](
|
|
|
89
91
|
process: mp.Process = mp.Process(
|
|
90
92
|
target=_subprocess_wrapper,
|
|
91
93
|
args=(result_queue, func, args, kwargs),
|
|
92
|
-
kwargs={"capturer": capturer}
|
|
94
|
+
kwargs={"capturer": capturer, "process_title": process_title}
|
|
93
95
|
)
|
|
94
96
|
process.start()
|
|
95
97
|
|
|
@@ -141,7 +143,8 @@ def _subprocess_wrapper[R](
|
|
|
141
143
|
func: Callable[..., R],
|
|
142
144
|
args: tuple[Any, ...],
|
|
143
145
|
kwargs: dict[str, Any],
|
|
144
|
-
capturer: CaptureOutput | None = None
|
|
146
|
+
capturer: CaptureOutput | None = None,
|
|
147
|
+
process_title: str | None = None
|
|
145
148
|
) -> None:
|
|
146
149
|
""" Wrapper function to execute the target function and store the result in the queue.
|
|
147
150
|
|
|
@@ -153,8 +156,14 @@ def _subprocess_wrapper[R](
|
|
|
153
156
|
args (tuple): Positional arguments for the function.
|
|
154
157
|
kwargs (dict): Keyword arguments for the function.
|
|
155
158
|
capturer (CaptureOutput | None): Optional CaptureOutput instance for stdout capture.
|
|
159
|
+
process_title (str | None): Optional process title to set.
|
|
156
160
|
"""
|
|
157
161
|
try:
|
|
162
|
+
# Set process title if provided
|
|
163
|
+
if process_title is not None:
|
|
164
|
+
import setproctitle
|
|
165
|
+
setproctitle.setproctitle(process_title)
|
|
166
|
+
|
|
158
167
|
# If a CaptureOutput instance was passed, redirect stdout/stderr to the pipe.
|
|
159
168
|
if capturer is not None:
|
|
160
169
|
capturer.redirect()
|
|
@@ -11,7 +11,7 @@ class RemoteSubprocessError(RuntimeError):
|
|
|
11
11
|
remote_traceback: Incomplete
|
|
12
12
|
def __init__(self, exc_type: str, exc_repr: str, traceback_str: str) -> None: ...
|
|
13
13
|
|
|
14
|
-
def run_in_subprocess[R](func: Callable[..., R], *args: Any, timeout: float | None = None, no_join: bool = False, capture_output: bool = False, **kwargs: Any) -> R:
|
|
14
|
+
def run_in_subprocess[R](func: Callable[..., R], *args: Any, timeout: float | None = None, no_join: bool = False, capture_output: bool = False, process_title: str | None = None, **kwargs: Any) -> R:
|
|
15
15
|
''' Execute a function in a subprocess with positional and keyword arguments.
|
|
16
16
|
|
|
17
17
|
\tThis is useful when you need to run a function in isolation to avoid memory leaks,
|
|
@@ -28,6 +28,7 @@ def run_in_subprocess[R](func: Callable[..., R], *args: Any, timeout: float | No
|
|
|
28
28
|
\t\tcapture_output (bool): If True, capture the subprocess\' stdout/stderr and relay it
|
|
29
29
|
\t\t\tin real time to the parent\'s stdout. This enables seeing print() output
|
|
30
30
|
\t\t\tfrom the subprocess in the main process.
|
|
31
|
+
\t\tprocess_title (str | None): If provided, sets the process title visible in process lists.
|
|
31
32
|
\t\t**kwargs (Any): Keyword arguments to pass to the function.
|
|
32
33
|
|
|
33
34
|
\tReturns:
|
|
@@ -60,7 +61,7 @@ def run_in_subprocess[R](func: Callable[..., R], *args: Any, timeout: float | No
|
|
|
60
61
|
\t\t\t> # With timeout to prevent hanging
|
|
61
62
|
\t\t\t> run_in_subprocess(some_gpu_func, data, timeout=300.0)
|
|
62
63
|
\t'''
|
|
63
|
-
def _subprocess_wrapper[R](result_queue: Any, func: Callable[..., R], args: tuple[Any, ...], kwargs: dict[str, Any], capturer: CaptureOutput | None = None) -> None:
|
|
64
|
+
def _subprocess_wrapper[R](result_queue: Any, func: Callable[..., R], args: tuple[Any, ...], kwargs: dict[str, Any], capturer: CaptureOutput | None = None, process_title: str | None = None) -> None:
|
|
64
65
|
""" Wrapper function to execute the target function and store the result in the queue.
|
|
65
66
|
|
|
66
67
|
\tMust be at module level to be pickable on Windows (spawn context).
|
|
@@ -71,4 +72,5 @@ def _subprocess_wrapper[R](result_queue: Any, func: Callable[..., R], args: tupl
|
|
|
71
72
|
\t\targs (tuple): Positional arguments for the function.
|
|
72
73
|
\t\tkwargs (dict): Keyword arguments for the function.
|
|
73
74
|
\t\tcapturer (CaptureOutput | None): Optional CaptureOutput instance for stdout capture.
|
|
75
|
+
\t\tprocess_title (str | None): Optional process title to set.
|
|
74
76
|
\t"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/axis_flip.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/blur.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/brightness.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/canny.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/clahe.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/common.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/contrast.py
RENAMED
|
File without changes
|
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/denoise.py
RENAMED
|
File without changes
|
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/invert.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/laplacian.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/median_blur.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/noise.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/normalize.py
RENAMED
|
File without changes
|
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/resize.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/rotation.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/salt_pepper.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/sharpening.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/shearing.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/threshold.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/translation.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/zoom.py
RENAMED
|
File without changes
|
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image_preprocess.py
RENAMED
|
File without changes
|
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/technique.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/dataset/grouping_strategy.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/efficientnet.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/visualizations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/scripts/exhaustive_process.py
RENAMED
|
File without changes
|
{stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/scripts/preprocess_dataset.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|