stouputils 1.12.1__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.
Files changed (138) hide show
  1. stouputils/__init__.py +40 -0
  2. stouputils/__init__.pyi +14 -0
  3. stouputils/__main__.py +81 -0
  4. stouputils/_deprecated.py +37 -0
  5. stouputils/_deprecated.pyi +12 -0
  6. stouputils/all_doctests.py +160 -0
  7. stouputils/all_doctests.pyi +46 -0
  8. stouputils/applications/__init__.py +22 -0
  9. stouputils/applications/__init__.pyi +2 -0
  10. stouputils/applications/automatic_docs.py +634 -0
  11. stouputils/applications/automatic_docs.pyi +106 -0
  12. stouputils/applications/upscaler/__init__.py +39 -0
  13. stouputils/applications/upscaler/__init__.pyi +3 -0
  14. stouputils/applications/upscaler/config.py +128 -0
  15. stouputils/applications/upscaler/config.pyi +18 -0
  16. stouputils/applications/upscaler/image.py +247 -0
  17. stouputils/applications/upscaler/image.pyi +109 -0
  18. stouputils/applications/upscaler/video.py +287 -0
  19. stouputils/applications/upscaler/video.pyi +60 -0
  20. stouputils/archive.py +344 -0
  21. stouputils/archive.pyi +67 -0
  22. stouputils/backup.py +488 -0
  23. stouputils/backup.pyi +109 -0
  24. stouputils/collections.py +244 -0
  25. stouputils/collections.pyi +86 -0
  26. stouputils/continuous_delivery/__init__.py +27 -0
  27. stouputils/continuous_delivery/__init__.pyi +5 -0
  28. stouputils/continuous_delivery/cd_utils.py +243 -0
  29. stouputils/continuous_delivery/cd_utils.pyi +129 -0
  30. stouputils/continuous_delivery/github.py +522 -0
  31. stouputils/continuous_delivery/github.pyi +162 -0
  32. stouputils/continuous_delivery/pypi.py +91 -0
  33. stouputils/continuous_delivery/pypi.pyi +43 -0
  34. stouputils/continuous_delivery/pyproject.py +147 -0
  35. stouputils/continuous_delivery/pyproject.pyi +67 -0
  36. stouputils/continuous_delivery/stubs.py +86 -0
  37. stouputils/continuous_delivery/stubs.pyi +39 -0
  38. stouputils/ctx.py +408 -0
  39. stouputils/ctx.pyi +211 -0
  40. stouputils/data_science/config/get.py +51 -0
  41. stouputils/data_science/config/set.py +125 -0
  42. stouputils/data_science/data_processing/image/__init__.py +66 -0
  43. stouputils/data_science/data_processing/image/auto_contrast.py +79 -0
  44. stouputils/data_science/data_processing/image/axis_flip.py +58 -0
  45. stouputils/data_science/data_processing/image/bias_field_correction.py +74 -0
  46. stouputils/data_science/data_processing/image/binary_threshold.py +73 -0
  47. stouputils/data_science/data_processing/image/blur.py +59 -0
  48. stouputils/data_science/data_processing/image/brightness.py +54 -0
  49. stouputils/data_science/data_processing/image/canny.py +110 -0
  50. stouputils/data_science/data_processing/image/clahe.py +92 -0
  51. stouputils/data_science/data_processing/image/common.py +30 -0
  52. stouputils/data_science/data_processing/image/contrast.py +53 -0
  53. stouputils/data_science/data_processing/image/curvature_flow_filter.py +74 -0
  54. stouputils/data_science/data_processing/image/denoise.py +378 -0
  55. stouputils/data_science/data_processing/image/histogram_equalization.py +123 -0
  56. stouputils/data_science/data_processing/image/invert.py +64 -0
  57. stouputils/data_science/data_processing/image/laplacian.py +60 -0
  58. stouputils/data_science/data_processing/image/median_blur.py +52 -0
  59. stouputils/data_science/data_processing/image/noise.py +59 -0
  60. stouputils/data_science/data_processing/image/normalize.py +65 -0
  61. stouputils/data_science/data_processing/image/random_erase.py +66 -0
  62. stouputils/data_science/data_processing/image/resize.py +69 -0
  63. stouputils/data_science/data_processing/image/rotation.py +80 -0
  64. stouputils/data_science/data_processing/image/salt_pepper.py +68 -0
  65. stouputils/data_science/data_processing/image/sharpening.py +55 -0
  66. stouputils/data_science/data_processing/image/shearing.py +64 -0
  67. stouputils/data_science/data_processing/image/threshold.py +64 -0
  68. stouputils/data_science/data_processing/image/translation.py +71 -0
  69. stouputils/data_science/data_processing/image/zoom.py +83 -0
  70. stouputils/data_science/data_processing/image_augmentation.py +118 -0
  71. stouputils/data_science/data_processing/image_preprocess.py +183 -0
  72. stouputils/data_science/data_processing/prosthesis_detection.py +359 -0
  73. stouputils/data_science/data_processing/technique.py +481 -0
  74. stouputils/data_science/dataset/__init__.py +45 -0
  75. stouputils/data_science/dataset/dataset.py +292 -0
  76. stouputils/data_science/dataset/dataset_loader.py +135 -0
  77. stouputils/data_science/dataset/grouping_strategy.py +296 -0
  78. stouputils/data_science/dataset/image_loader.py +100 -0
  79. stouputils/data_science/dataset/xy_tuple.py +696 -0
  80. stouputils/data_science/metric_dictionnary.py +106 -0
  81. stouputils/data_science/metric_utils.py +847 -0
  82. stouputils/data_science/mlflow_utils.py +206 -0
  83. stouputils/data_science/models/abstract_model.py +149 -0
  84. stouputils/data_science/models/all.py +85 -0
  85. stouputils/data_science/models/base_keras.py +765 -0
  86. stouputils/data_science/models/keras/all.py +38 -0
  87. stouputils/data_science/models/keras/convnext.py +62 -0
  88. stouputils/data_science/models/keras/densenet.py +50 -0
  89. stouputils/data_science/models/keras/efficientnet.py +60 -0
  90. stouputils/data_science/models/keras/mobilenet.py +56 -0
  91. stouputils/data_science/models/keras/resnet.py +52 -0
  92. stouputils/data_science/models/keras/squeezenet.py +233 -0
  93. stouputils/data_science/models/keras/vgg.py +42 -0
  94. stouputils/data_science/models/keras/xception.py +38 -0
  95. stouputils/data_science/models/keras_utils/callbacks/__init__.py +20 -0
  96. stouputils/data_science/models/keras_utils/callbacks/colored_progress_bar.py +219 -0
  97. stouputils/data_science/models/keras_utils/callbacks/learning_rate_finder.py +148 -0
  98. stouputils/data_science/models/keras_utils/callbacks/model_checkpoint_v2.py +31 -0
  99. stouputils/data_science/models/keras_utils/callbacks/progressive_unfreezing.py +249 -0
  100. stouputils/data_science/models/keras_utils/callbacks/warmup_scheduler.py +66 -0
  101. stouputils/data_science/models/keras_utils/losses/__init__.py +12 -0
  102. stouputils/data_science/models/keras_utils/losses/next_generation_loss.py +56 -0
  103. stouputils/data_science/models/keras_utils/visualizations.py +416 -0
  104. stouputils/data_science/models/model_interface.py +939 -0
  105. stouputils/data_science/models/sandbox.py +116 -0
  106. stouputils/data_science/range_tuple.py +234 -0
  107. stouputils/data_science/scripts/augment_dataset.py +77 -0
  108. stouputils/data_science/scripts/exhaustive_process.py +133 -0
  109. stouputils/data_science/scripts/preprocess_dataset.py +70 -0
  110. stouputils/data_science/scripts/routine.py +168 -0
  111. stouputils/data_science/utils.py +285 -0
  112. stouputils/decorators.py +595 -0
  113. stouputils/decorators.pyi +242 -0
  114. stouputils/image.py +441 -0
  115. stouputils/image.pyi +172 -0
  116. stouputils/installer/__init__.py +18 -0
  117. stouputils/installer/__init__.pyi +5 -0
  118. stouputils/installer/common.py +67 -0
  119. stouputils/installer/common.pyi +39 -0
  120. stouputils/installer/downloader.py +101 -0
  121. stouputils/installer/downloader.pyi +24 -0
  122. stouputils/installer/linux.py +144 -0
  123. stouputils/installer/linux.pyi +39 -0
  124. stouputils/installer/main.py +223 -0
  125. stouputils/installer/main.pyi +57 -0
  126. stouputils/installer/windows.py +136 -0
  127. stouputils/installer/windows.pyi +31 -0
  128. stouputils/io.py +486 -0
  129. stouputils/io.pyi +213 -0
  130. stouputils/parallel.py +453 -0
  131. stouputils/parallel.pyi +211 -0
  132. stouputils/print.py +527 -0
  133. stouputils/print.pyi +146 -0
  134. stouputils/py.typed +1 -0
  135. stouputils-1.12.1.dist-info/METADATA +179 -0
  136. stouputils-1.12.1.dist-info/RECORD +138 -0
  137. stouputils-1.12.1.dist-info/WHEEL +4 -0
  138. stouputils-1.12.1.dist-info/entry_points.txt +3 -0
