vortex-api 2.1.6__tar.gz → 2.1.7__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.
- {vortex_api-2.1.6/vortex_api.egg-info → vortex_api-2.1.7}/PKG-INFO +1 -1
- {vortex_api-2.1.6 → vortex_api-2.1.7}/pyproject.toml +1 -1
- vortex_api-2.1.7/vortex_api/__version__.py +1 -0
- {vortex_api-2.1.6 → vortex_api-2.1.7}/vortex_api/api.py +21 -17
- {vortex_api-2.1.6 → vortex_api-2.1.7/vortex_api.egg-info}/PKG-INFO +1 -1
- vortex_api-2.1.6/vortex_api/__version__.py +0 -1
- {vortex_api-2.1.6 → vortex_api-2.1.7}/LICENSE +0 -0
- {vortex_api-2.1.6 → vortex_api-2.1.7}/README.md +0 -0
- {vortex_api-2.1.6 → vortex_api-2.1.7}/setup.cfg +0 -0
- {vortex_api-2.1.6 → vortex_api-2.1.7}/vortex_api/__init__.py +0 -0
- {vortex_api-2.1.6 → vortex_api-2.1.7}/vortex_api/backtest/__init__.py +0 -0
- {vortex_api-2.1.6 → vortex_api-2.1.7}/vortex_api/backtest/_backtestingpy.py +0 -0
- {vortex_api-2.1.6 → vortex_api-2.1.7}/vortex_api/backtest/_backtrader.py +0 -0
- {vortex_api-2.1.6 → vortex_api-2.1.7}/vortex_api/backtest/_common.py +0 -0
- {vortex_api-2.1.6 → vortex_api-2.1.7}/vortex_api/backtest/_vectorbt.py +0 -0
- {vortex_api-2.1.6 → vortex_api-2.1.7}/vortex_api/vortex_feed.py +0 -0
- {vortex_api-2.1.6 → vortex_api-2.1.7}/vortex_api.egg-info/SOURCES.txt +0 -0
- {vortex_api-2.1.6 → vortex_api-2.1.7}/vortex_api.egg-info/dependency_links.txt +0 -0
- {vortex_api-2.1.6 → vortex_api-2.1.7}/vortex_api.egg-info/requires.txt +0 -0
- {vortex_api-2.1.6 → vortex_api-2.1.7}/vortex_api.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.1.7"
|
|
@@ -111,27 +111,31 @@ class Constants:
|
|
|
111
111
|
def validate_inputs(func):
|
|
112
112
|
@wrapt.decorator
|
|
113
113
|
def wrapper(wrapped, instance, args, kwargs):
|
|
114
|
-
# Get the function signature
|
|
115
114
|
sig = inspect.signature(wrapped)
|
|
116
|
-
#
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
# Build ordered list of non-self params for positional index mapping.
|
|
116
|
+
# wrapt strips 'self' from args, so index 0 in args = first non-self param.
|
|
117
|
+
params = [(name, p) for name, p in sig.parameters.items() if name != 'self']
|
|
118
|
+
|
|
119
|
+
for idx, (param_name, param) in enumerate(params):
|
|
120
120
|
param_type = param.annotation
|
|
121
121
|
if param_type is inspect.Parameter.empty:
|
|
122
122
|
continue
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
123
|
+
|
|
124
|
+
# Resolve value: check kwargs first, then positional args
|
|
125
|
+
if param_name in kwargs:
|
|
126
|
+
value = kwargs[param_name]
|
|
127
|
+
elif idx < len(args):
|
|
128
|
+
value = args[idx]
|
|
129
|
+
elif param.default is not inspect.Parameter.empty:
|
|
130
|
+
continue # has a default, skip validation
|
|
131
|
+
else:
|
|
132
|
+
raise TypeError(f"missing required argument: '{param_name}'")
|
|
133
|
+
|
|
134
|
+
if isinstance(param_type, Enum) and value not in param_type.__members__.values():
|
|
135
|
+
raise ValueError(f'{param_name} must be one of {list(param_type.__members__.values())}')
|
|
136
|
+
if not isinstance(value, param_type):
|
|
137
|
+
raise TypeError(f'{param_name} must be of type {param_type.__name__}')
|
|
138
|
+
|
|
135
139
|
return wrapped(*args, **kwargs)
|
|
136
140
|
|
|
137
141
|
return wrapper(func)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.1.6"
|
|
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
|