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.
Files changed (161) hide show
  1. {stouputils-1.19.5 → stouputils-1.20.0}/PKG-INFO +2 -1
  2. {stouputils-1.19.5 → stouputils-1.20.0}/pyproject.toml +2 -1
  3. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/multi.py +24 -0
  4. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/multi.pyi +12 -1
  5. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/subprocess.py +11 -2
  6. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/subprocess.pyi +4 -2
  7. {stouputils-1.19.5 → stouputils-1.20.0}/README.md +0 -0
  8. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/__init__.py +0 -0
  9. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/__init__.pyi +0 -0
  10. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/__main__.py +0 -0
  11. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/_deprecated.py +0 -0
  12. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/_deprecated.pyi +0 -0
  13. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/all_doctests.py +0 -0
  14. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/all_doctests.pyi +0 -0
  15. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/__init__.py +0 -0
  16. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/__init__.pyi +0 -0
  17. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/automatic_docs.py +0 -0
  18. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/automatic_docs.pyi +0 -0
  19. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/upscaler/__init__.py +0 -0
  20. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/upscaler/__init__.pyi +0 -0
  21. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/upscaler/config.py +0 -0
  22. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/upscaler/config.pyi +0 -0
  23. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/upscaler/image.py +0 -0
  24. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/upscaler/image.pyi +0 -0
  25. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/upscaler/video.py +0 -0
  26. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/applications/upscaler/video.pyi +0 -0
  27. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/archive.py +0 -0
  28. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/archive.pyi +0 -0
  29. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/backup.py +0 -0
  30. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/backup.pyi +0 -0
  31. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/collections.py +0 -0
  32. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/collections.pyi +0 -0
  33. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/__init__.py +0 -0
  34. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/__init__.pyi +0 -0
  35. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/cd_utils.py +0 -0
  36. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/cd_utils.pyi +0 -0
  37. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/github.py +0 -0
  38. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/github.pyi +0 -0
  39. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/pypi.py +0 -0
  40. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/pypi.pyi +0 -0
  41. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/pyproject.py +0 -0
  42. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/pyproject.pyi +0 -0
  43. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/stubs.py +0 -0
  44. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/continuous_delivery/stubs.pyi +0 -0
  45. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/ctx.py +0 -0
  46. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/ctx.pyi +0 -0
  47. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/config/get.py +0 -0
  48. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/config/set.py +0 -0
  49. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/__init__.py +0 -0
  50. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/auto_contrast.py +0 -0
  51. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/axis_flip.py +0 -0
  52. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/bias_field_correction.py +0 -0
  53. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/binary_threshold.py +0 -0
  54. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/blur.py +0 -0
  55. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/brightness.py +0 -0
  56. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/canny.py +0 -0
  57. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/clahe.py +0 -0
  58. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/common.py +0 -0
  59. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/contrast.py +0 -0
  60. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/curvature_flow_filter.py +0 -0
  61. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/denoise.py +0 -0
  62. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/histogram_equalization.py +0 -0
  63. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/invert.py +0 -0
  64. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/laplacian.py +0 -0
  65. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/median_blur.py +0 -0
  66. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/noise.py +0 -0
  67. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/normalize.py +0 -0
  68. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/random_erase.py +0 -0
  69. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/resize.py +0 -0
  70. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/rotation.py +0 -0
  71. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/salt_pepper.py +0 -0
  72. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/sharpening.py +0 -0
  73. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/shearing.py +0 -0
  74. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/threshold.py +0 -0
  75. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/translation.py +0 -0
  76. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image/zoom.py +0 -0
  77. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image_augmentation.py +0 -0
  78. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/image_preprocess.py +0 -0
  79. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/prosthesis_detection.py +0 -0
  80. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/data_processing/technique.py +0 -0
  81. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/dataset/__init__.py +0 -0
  82. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/dataset/dataset.py +0 -0
  83. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/dataset/dataset_loader.py +0 -0
  84. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/dataset/grouping_strategy.py +0 -0
  85. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/dataset/image_loader.py +0 -0
  86. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/dataset/xy_tuple.py +0 -0
  87. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/metric_dictionnary.py +0 -0
  88. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/metric_utils.py +0 -0
  89. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/mlflow_utils.py +0 -0
  90. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/abstract_model.py +0 -0
  91. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/all.py +0 -0
  92. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/base_keras.py +0 -0
  93. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/all.py +0 -0
  94. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/convnext.py +0 -0
  95. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/densenet.py +0 -0
  96. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/efficientnet.py +0 -0
  97. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/mobilenet.py +0 -0
  98. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/resnet.py +0 -0
  99. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/squeezenet.py +0 -0
  100. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/vgg.py +0 -0
  101. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras/xception.py +0 -0
  102. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/callbacks/__init__.py +0 -0
  103. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/callbacks/colored_progress_bar.py +0 -0
  104. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/callbacks/learning_rate_finder.py +0 -0
  105. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/callbacks/model_checkpoint_v2.py +0 -0
  106. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/callbacks/progressive_unfreezing.py +0 -0
  107. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/callbacks/warmup_scheduler.py +0 -0
  108. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/losses/__init__.py +0 -0
  109. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/losses/next_generation_loss.py +0 -0
  110. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/keras_utils/visualizations.py +0 -0
  111. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/model_interface.py +0 -0
  112. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/models/sandbox.py +0 -0
  113. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/range_tuple.py +0 -0
  114. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/scripts/augment_dataset.py +0 -0
  115. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/scripts/exhaustive_process.py +0 -0
  116. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/scripts/preprocess_dataset.py +0 -0
  117. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/scripts/routine.py +0 -0
  118. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/data_science/utils.py +0 -0
  119. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/decorators.py +0 -0
  120. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/decorators.pyi +0 -0
  121. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/image.py +0 -0
  122. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/image.pyi +0 -0
  123. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/__init__.py +0 -0
  124. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/__init__.pyi +0 -0
  125. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/common.py +0 -0
  126. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/common.pyi +0 -0
  127. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/downloader.py +0 -0
  128. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/downloader.pyi +0 -0
  129. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/linux.py +0 -0
  130. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/linux.pyi +0 -0
  131. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/main.py +0 -0
  132. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/main.pyi +0 -0
  133. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/windows.py +0 -0
  134. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/installer/windows.pyi +0 -0
  135. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/io.py +0 -0
  136. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/io.pyi +0 -0
  137. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/__init__.py +0 -0
  138. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/__init__.pyi +0 -0
  139. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/base.py +0 -0
  140. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/base.pyi +0 -0
  141. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/queue.py +0 -0
  142. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/queue.pyi +0 -0
  143. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/re_entrant.py +0 -0
  144. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/re_entrant.pyi +0 -0
  145. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/redis_fifo.py +0 -0
  146. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/redis_fifo.pyi +0 -0
  147. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/shared.py +0 -0
  148. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/lock/shared.pyi +0 -0
  149. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/__init__.py +0 -0
  150. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/__init__.pyi +0 -0
  151. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/capturer.py +0 -0
  152. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/capturer.pyi +0 -0
  153. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/common.py +0 -0
  154. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/parallel/common.pyi +0 -0
  155. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/print.py +0 -0
  156. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/print.pyi +0 -0
  157. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/py.typed +0 -0
  158. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/typing.py +0 -0
  159. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/typing.pyi +0 -0
  160. {stouputils-1.19.5 → stouputils-1.20.0}/stouputils/version_pkg.py +0 -0
  161. {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.19.5
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.19.5"
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