stouputils 1.16.0__py3-none-any.whl → 1.16.2__py3-none-any.whl

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.
@@ -154,7 +154,7 @@ def launch_tests(root_dir: str, strict: bool = True, pattern: str = "*") -> int:
154
154
  return total_failed
155
155
 
156
156
 
157
- def test_module_with_progress(module: ModuleType, separator: str) -> TestResults:
157
+ def test_module_with_progress(module: "ModuleType", separator: str) -> "TestResults":
158
158
  """ Test a module with testmod and measure the time taken with progress printing.
159
159
 
160
160
  Args:
@@ -165,7 +165,7 @@ def test_module_with_progress(module: ModuleType, separator: str) -> TestResults
165
165
  """
166
166
  from doctest import testmod
167
167
  @measure_time(message=f"Testing module '{module.__name__}' {separator}took")
168
- def internal() -> TestResults:
168
+ def internal() -> "TestResults":
169
169
  return testmod(m=module)
170
170
  return internal()
171
171
 
stouputils/image.py CHANGED
@@ -28,7 +28,7 @@ PIL_Image_or_NDArray = TypeVar("PIL_Image_or_NDArray", bound="Image.Image | NDAr
28
28
  def image_resize[PIL_Image_or_NDArray](
29
29
  image: PIL_Image_or_NDArray,
30
30
  max_result_size: int,
31
- resampling: Image.Resampling | None = None,
31
+ resampling: "Image.Resampling | None" = None,
32
32
  min_or_max: Callable[[int, int], int] = max,
33
33
  return_type: type[PIL_Image_or_NDArray] | str = "same",
34
34
  keep_aspect_ratio: bool = True,
@@ -123,8 +123,8 @@ def image_resize[PIL_Image_or_NDArray](
123
123
 
124
124
  def auto_crop[PIL_Image_or_NDArray](
125
125
  image: PIL_Image_or_NDArray,
126
- mask: NDArray[np.bool_] | None = None,
127
- threshold: int | float | Callable[[NDArray[np.number]], int | float] | None = None,
126
+ mask: "NDArray[np.bool_] | None" = None,
127
+ threshold: int | float | Callable[["NDArray[np.number]"], int | float] | None = None,
128
128
  return_type: type[PIL_Image_or_NDArray] | str = "same",
129
129
  contiguous: bool = True,
130
130
  ) -> Any:
@@ -207,7 +207,7 @@ def auto_crop[PIL_Image_or_NDArray](
207
207
 
208
208
  # Convert to numpy array and store original type
209
209
  original_was_pil: bool = isinstance(image, Image.Image)
210
- image_array: NDArray[np.number] = np.array(image) if original_was_pil else image
210
+ image_array: NDArray[np.number] = np.array(image) if original_was_pil else image # type: ignore
211
211
 
212
212
  # Create mask if not provided
213
213
  if mask is None:
@@ -263,7 +263,7 @@ def auto_crop[PIL_Image_or_NDArray](
263
263
 
264
264
  def numpy_to_gif(
265
265
  path: str,
266
- array: NDArray[np.integer | np.floating | np.bool_],
266
+ array: "NDArray[np.integer | np.floating | np.bool_]",
267
267
  duration: int = 100,
268
268
  loop: int = 0,
269
269
  mkdir: bool = True,
@@ -344,7 +344,7 @@ def numpy_to_gif(
344
344
 
345
345
  def numpy_to_obj(
346
346
  path: str,
347
- array: NDArray[np.integer | np.floating | np.bool_],
347
+ array: "NDArray[np.integer | np.floating | np.bool_]",
348
348
  threshold: float = 0.5,
349
349
  step_size: int = 1,
350
350
  pad_array: bool = True,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: stouputils
3
- Version: 1.16.0
3
+ Version: 1.16.2
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
@@ -3,7 +3,7 @@ stouputils/__init__.pyi,sha256=as5qRu9FfJdJwb_DheDTq6hA5y4UfIFgPwItNfPHMwU,374
3
3
  stouputils/__main__.py,sha256=MA3jjc1yL8_0Z9oB55BMqrFq1ot_-e5rNqSxFQGsMzs,2910
4
4
  stouputils/_deprecated.py,sha256=Bcq6YjdM9Rk9Vq-WMhc_tuEbPORX6U8HAJ9Vh-VIWTA,1478
5
5
  stouputils/_deprecated.pyi,sha256=6-8YsftJd2fRAdBLsysc6jf-uA8V2wiqkiFAbdfWfJQ,664
6
- stouputils/all_doctests.py,sha256=317v-B4kqf_8lkrw6ul1ZGBgZ75CYIqoDn7kG5k8qyc,6322
6
+ stouputils/all_doctests.py,sha256=PPh081zySANsZme52Bg3DwMqVlQpjrdgO13GctsCtFo,6328
7
7
  stouputils/all_doctests.pyi,sha256=R3FRKaQv3sTZbxLvvsChHZZKygVMhmL6pqrYYLqvZCg,2017
8
8
  stouputils/applications/__init__.py,sha256=dbjwZt8PZF043KoJSItqCpH32FtRxN5sgV-8Q2b1l10,457
9
9
  stouputils/applications/__init__.pyi,sha256=DTYq2Uqq1uLzCMkFByjRqdtREA-9SaQnp4QpgmCEPFg,56
@@ -111,7 +111,7 @@ stouputils/data_science/scripts/routine.py,sha256=FkTLzmcdm_qUp69D-dPAKJm2RfXZZL
111
111
  stouputils/data_science/utils.py,sha256=HFXI2RQZ53RbBOn_4Act2bi0z4xQlTtsuR5Am80v9JU,11084
112
112
  stouputils/decorators.py,sha256=miZ8r2g8VhmQs2_knkKuUagdQabriZe7w0fCOEB69Nw,21838
113
113
  stouputils/decorators.pyi,sha256=vbPRsvox4dotqcln3StgE6iZ1cWCOeAn56M9zMpdw2U,10948
114
- stouputils/image.py,sha256=uGBweT-60JEn4SK5nVAxqiVI4Ijh4YyG_d5uXjXgtCY,16603
114
+ stouputils/image.py,sha256=xojXhpXGee6SjvyJ77f7GBQiLskWAW6RQhB_ZhpVpAk,16628
115
115
  stouputils/image.pyi,sha256=B7aypF1kHsEHHzwTnbcINLam32H4iJJBRxsegwt2n78,8455
116
116
  stouputils/installer/__init__.py,sha256=DBwI9w3xvw0NR_jDMxmURwPi1F79kPLe7EuNjmrxW_U,502
117
117
  stouputils/installer/__init__.pyi,sha256=ZB-8frAUOW-0pCEJL-e2AdbFodivv46v3EBYwEXCxRo,117
@@ -136,7 +136,7 @@ stouputils/typing.py,sha256=TwvxrvxhBRkyHkoOpfyXebN13M3xJb8MAjKXiNIWjew,2205
136
136
  stouputils/typing.pyi,sha256=U2UmFZausMYpnsUQROQE2JOwHcjx2hKV0rJuOdR57Ew,1341
137
137
  stouputils/version_pkg.py,sha256=Jsp-s03L14DkiZ94vQgrlQmaxApfn9DC8M_nzT1SJLk,7014
138
138
  stouputils/version_pkg.pyi,sha256=QPvqp1U3QA-9C_CC1dT9Vahv1hXEhstbM7x5uzMZSsQ,755
139
- stouputils-1.16.0.dist-info/WHEEL,sha256=XV0cjMrO7zXhVAIyyc8aFf1VjZ33Fen4IiJk5zFlC3g,80
140
- stouputils-1.16.0.dist-info/entry_points.txt,sha256=tx0z9VOnE-sfkmbFbA93zaBMzV3XSsKEJa_BWIqUzxw,57
141
- stouputils-1.16.0.dist-info/METADATA,sha256=cSM0j3GOs_HHAfqbLFyDyRo8khriZLWyL__71W7JFZE,13890
142
- stouputils-1.16.0.dist-info/RECORD,,
139
+ stouputils-1.16.2.dist-info/WHEEL,sha256=XV0cjMrO7zXhVAIyyc8aFf1VjZ33Fen4IiJk5zFlC3g,80
140
+ stouputils-1.16.2.dist-info/entry_points.txt,sha256=tx0z9VOnE-sfkmbFbA93zaBMzV3XSsKEJa_BWIqUzxw,57
141
+ stouputils-1.16.2.dist-info/METADATA,sha256=DllR0l0Z_lBuMSwdvIKSQnoBMp8Yw2yzKbPPMPhzuv0,13890
142
+ stouputils-1.16.2.dist-info/RECORD,,