stouputils/__init__.py ADDED
@@ -0,0 +1,40 @@
1
+ """ A collection of utility modules designed to simplify and enhance the development process.
2
+
3
+ This package provides various tools and utilities for common development tasks including:
4
+
5
+ Key Features:
6
+ - Continuous delivery utilities (GitHub, PyPI)
7
+ - Display and logging utilities (print)
8
+ - File and I/O management (io)
9
+ - Decorators for common patterns
10
+ - Context managers
11
+ - Archive and backup tools
12
+ - Parallel processing helpers
13
+ - Collection utilities
14
+ - Doctests utilities
15
+
16
+ """
17
+ # ruff: noqa: F403
18
+
19
+ # Version (handle case where the package is not installed)
20
+ from importlib.metadata import PackageNotFoundError, version
21
+
22
+ # Imports
23
+ from ._deprecated import *
24
+ from .all_doctests import *
25
+ from .archive import *
26
+ from .backup import *
27
+ from .collections import *
28
+ from .continuous_delivery import *
29
+ from .ctx import *
30
+ from .decorators import *
31
+ from .image import *
32
+ from .io import *
33
+ from .parallel import *
34
+ from .print import *
35
+
36
+ try:
37
+ __version__: str = version("stouputils")
38
+ except PackageNotFoundError:
39
+ __version__: str = "0.0.0-dev"
40
+
@@ -0,0 +1,14 @@
1
+ from ._deprecated import *
2
+ from .all_doctests import *
3
+ from .archive import *
4
+ from .backup import *
5
+ from .collections import *
6
+ from .continuous_delivery import *
7
+ from .ctx import *
8
+ from .decorators import *
9
+ from .image import *
10
+ from .io import *
11
+ from .parallel import *
12
+ from .print import *
13
+
14
+ __version__: str
stouputils/__main__.py ADDED
@@ -0,0 +1,81 @@
1
+
2
+
3
+ # PYTHON_ARGCOMPLETE_OK
4
+ # Imports
5
+ import argparse
6
+ import sys
7
+
8
+ import argcomplete
9
+
10
+ from .all_doctests import launch_tests
11
+ from .archive import archive_cli
12
+ from .backup import backup_cli
13
+ from .decorators import handle_error
14
+ from .print import CYAN, GREEN, RESET, show_version
15
+
16
+ # Argument Parser Setup for Auto-Completion
17
+ parser = argparse.ArgumentParser(prog="stouputils", add_help=False)
18
+ parser.add_argument("command", nargs="?", choices=[
19
+ "--version", "-v", "version", "show_version", "all_doctests", "archive", "backup"
20
+ ])
21
+ parser.add_argument("args", nargs="*")
22
+ argcomplete.autocomplete(parser)
23
+
24
+
25
+ @handle_error(message="Error while running 'stouputils'")
26
+ def main() -> None:
27
+ second_arg: str = sys.argv[1].lower() if len(sys.argv) >= 2 else ""
28
+
29
+ # Print the version of stouputils and its dependencies
30
+ if second_arg in ("--version", "-v", "version", "show_version"):
31
+ if len(sys.argv) >= 3:
32
+ return show_version(sys.argv[2])
33
+ return show_version()
34
+
35
+ # Handle "all_doctests" command
36
+ if second_arg == "all_doctests":
37
+ if launch_tests("." if len(sys.argv) == 2 else sys.argv[2]) > 0:
38
+ sys.exit(1)
39
+ return
40
+
41
+ # Handle "archive" command
42
+ if second_arg == "archive":
43
+ sys.argv.pop(1) # Remove "archive" from argv so archive_cli gets clean arguments
44
+ return archive_cli()
45
+
46
+ # Handle "backup" command
47
+ if second_arg == "backup":
48
+ sys.argv.pop(1) # Remove "backup" from argv so backup_cli gets clean arguments
49
+ return backup_cli()
50
+
51
+ # Check if the command is any package name
52
+ if second_arg in (): # type: ignore
53
+ return
54
+
55
+ # Get version
56
+ from importlib.metadata import version
57
+ try:
58
+ pkg_version = version("stouputils")
59
+ except Exception:
60
+ pkg_version = "unknown"
61
+
62
+ # Print help with nice formatting
63
+ separator: str = "─" * 60
64
+ print(f"""
65
+ {CYAN}{separator}{RESET}
66
+ {CYAN}stouputils {GREEN}CLI {CYAN}v{pkg_version}{RESET}
67
+ {CYAN}{separator}{RESET}
68
+ {CYAN}Usage:{RESET} stouputils <command> [options]
69
+
70
+ {CYAN}Available commands:{RESET}
71
+ {GREEN}--version, -v{RESET} [pkg] Show version information (optionally for a specific package)
72
+ {GREEN}all_doctests{RESET} [dir] Run all doctests in the specified directory
73
+ {GREEN}archive{RESET} --help Archive utilities (make, repair)
74
+ {GREEN}backup{RESET} --help Backup utilities (delta, consolidate, limit)
75
+ {CYAN}{separator}{RESET}
76
+ """.strip())
77
+ return
78
+
79
+ if __name__ == "__main__":
80
+ main()
81
+
@@ -0,0 +1,37 @@
1
+ """ Deprecated functions and classes.
2
+
3
+ This module contains deprecated functions that have been replaced by new implementations
4
+ These functions are retained for backward compatibility and will log deprecation warnings when used.
5
+ """
6
+
7
+ # Imports
8
+ from typing import Any
9
+
10
+ from .decorators import LogLevels, deprecated
11
+ from .io import csv_dump, csv_load, json_dump, json_load
12
+
13
+
14
+ # Deprecated functions
15
+ @deprecated(message="super_csv_dump has been renamed to csv_dump.", version="v1.8.0", error_log=LogLevels.WARNING)
16
+ def super_csv_dump(*args: Any, **kwargs: Any) -> Any:
17
+ """ Deprecated function, use "csv_dump" instead. """
18
+ return csv_dump(*args, **kwargs)
19
+
20
+
21
+ @deprecated(message="super_csv_load has been renamed to csv_load.", version="v1.8.0", error_log=LogLevels.WARNING)
22
+ def super_csv_load(*args: Any, **kwargs: Any) -> Any:
23
+ """ Deprecated function, use "csv_load" instead. """
24
+ return csv_load(*args, **kwargs)
25
+
26
+
27
+ @deprecated(message="super_json_dump has been renamed to json_dump.", version="v1.8.0", error_log=LogLevels.WARNING)
28
+ def super_json_dump(*args: Any, **kwargs: Any) -> Any:
29
+ """ Deprecated function, use "json_dump" instead. """
30
+ return json_dump(*args, **kwargs)
31
+
32
+
33
+ @deprecated(message="super_json_load has been renamed to json_load.", version="v1.8.0", error_log=LogLevels.WARNING)
34
+ def super_json_load(*args: Any, **kwargs: Any) -> Any:
35
+ """ Deprecated function, use "json_load" instead. """
36
+ return json_load(*args, **kwargs)
37
+
@@ -0,0 +1,12 @@
1
+ from .decorators import LogLevels as LogLevels, deprecated as deprecated
2
+ from .io import csv_dump as csv_dump, csv_load as csv_load, json_dump as json_dump, json_load as json_load
3
+ from typing import Any
4
+
5
+ def super_csv_dump(*args: Any, **kwargs: Any) -> Any:
6
+ ''' Deprecated function, use "csv_dump" instead. '''
7
+ def super_csv_load(*args: Any, **kwargs: Any) -> Any:
8
+ ''' Deprecated function, use "csv_load" instead. '''
9
+ def super_json_dump(*args: Any, **kwargs: Any) -> Any:
10
+ ''' Deprecated function, use "json_dump" instead. '''
11
+ def super_json_load(*args: Any, **kwargs: Any) -> Any:
12
+ ''' Deprecated function, use "json_load" instead. '''
@@ -0,0 +1,160 @@
1
+ """
2
+ This module is used to run all the doctests for all the modules in a given directory.
3
+
4
+ - launch_tests: Main function to launch tests for all modules in the given directory.
5
+ - test_module_with_progress: Test a module with testmod and measure the time taken with progress printing.
6
+
7
+ .. image:: https://raw.githubusercontent.com/Stoupy51/stouputils/refs/heads/main/assets/all_doctests_module.gif
8
+ :alt: stouputils all_doctests examples
9
+ """
10
+
11
+ # Imports
12
+ import importlib
13
+ import os
14
+ import pkgutil
15
+ import sys
16
+ from types import ModuleType
17
+ from typing import TYPE_CHECKING
18
+
19
+ from . import decorators
20
+ from .decorators import measure_time
21
+ from .io import clean_path, relative_path
22
+ from .print import error, info, progress, warning
23
+
24
+ if TYPE_CHECKING:
25
+ from doctest import TestResults
26
+
27
+
28
+ # Main program
29
+ def launch_tests(root_dir: str, strict: bool = True) -> int:
30
+ """ Main function to launch tests for all modules in the given directory.
31
+
32
+ Args:
33
+ root_dir (str): Root directory to search for modules
34
+ strict (bool): Modify the force_raise_exception variable to True in the decorators module
35
+
36
+ Returns:
37
+ int: The number of failed tests
38
+
39
+ Examples:
40
+ >>> launch_tests("unknown_dir")
41
+ Traceback (most recent call last):
42
+ ...
43
+ ValueError: No modules found in 'unknown_dir'
44
+
45
+ .. code-block:: python
46
+
47
+ > if launch_tests("/path/to/source") > 0:
48
+ sys.exit(1)
49
+ [PROGRESS HH:MM:SS] Importing module 'module1' took 0.001s
50
+ [PROGRESS HH:MM:SS] Importing module 'module2' took 0.002s
51
+ [PROGRESS HH:MM:SS] Importing module 'module3' took 0.003s
52
+ [PROGRESS HH:MM:SS] Importing module 'module4' took 0.004s
53
+ [INFO HH:MM:SS] Testing 4 modules...
54
+ [PROGRESS HH:MM:SS] Testing module 'module1' took 0.005s
55
+ [PROGRESS HH:MM:SS] Testing module 'module2' took 0.006s
56
+ [PROGRESS HH:MM:SS] Testing module 'module3' took 0.007s
57
+ [PROGRESS HH:MM:SS] Testing module 'module4' took 0.008s
58
+ """
59
+ if strict:
60
+ old_value: bool = strict
61
+ decorators.force_raise_exception = True
62
+ strict = old_value
63
+
64
+ # Get the path of the directory to check modules from
65
+ working_dir: str = clean_path(os.getcwd())
66
+ root_dir = clean_path(os.path.abspath(root_dir))
67
+ dir_to_check: str = os.path.dirname(root_dir) if working_dir != root_dir else root_dir
68
+
69
+ # Get all modules from folder
70
+ sys.path.insert(0, dir_to_check)
71
+ modules_file_paths: list[str] = []
72
+ for directory_path, _, _ in os.walk(root_dir):
73
+ directory_path = clean_path(directory_path)
74
+ for module_info in pkgutil.walk_packages([directory_path]):
75
+
76
+ # Extract root and module name
77
+ module_root: str = str(module_info.module_finder.path) # type: ignore
78
+ module_name: str = module_info.name.split(".")[-1]
79
+
80
+ # Get the absolute path
81
+ absolute_module_path: str = clean_path(os.path.join(module_root, module_name))
82
+
83
+ # Check if the module is in the root directory that we want to check
84
+ if root_dir in absolute_module_path:
85
+
86
+ # Get the path of the module like 'stouputils.io'
87
+ path: str = absolute_module_path.split(dir_to_check, 1)[1].replace("/", ".")[1:]
88
+
89
+ # If the module is not already in the list, add it
90
+ if path not in modules_file_paths:
91
+ modules_file_paths.append(path)
92
+
93
+ # If no modules are found, raise an error
94
+ if not modules_file_paths:
95
+ raise ValueError(f"No modules found in '{relative_path(root_dir)}'")
96
+
97
+ # Find longest module path for alignment
98
+ max_length: int = max(len(path) for path in modules_file_paths)
99
+
100
+ # Dynamically import all modules from iacob package recursively using pkgutil and importlib
101
+ modules: list[ModuleType] = []
102
+ separators: list[str] = []
103
+ for module_path in modules_file_paths:
104
+ separator: str = " " * (max_length - len(module_path))
105
+
106
+ @measure_time(message=f"Importing module '{module_path}' {separator}took")
107
+ def internal(a: str = module_path, b: str = separator) -> None:
108
+ modules.append(importlib.import_module(a))
109
+ separators.append(b)
110
+
111
+ try:
112
+ internal()
113
+ except Exception as e:
114
+ warning(f"Failed to import module '{module_path}': ({type(e).__name__}) {e}")
115
+
116
+ # Run tests for each module
117
+ info(f"Testing {len(modules)} modules...")
118
+ separators = [s + " "*(len("Importing") - len("Testing")) for s in separators]
119
+ results: list[TestResults] = [
120
+ test_module_with_progress(module, separator)
121
+ for module, separator in zip(modules, separators, strict=False)
122
+ ]
123
+
124
+ # Display any error lines for each module at the end of the script
125
+ total_failed: int = 0
126
+ for module, result in zip(modules, results, strict=False):
127
+ if result.failed > 0:
128
+ successful_tests: int = result.attempted - result.failed
129
+ error(f"Errors in module {module.__name__} ({successful_tests}/{result.attempted} tests passed)", exit=False)
130
+ total_failed += result.failed
131
+
132
+ # Reset force_raise_exception back
133
+ decorators.force_raise_exception = strict
134
+
135
+ # Final info
136
+ total_tests: int = sum(result.attempted for result in results)
137
+ successful_tests: int = total_tests - total_failed
138
+ if total_failed == 0:
139
+ info(f"All tests passed for all {len(modules)} modules! ({total_tests}/{total_tests} tests passed)")
140
+ else:
141
+ error(f"Some tests failed: {successful_tests}/{total_tests} tests passed in total across {len(modules)} modules", exit=False)
142
+ # Return the number of failed tests
143
+ return total_failed
144
+
145
+
146
+ def test_module_with_progress(module: ModuleType, separator: str) -> "TestResults":
147
+ """ Test a module with testmod and measure the time taken with progress printing.
148
+
149
+ Args:
150
+ module (ModuleType): Module to test
151
+ separator (str): Separator string for alignment in output
152
+ Returns:
153
+ TestResults: The results of the tests
154
+ """
155
+ from doctest import TestResults, testmod
156
+ @measure_time(message=f"Testing module '{module.__name__}' {separator}took")
157
+ def internal() -> TestResults:
158
+ return testmod(m=module)
159
+ return internal()
160
+
@@ -0,0 +1,46 @@
1
+ from . import decorators as decorators
2
+ from .decorators import measure_time as measure_time
3
+ from .io import clean_path as clean_path, relative_path as relative_path
4
+ from .print import error as error, info as info, progress as progress, warning as warning
5
+ from doctest import TestResults as TestResults
6
+ from types import ModuleType
7
+
8
+ def launch_tests(root_dir: str, strict: bool = True) -> int:
9
+ ''' Main function to launch tests for all modules in the given directory.
10
+
11
+ \tArgs:
12
+ \t\troot_dir\t\t\t\t(str):\t\t\tRoot directory to search for modules
13
+ \t\tstrict\t\t\t\t\t(bool):\t\t\tModify the force_raise_exception variable to True in the decorators module
14
+
15
+ \tReturns:
16
+ \t\tint: The number of failed tests
17
+
18
+ \tExamples:
19
+ \t\t>>> launch_tests("unknown_dir")
20
+ \t\tTraceback (most recent call last):
21
+ \t\t\t...
22
+ \t\tValueError: No modules found in \'unknown_dir\'
23
+
24
+ \t.. code-block:: python
25
+
26
+ \t\t> if launch_tests("/path/to/source") > 0:
27
+ \t\t\tsys.exit(1)
28
+ \t\t[PROGRESS HH:MM:SS] Importing module \'module1\'\ttook 0.001s
29
+ \t\t[PROGRESS HH:MM:SS] Importing module \'module2\'\ttook 0.002s
30
+ \t\t[PROGRESS HH:MM:SS] Importing module \'module3\'\ttook 0.003s
31
+ \t\t[PROGRESS HH:MM:SS] Importing module \'module4\'\ttook 0.004s
32
+ \t\t[INFO HH:MM:SS] Testing 4 modules...
33
+ \t\t[PROGRESS HH:MM:SS] Testing module \'module1\'\ttook 0.005s
34
+ \t\t[PROGRESS HH:MM:SS] Testing module \'module2\'\ttook 0.006s
35
+ \t\t[PROGRESS HH:MM:SS] Testing module \'module3\'\ttook 0.007s
36
+ \t\t[PROGRESS HH:MM:SS] Testing module \'module4\'\ttook 0.008s
37
+ \t'''
38
+ def test_module_with_progress(module: ModuleType, separator: str) -> TestResults:
39
+ """ Test a module with testmod and measure the time taken with progress printing.
40
+
41
+ \tArgs:
42
+ \t\tmodule\t\t(ModuleType):\tModule to test
43
+ \t\tseparator\t(str):\t\t\tSeparator string for alignment in output
44
+ \tReturns:
45
+ \t\tTestResults: The results of the tests
46
+ \t"""
@@ -0,0 +1,22 @@
1
+ """ Application-specific utilities and tools.
2
+
3
+ This module provides higher-level utilities for specific application needs:
4
+
5
+ Automatic Documentation:
6
+
7
+ - Automatic documentation generation with Sphinx: `update_documentation(...)`
8
+ - Support for multi-version documentation
9
+ - GitHub Pages integration
10
+ - Markdown to RST conversion
11
+
12
+ Upscaler:
13
+
14
+ - TODO
15
+
16
+ """
17
+ # ruff: noqa: F403
18
+
19
+ # Imports
20
+ from .automatic_docs import *
21
+ from .upscaler import *
22
+
@@ -0,0 +1,2 @@
1
+ from .automatic_docs import *
2
+ from .upscaler import *