orionis 0.310.0__py3-none-any.whl → 0.312.0__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.
- orionis/container/container.py +5 -3
- orionis/container/exceptions/type_error_exception.py +13 -11
- orionis/foundation/config/app/entities/app.py +24 -2
- orionis/foundation/config/auth/entities/auth.py +24 -2
- orionis/foundation/config/cache/entities/cache.py +25 -3
- orionis/foundation/config/cache/entities/file.py +25 -3
- orionis/foundation/config/cache/entities/stores.py +25 -3
- orionis/foundation/config/cors/entities/cors.py +24 -2
- orionis/foundation/config/database/entities/connections.py +25 -3
- orionis/foundation/config/database/entities/database.py +24 -2
- orionis/foundation/config/database/entities/mysql.py +25 -3
- orionis/foundation/config/database/entities/oracle.py +25 -3
- orionis/foundation/config/database/entities/pgsql.py +25 -3
- orionis/foundation/config/database/entities/sqlite.py +25 -3
- orionis/foundation/config/filesystems/entitites/aws.py +24 -2
- orionis/foundation/config/filesystems/entitites/disks.py +24 -2
- orionis/foundation/config/filesystems/entitites/filesystems.py +23 -1
- orionis/foundation/config/filesystems/entitites/local.py +24 -2
- orionis/foundation/config/filesystems/entitites/public.py +24 -2
- orionis/foundation/config/logging/entities/channels.py +25 -3
- orionis/foundation/config/logging/entities/chunked.py +25 -3
- orionis/foundation/config/logging/entities/daily.py +25 -3
- orionis/foundation/config/logging/entities/hourly.py +25 -3
- orionis/foundation/config/logging/entities/logging.py +23 -1
- orionis/foundation/config/logging/entities/monthly.py +25 -3
- orionis/foundation/config/logging/entities/stack.py +25 -3
- orionis/foundation/config/logging/entities/weekly.py +25 -3
- orionis/foundation/config/mail/entities/file.py +24 -2
- orionis/foundation/config/mail/entities/mail.py +23 -1
- orionis/foundation/config/mail/entities/mailers.py +24 -2
- orionis/foundation/config/mail/entities/smtp.py +24 -2
- orionis/foundation/config/queue/entities/brokers.py +24 -2
- orionis/foundation/config/queue/entities/database.py +25 -3
- orionis/foundation/config/queue/entities/queue.py +24 -2
- orionis/foundation/config/roots/paths.py +24 -2
- orionis/foundation/config/session/entities/session.py +23 -2
- orionis/foundation/config/startup.py +25 -3
- orionis/foundation/config/testing/entities/testing.py +1 -1
- orionis/foundation/exceptions/integrity.py +19 -0
- orionis/metadata/framework.py +1 -1
- orionis/services/asynchrony/exceptions/coroutine_exception.py +3 -3
- orionis/services/environment/exceptions/environment_value_error.py +9 -8
- orionis/services/environment/exceptions/environment_value_exception.py +3 -7
- orionis/services/introspection/abstract/reflection_abstract.py +7 -3
- orionis/services/introspection/concretes/reflection_concrete.py +1 -1
- orionis/services/introspection/dependencies/reflect_dependencies.py +1 -1
- orionis/services/introspection/exceptions/reflection_attribute_error.py +4 -10
- orionis/services/introspection/exceptions/reflection_type_error.py +3 -10
- orionis/services/introspection/exceptions/reflection_value_error.py +3 -10
- orionis/services/introspection/instances/reflection_instance.py +1 -1
- orionis/services/introspection/modules/reflection_module.py +1 -1
- orionis/services/paths/exceptions/not_found_exceptions.py +3 -15
- orionis/services/paths/exceptions/path_value_exceptions.py +3 -15
- orionis/services/system/workers.py +17 -0
- orionis/support/standard/exceptions/std_value_exception.py +3 -7
- orionis/test/exceptions/test_config_exception.py +2 -2
- orionis/test/exceptions/test_failure_exception.py +2 -4
- orionis/test/exceptions/test_persistence_error.py +2 -7
- orionis/test/exceptions/test_runtime_error.py +3 -3
- orionis/test/exceptions/test_value_error.py +3 -3
- {orionis-0.310.0.dist-info → orionis-0.312.0.dist-info}/METADATA +1 -1
- {orionis-0.310.0.dist-info → orionis-0.312.0.dist-info}/RECORD +110 -114
- tests/foundation/config/app/test_foundation_config_app.py +1 -1
- tests/foundation/config/cache/test_foundation_config_cache.py +1 -1
- tests/foundation/config/cache/test_foundation_config_cache_file.py +1 -1
- tests/foundation/config/cache/test_foundation_config_cache_stores.py +1 -1
- tests/foundation/config/cors/test_foundation_config_cors.py +1 -1
- tests/foundation/config/database/test_foundation_config_database.py +1 -1
- tests/foundation/config/database/test_foundation_config_database_connections.py +1 -1
- tests/foundation/config/database/test_foundation_config_database_mysql.py +1 -1
- tests/foundation/config/database/test_foundation_config_database_oracle.py +1 -1
- tests/foundation/config/database/test_foundation_config_database_pgsql.py +1 -1
- tests/foundation/config/database/test_foundation_config_database_sqlite.py +1 -1
- tests/foundation/config/filesystems/test_foundation_config_filesystems.py +1 -1
- tests/foundation/config/filesystems/test_foundation_config_filesystems_aws.py +1 -1
- tests/foundation/config/filesystems/test_foundation_config_filesystems_disks.py +1 -1
- tests/foundation/config/filesystems/test_foundation_config_filesystems_local.py +1 -1
- tests/foundation/config/filesystems/test_foundation_config_filesystems_public.py +1 -1
- tests/foundation/config/logging/test_foundation_config_logging.py +1 -1
- tests/foundation/config/logging/test_foundation_config_logging_channels.py +1 -1
- tests/foundation/config/logging/test_foundation_config_logging_chunked.py +1 -1
- tests/foundation/config/logging/test_foundation_config_logging_daily.py +1 -1
- tests/foundation/config/logging/test_foundation_config_logging_hourly.py +1 -1
- tests/foundation/config/logging/test_foundation_config_logging_monthly.py +1 -1
- tests/foundation/config/logging/test_foundation_config_logging_stack.py +1 -1
- tests/foundation/config/logging/test_foundation_config_logging_weekly.py +1 -1
- tests/foundation/config/mail/test_foundation_config_mail.py +1 -1
- tests/foundation/config/mail/test_foundation_config_mail_file.py +1 -1
- tests/foundation/config/mail/test_foundation_config_mail_mailers.py +1 -1
- tests/foundation/config/mail/test_foundation_config_mail_smtp.py +1 -1
- tests/foundation/config/queue/test_foundation_config_queue.py +1 -1
- tests/foundation/config/queue/test_foundation_config_queue_brokers.py +1 -1
- tests/foundation/config/queue/test_foundation_config_queue_database.py +1 -1
- tests/foundation/config/root/test_foundation_config_root_paths.py +1 -1
- tests/foundation/config/session/test_foundation_config_session.py +1 -1
- tests/foundation/config/startup/test_foundation_config_startup.py +1 -1
- tests/foundation/config/testing/test_foundation_config_testing.py +1 -1
- tests/foundation/{config/exceptions → exceptions}/test_foundation_config_exceptions.py +7 -7
- orionis/foundation/config/exceptions/integrity.py +0 -30
- orionis/services/introspection/dependencies/contracts/__init__.py +0 -0
- orionis/services/introspection/instances/contracts/__init__.py +0 -0
- orionis/services/introspection/modules/contracts/__init__.py +0 -0
- tests/foundation/config/exceptions/__init__.py +0 -0
- /orionis/foundation/{config/exceptions → exceptions}/__init__.py +0 -0
- /orionis/services/introspection/{abstract/contracts → contracts}/__init__.py +0 -0
- /orionis/services/introspection/{dependencies/contracts → contracts}/reflect_dependencies.py +0 -0
- /orionis/services/introspection/{abstract/contracts → contracts}/reflection_abstract.py +0 -0
- /orionis/services/introspection/{concretes/contracts → contracts}/reflection_concrete.py +0 -0
- /orionis/services/introspection/{instances/contracts → contracts}/reflection_instance.py +0 -0
- /orionis/services/introspection/{modules/contracts → contracts}/reflection_module.py +0 -0
- {orionis-0.310.0.dist-info → orionis-0.312.0.dist-info}/WHEEL +0 -0
- {orionis-0.310.0.dist-info → orionis-0.312.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.310.0.dist-info → orionis-0.312.0.dist-info}/top_level.txt +0 -0
- {orionis-0.310.0.dist-info → orionis-0.312.0.dist-info}/zip-safe +0 -0
- {orionis/services/introspection/concretes/contracts → tests/foundation/exceptions}/__init__.py +0 -0
@@ -1,10 +1,10 @@
|
|
1
|
-
from dataclasses import asdict, dataclass, field
|
1
|
+
from dataclasses import asdict, dataclass, field, fields
|
2
2
|
from orionis.foundation.config.app.entities.app import App
|
3
3
|
from orionis.foundation.config.auth.entities.auth import Auth
|
4
4
|
from orionis.foundation.config.cache.entities.cache import Cache
|
5
5
|
from orionis.foundation.config.cors.entities.cors import Cors
|
6
6
|
from orionis.foundation.config.database.entities.database import Database
|
7
|
-
from orionis.foundation.
|
7
|
+
from orionis.foundation.exceptions.integrity import OrionisIntegrityException
|
8
8
|
from orionis.foundation.config.filesystems.entitites.filesystems import Filesystems
|
9
9
|
from orionis.foundation.config.logging.entities.logging import Logging
|
10
10
|
from orionis.foundation.config.mail.entities.mail import Mail
|
@@ -200,4 +200,26 @@ class Configuration:
|
|
200
200
|
Returns:
|
201
201
|
dict: A dictionary representation of the Dataclass object.
|
202
202
|
"""
|
203
|
-
return asdict(self)
|
203
|
+
return asdict(self)
|
204
|
+
|
205
|
+
def getFields(self):
|
206
|
+
"""
|
207
|
+
Retrieves a list of field information for the current dataclass instance.
|
208
|
+
|
209
|
+
Returns:
|
210
|
+
list: A list of dictionaries, each containing details about a field:
|
211
|
+
- name (str): The name of the field.
|
212
|
+
- type (type): The type of the field.
|
213
|
+
- default: The default value of the field, if specified; otherwise, the value from metadata or None.
|
214
|
+
- metadata (mapping): The metadata associated with the field.
|
215
|
+
"""
|
216
|
+
__fields = []
|
217
|
+
for field in fields(self):
|
218
|
+
__metadata = dict(field.metadata) or {}
|
219
|
+
__fields.append({
|
220
|
+
"name": field.name,
|
221
|
+
"type": field.type.__name__ if hasattr(field.type, '__name__') else str(field.type),
|
222
|
+
"default": field.default if (field.default is not None and '_MISSING_TYPE' not in str(field.default)) else __metadata.get('default', None),
|
223
|
+
"metadata": __metadata
|
224
|
+
})
|
225
|
+
return __fields
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from dataclasses import asdict, dataclass, field, fields
|
2
2
|
from typing import List
|
3
|
-
from orionis.foundation.
|
3
|
+
from orionis.foundation.exceptions.integrity import OrionisIntegrityException
|
4
4
|
from orionis.services.system.workers import Workers
|
5
5
|
from orionis.test.enums.test_mode import ExecutionMode
|
6
6
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class OrionisIntegrityException(Exception):
|
2
|
+
|
3
|
+
def __init__(self, msg: str):
|
4
|
+
"""
|
5
|
+
Parameters
|
6
|
+
----------
|
7
|
+
msg : str
|
8
|
+
Descriptive error message explaining the cause of the exception.
|
9
|
+
"""
|
10
|
+
super().__init__(msg)
|
11
|
+
|
12
|
+
def __str__(self) -> str:
|
13
|
+
"""
|
14
|
+
Returns
|
15
|
+
-------
|
16
|
+
str
|
17
|
+
Formatted string describing the exception.
|
18
|
+
"""
|
19
|
+
return str(self.args[0])
|
orionis/metadata/framework.py
CHANGED
@@ -5,7 +5,7 @@ class OrionisCoroutineException(Exception):
|
|
5
5
|
Parameters
|
6
6
|
----------
|
7
7
|
msg : str
|
8
|
-
|
8
|
+
Descriptive error message explaining the cause of the exception.
|
9
9
|
"""
|
10
10
|
super().__init__(msg)
|
11
11
|
|
@@ -14,6 +14,6 @@ class OrionisCoroutineException(Exception):
|
|
14
14
|
Returns
|
15
15
|
-------
|
16
16
|
str
|
17
|
-
|
17
|
+
Formatted string describing the exception.
|
18
18
|
"""
|
19
|
-
return
|
19
|
+
return str(self.args[0])
|
@@ -2,17 +2,18 @@ class OrionisEnvironmentValueError(Exception):
|
|
2
2
|
|
3
3
|
def __init__(self, msg: str):
|
4
4
|
"""
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
Parameters
|
6
|
+
----------
|
7
|
+
msg : str
|
8
|
+
Descriptive error message explaining the cause of the exception.
|
8
9
|
"""
|
9
10
|
super().__init__(msg)
|
10
11
|
|
11
12
|
def __str__(self) -> str:
|
12
13
|
"""
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
Returns
|
15
|
+
-------
|
16
|
+
str
|
17
|
+
Formatted string describing the exception.
|
17
18
|
"""
|
18
|
-
return
|
19
|
+
return str(self.args[0])
|
@@ -2,22 +2,18 @@ class OrionisEnvironmentValueException(Exception):
|
|
2
2
|
|
3
3
|
def __init__(self, msg: str):
|
4
4
|
"""
|
5
|
-
Exception raised for errors related to environment values.
|
6
|
-
|
7
5
|
Parameters
|
8
6
|
----------
|
9
7
|
msg : str
|
10
|
-
|
8
|
+
Descriptive error message explaining the cause of the exception.
|
11
9
|
"""
|
12
10
|
super().__init__(msg)
|
13
11
|
|
14
12
|
def __str__(self) -> str:
|
15
13
|
"""
|
16
|
-
Returns a string representation of the exception.
|
17
|
-
|
18
14
|
Returns
|
19
15
|
-------
|
20
16
|
str
|
21
|
-
|
17
|
+
Formatted string describing the exception.
|
22
18
|
"""
|
23
|
-
return
|
19
|
+
return str(self.args[0])
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import inspect
|
2
2
|
import keyword
|
3
|
+
from abc import ABC
|
3
4
|
from typing import List, Type
|
4
|
-
from orionis.services.introspection.
|
5
|
+
from orionis.services.introspection.contracts.reflection_abstract import IReflectionAbstract
|
5
6
|
from orionis.services.introspection.dependencies.entities.class_dependencies import ClassDependency
|
6
7
|
from orionis.services.introspection.dependencies.entities.method_dependencies import MethodDependency
|
7
8
|
from orionis.services.introspection.dependencies.reflect_dependencies import ReflectDependencies
|
@@ -14,7 +15,7 @@ class ReflectionAbstract(IReflectionAbstract):
|
|
14
15
|
@staticmethod
|
15
16
|
def ensureIsAbstractClass(abstract: Type):
|
16
17
|
"""
|
17
|
-
Ensures that the provided object is an abstract base class (interface).
|
18
|
+
Ensures that the provided object is an abstract base class (interface) and directly inherits from ABC.
|
18
19
|
|
19
20
|
Parameters
|
20
21
|
----------
|
@@ -24,12 +25,15 @@ class ReflectionAbstract(IReflectionAbstract):
|
|
24
25
|
Raises
|
25
26
|
------
|
26
27
|
ReflectionTypeError
|
27
|
-
If 'abstract' is not a class type
|
28
|
+
If 'abstract' is not a class type, not an abstract base class, or does not directly inherit from ABC.
|
28
29
|
"""
|
30
|
+
|
29
31
|
if not isinstance(abstract, type):
|
30
32
|
raise ReflectionTypeError(f"Expected a class type for 'abstract', got {type(abstract).__name__!r}")
|
31
33
|
if not bool(getattr(abstract, '__abstractmethods__', False)):
|
32
34
|
raise ReflectionTypeError(f"Provided class '{abstract.__name__}' is not an interface (abstract base class)")
|
35
|
+
if ABC not in abstract.__bases__:
|
36
|
+
raise ReflectionTypeError(f"Provided class '{abstract.__name__}' must directly inherit from abc.ABC")
|
33
37
|
return True
|
34
38
|
|
35
39
|
def __init__(self, abstract: Type) -> None:
|
@@ -3,7 +3,7 @@ import inspect
|
|
3
3
|
import keyword
|
4
4
|
from typing import Any, Callable, List, Type
|
5
5
|
from orionis.services.asynchrony.coroutines import Coroutine
|
6
|
-
from orionis.services.introspection.
|
6
|
+
from orionis.services.introspection.contracts.reflection_concrete import IReflectionConcrete
|
7
7
|
from orionis.services.introspection.dependencies.entities.class_dependencies import ClassDependency
|
8
8
|
from orionis.services.introspection.dependencies.entities.method_dependencies import MethodDependency
|
9
9
|
from orionis.services.introspection.dependencies.reflect_dependencies import ReflectDependencies
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import inspect
|
2
2
|
from typing import Any, Dict, List
|
3
|
-
from orionis.services.introspection.
|
3
|
+
from orionis.services.introspection.contracts.reflect_dependencies import IReflectDependencies
|
4
4
|
from orionis.services.introspection.dependencies.entities.class_dependencies import ClassDependency
|
5
5
|
from orionis.services.introspection.dependencies.entities.method_dependencies import MethodDependency
|
6
6
|
from orionis.services.introspection.dependencies.entities.resolved_dependencies import ResolvedDependency
|
@@ -1,26 +1,20 @@
|
|
1
1
|
class ReflectionAttributeError(Exception):
|
2
|
-
"""
|
3
|
-
Base class for all reflection-related exceptions.
|
4
|
-
"""
|
5
2
|
|
6
3
|
def __init__(self, msg: str):
|
7
4
|
"""
|
8
|
-
Initialize the exception with a custom error message.
|
9
|
-
|
10
5
|
Parameters
|
11
6
|
----------
|
12
7
|
msg : str
|
13
|
-
|
8
|
+
Descriptive error message explaining the cause of the exception.
|
14
9
|
"""
|
15
10
|
super().__init__(msg)
|
16
11
|
|
17
12
|
def __str__(self) -> str:
|
18
13
|
"""
|
19
|
-
Return a string representation of the exception, including the class name and the first argument.
|
20
|
-
|
21
14
|
Returns
|
22
15
|
-------
|
23
16
|
str
|
24
|
-
|
17
|
+
Formatted string describing the exception.
|
25
18
|
"""
|
26
|
-
return
|
19
|
+
return str(self.args[0])
|
20
|
+
|
@@ -1,26 +1,19 @@
|
|
1
1
|
class ReflectionTypeError(Exception):
|
2
|
-
"""
|
3
|
-
Base class for all reflection-related exceptions.
|
4
|
-
"""
|
5
2
|
|
6
3
|
def __init__(self, msg: str):
|
7
4
|
"""
|
8
|
-
Initialize the exception with a custom error message.
|
9
|
-
|
10
5
|
Parameters
|
11
6
|
----------
|
12
7
|
msg : str
|
13
|
-
|
8
|
+
Descriptive error message explaining the cause of the exception.
|
14
9
|
"""
|
15
10
|
super().__init__(msg)
|
16
11
|
|
17
12
|
def __str__(self) -> str:
|
18
13
|
"""
|
19
|
-
Return a string representation of the exception, including the class name and the first argument.
|
20
|
-
|
21
14
|
Returns
|
22
15
|
-------
|
23
16
|
str
|
24
|
-
|
17
|
+
Formatted string describing the exception.
|
25
18
|
"""
|
26
|
-
return
|
19
|
+
return str(self.args[0])
|
@@ -1,26 +1,19 @@
|
|
1
1
|
class ReflectionValueError(Exception):
|
2
|
-
"""
|
3
|
-
Base class for all reflection-related exceptions.
|
4
|
-
"""
|
5
2
|
|
6
3
|
def __init__(self, msg: str):
|
7
4
|
"""
|
8
|
-
Initialize the exception with a custom error message.
|
9
|
-
|
10
5
|
Parameters
|
11
6
|
----------
|
12
7
|
msg : str
|
13
|
-
|
8
|
+
Descriptive error message explaining the cause of the exception.
|
14
9
|
"""
|
15
10
|
super().__init__(msg)
|
16
11
|
|
17
12
|
def __str__(self) -> str:
|
18
13
|
"""
|
19
|
-
Return a string representation of the exception, including the class name and the first argument.
|
20
|
-
|
21
14
|
Returns
|
22
15
|
-------
|
23
16
|
str
|
24
|
-
|
17
|
+
Formatted string describing the exception.
|
25
18
|
"""
|
26
|
-
return
|
19
|
+
return str(self.args[0])
|
@@ -8,7 +8,7 @@ from orionis.services.introspection.dependencies.reflect_dependencies import Ref
|
|
8
8
|
from orionis.services.introspection.exceptions.reflection_attribute_error import ReflectionAttributeError
|
9
9
|
from orionis.services.introspection.exceptions.reflection_type_error import ReflectionTypeError
|
10
10
|
from orionis.services.introspection.exceptions.reflection_value_error import ReflectionValueError
|
11
|
-
from orionis.services.introspection.
|
11
|
+
from orionis.services.introspection.contracts.reflection_instance import IReflectionInstance
|
12
12
|
|
13
13
|
class ReflectionInstance(IReflectionInstance):
|
14
14
|
|
@@ -3,7 +3,7 @@ import inspect
|
|
3
3
|
import keyword
|
4
4
|
from orionis.services.introspection.exceptions.reflection_type_error import ReflectionTypeError
|
5
5
|
from orionis.services.introspection.exceptions.reflection_value_error import ReflectionValueError
|
6
|
-
from orionis.services.introspection.
|
6
|
+
from orionis.services.introspection.contracts.reflection_module import IReflectionModule
|
7
7
|
|
8
8
|
class ReflectionModule(IReflectionModule):
|
9
9
|
|
@@ -1,31 +1,19 @@
|
|
1
1
|
class OrionisFileNotFoundException(Exception):
|
2
|
-
"""
|
3
|
-
Exception raised when a specified file is not found.
|
4
|
-
|
5
|
-
Parameters
|
6
|
-
----------
|
7
|
-
msg : str
|
8
|
-
The error message describing the exception.
|
9
|
-
"""
|
10
2
|
|
11
3
|
def __init__(self, msg: str):
|
12
4
|
"""
|
13
|
-
Initialize the exception with a custom error message.
|
14
|
-
|
15
5
|
Parameters
|
16
6
|
----------
|
17
7
|
msg : str
|
18
|
-
|
8
|
+
Descriptive error message explaining the cause of the exception.
|
19
9
|
"""
|
20
10
|
super().__init__(msg)
|
21
11
|
|
22
12
|
def __str__(self) -> str:
|
23
13
|
"""
|
24
|
-
Return a string representation of the exception.
|
25
|
-
|
26
14
|
Returns
|
27
15
|
-------
|
28
16
|
str
|
29
|
-
|
17
|
+
Formatted string describing the exception.
|
30
18
|
"""
|
31
|
-
return
|
19
|
+
return str(self.args[0])
|
@@ -1,31 +1,19 @@
|
|
1
1
|
class OrionisPathValueException(Exception):
|
2
|
-
"""
|
3
|
-
Exception raised when a file is not found in the Orionis framework.
|
4
|
-
|
5
|
-
Parameters
|
6
|
-
----------
|
7
|
-
msg : str
|
8
|
-
A detailed message describing the missing file.
|
9
|
-
"""
|
10
2
|
|
11
3
|
def __init__(self, msg: str):
|
12
4
|
"""
|
13
|
-
Initialize the exception with a custom error message.
|
14
|
-
|
15
5
|
Parameters
|
16
6
|
----------
|
17
7
|
msg : str
|
18
|
-
|
8
|
+
Descriptive error message explaining the cause of the exception.
|
19
9
|
"""
|
20
10
|
super().__init__(msg)
|
21
11
|
|
22
12
|
def __str__(self) -> str:
|
23
13
|
"""
|
24
|
-
Return a string representation of the exception, including the class name and the first argument.
|
25
|
-
|
26
14
|
Returns
|
27
15
|
-------
|
28
16
|
str
|
29
|
-
|
17
|
+
Formatted string describing the exception.
|
30
18
|
"""
|
31
|
-
return
|
19
|
+
return str(self.args[0])
|
@@ -17,6 +17,23 @@ class Workers(IWorkers):
|
|
17
17
|
"""
|
18
18
|
|
19
19
|
def __init__(self, ram_per_worker: float = 0.5):
|
20
|
+
"""
|
21
|
+
Initialize the worker system with resource constraints.
|
22
|
+
|
23
|
+
Parameters
|
24
|
+
----------
|
25
|
+
ram_per_worker : float, optional
|
26
|
+
Amount of RAM (in GB) allocated per worker. Default is 0.5.
|
27
|
+
|
28
|
+
Attributes
|
29
|
+
----------
|
30
|
+
_cpu_count : int
|
31
|
+
Number of CPU cores available on the system.
|
32
|
+
_ram_total_gb : float
|
33
|
+
Total system RAM in gigabytes.
|
34
|
+
_ram_per_worker : float
|
35
|
+
RAM allocated per worker in gigabytes.
|
36
|
+
"""
|
20
37
|
self._cpu_count = multiprocessing.cpu_count()
|
21
38
|
self._ram_total_gb = psutil.virtual_memory().total / (1024 ** 3)
|
22
39
|
self._ram_per_worker = ram_per_worker
|
@@ -2,22 +2,18 @@ class OrionisStdValueException(Exception):
|
|
2
2
|
|
3
3
|
def __init__(self, msg: str):
|
4
4
|
"""
|
5
|
-
Initialize the exception with a custom error message.
|
6
|
-
|
7
5
|
Parameters
|
8
6
|
----------
|
9
7
|
msg : str
|
10
|
-
|
8
|
+
Descriptive error message explaining the cause of the exception.
|
11
9
|
"""
|
12
10
|
super().__init__(msg)
|
13
11
|
|
14
12
|
def __str__(self) -> str:
|
15
13
|
"""
|
16
|
-
Return a string representation of the exception, including the class name and the first argument.
|
17
|
-
|
18
14
|
Returns
|
19
15
|
-------
|
20
16
|
str
|
21
|
-
|
17
|
+
Formatted string describing the exception.
|
22
18
|
"""
|
23
|
-
return
|
19
|
+
return str(self.args[0])
|
@@ -14,6 +14,6 @@ class OrionisTestConfigException(Exception):
|
|
14
14
|
Returns
|
15
15
|
-------
|
16
16
|
str
|
17
|
-
Formatted string describing the exception
|
17
|
+
Formatted string describing the exception.
|
18
18
|
"""
|
19
|
-
return
|
19
|
+
return str(self.args[0])
|
@@ -42,11 +42,9 @@ class OrionisTestFailureException(Exception):
|
|
42
42
|
|
43
43
|
def __str__(self) -> str:
|
44
44
|
"""
|
45
|
-
Return a string representation of the exception.
|
46
|
-
|
47
45
|
Returns
|
48
46
|
-------
|
49
47
|
str
|
50
|
-
|
48
|
+
Formatted string describing the exception.
|
51
49
|
"""
|
52
|
-
return
|
50
|
+
return str(self.args[0])
|
@@ -2,8 +2,6 @@ class OrionisTestPersistenceError(Exception):
|
|
2
2
|
|
3
3
|
def __init__(self, msg: str):
|
4
4
|
"""
|
5
|
-
Initialize the OrionisTestPersistenceError with a specific error message.
|
6
|
-
|
7
5
|
Parameters
|
8
6
|
----------
|
9
7
|
msg : str
|
@@ -13,12 +11,9 @@ class OrionisTestPersistenceError(Exception):
|
|
13
11
|
|
14
12
|
def __str__(self) -> str:
|
15
13
|
"""
|
16
|
-
Returns a formatted string representation of the exception.
|
17
|
-
|
18
14
|
Returns
|
19
15
|
-------
|
20
16
|
str
|
21
|
-
|
22
|
-
name and the error message.
|
17
|
+
Formatted string describing the exception.
|
23
18
|
"""
|
24
|
-
return
|
19
|
+
return str(self.args[0])
|
@@ -5,7 +5,7 @@ class OrionisTestRuntimeError(Exception):
|
|
5
5
|
Parameters
|
6
6
|
----------
|
7
7
|
msg : str
|
8
|
-
|
8
|
+
Descriptive error message explaining the cause of the exception.
|
9
9
|
"""
|
10
10
|
super().__init__(msg)
|
11
11
|
|
@@ -14,6 +14,6 @@ class OrionisTestRuntimeError(Exception):
|
|
14
14
|
Returns
|
15
15
|
-------
|
16
16
|
str
|
17
|
-
|
17
|
+
Formatted string describing the exception.
|
18
18
|
"""
|
19
|
-
return
|
19
|
+
return str(self.args[0])
|
@@ -5,7 +5,7 @@ class OrionisTestValueError(Exception):
|
|
5
5
|
Parameters
|
6
6
|
----------
|
7
7
|
msg : str
|
8
|
-
|
8
|
+
Descriptive error message explaining the cause of the exception.
|
9
9
|
"""
|
10
10
|
super().__init__(msg)
|
11
11
|
|
@@ -14,6 +14,6 @@ class OrionisTestValueError(Exception):
|
|
14
14
|
Returns
|
15
15
|
-------
|
16
16
|
str
|
17
|
-
|
17
|
+
Formatted string describing the exception.
|
18
18
|
"""
|
19
|
-
return
|
19
|
+
return str(self.args[0])
|