voly 0.0.239__py3-none-any.whl → 0.0.241__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.
voly/formulas.py CHANGED
@@ -15,14 +15,11 @@ from functools import wraps
15
15
  @catch_exception
16
16
  def vectorize_inputs(func):
17
17
  @wraps(func)
18
- def wrapper(s, *args, **kwargs):
19
- # s is always scalar
20
- all_args = list(args)
21
- input_names = func.__code__.co_varnames[1:len(all_args)+1]
22
- input_dict = dict(zip(input_names, all_args))
18
+ def wrapper(*args, **kwargs):
19
+ arg_names = func.__code__.co_varnames[:func.__code__.co_argcount]
20
+ input_dict = dict(zip(arg_names, args))
23
21
  input_dict.update(kwargs)
24
22
 
25
- # Identify vectorized vs scalar inputs
26
23
  vector_lengths = {
27
24
  k: len(v) for k, v in input_dict.items()
28
25
  if isinstance(v, (list, np.ndarray, pd.Series))
@@ -31,27 +28,23 @@ def vectorize_inputs(func):
31
28
  is_vectorized = len(vector_lengths) > 0
32
29
 
33
30
  if is_vectorized:
34
- # Check if all are of same length
35
31
  lengths = set(vector_lengths.values())
36
32
  if len(lengths) != 1:
37
33
  raise VolyError("All vectorized inputs must have the same length.")
38
34
 
39
- if any(not isinstance(v, (list, np.ndarray, pd.Series)) for v in input_dict.values()):
35
+ if any(
36
+ not isinstance(v, (list, np.ndarray, pd.Series))
37
+ for k, v in input_dict.items()
38
+ ):
40
39
  raise VolyError("Cannot mix scalar and vector inputs. Pass all as vectors or all as scalars.")
41
40
 
42
- # Proceed with vectorized call
43
41
  max_len = next(iter(lengths))
44
42
  return [
45
- func(
46
- s,
47
- *(input_dict[name][i] for name in input_names if name in input_dict),
48
- **{k: input_dict[k][i] for k in kwargs if k in input_dict}
49
- )
43
+ func(*[input_dict[name][i] for name in arg_names])
50
44
  for i in range(max_len)
51
45
  ]
52
46
  else:
53
- # All scalar inputs, call directly
54
- return func(s, *args, **kwargs)
47
+ return func(*args, **kwargs)
55
48
 
56
49
  return wrapper
57
50
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: voly
3
- Version: 0.0.239
3
+ Version: 0.0.241
4
4
  Summary: Options & volatility research package
5
5
  Author-email: Manu de Cara <manu.de.cara@gmail.com>
6
6
  License: MIT
@@ -1,7 +1,7 @@
1
1
  voly/__init__.py,sha256=8xyDk7rFCn_MOD5hxuv5cxxKZvBVRiSIM7TgaMPpwpw,211
2
2
  voly/client.py,sha256=H4BY5n1isHOqMYX-Koe8-WKBKE6zxbdDYopDF58BPBI,14533
3
3
  voly/exceptions.py,sha256=PBsbn1vNMvKcCJwwJ4lBO6glD85jo1h2qiEmD7ArAjs,92
4
- voly/formulas.py,sha256=CY4VChzEgfuc9aLkUFt3ipyot8wr_2z8K1G2Zsw4Ov8,10317
4
+ voly/formulas.py,sha256=nSXfQ1brQAs19j2Uj2JRy-h0rXB0_EXX0FOrIU14rRQ,9953
5
5
  voly/models.py,sha256=CGJQr13Uie7iwtx2hjViN9lMXeRN_uOqzp4u8NPaTlA,9282
6
6
  voly/core/__init__.py,sha256=bu6fS2I1Pj9fPPnl-zY3L7NqrZSY5Zy6NY2uMUvdhKs,183
7
7
  voly/core/charts.py,sha256=6MSU0z01fPOVSssodxdnFqchzDfupSmXq_e71WwDmVQ,12635
@@ -13,8 +13,8 @@ voly/core/rnd.py,sha256=wiZ5OIjPDf1Th5_sQ9CZG5JgAo3EL8f63T_Rj1_VP-0,13214
13
13
  voly/utils/__init__.py,sha256=E05mWatyC-PDOsCxQV1p5Xi1IgpOomxrNURyCx_gB-w,200
14
14
  voly/utils/density.py,sha256=ONpRli-IaJDgOZ2sb27HHFc9_tkkGSATKl94JODd86A,5879
15
15
  voly/utils/logger.py,sha256=4-_2bVJmq17Q0d7Rd2mPg1AeR8gxv6EPvcmBDMFWcSM,1744
16
- voly-0.0.239.dist-info/licenses/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
17
- voly-0.0.239.dist-info/METADATA,sha256=3JptsYvRPvSgmzdRLvWxggVVac9juD0EwYwLNQrLz7Y,4115
18
- voly-0.0.239.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
19
- voly-0.0.239.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
20
- voly-0.0.239.dist-info/RECORD,,
16
+ voly-0.0.241.dist-info/licenses/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
17
+ voly-0.0.241.dist-info/METADATA,sha256=wWQAgMLFY-8qj7dvBoDfP2jSbHx4TsdYTkTkYREmsL0,4115
18
+ voly-0.0.241.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
19
+ voly-0.0.241.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
20
+ voly-0.0.241.dist-info/RECORD,,
File without changes