8000 alpha83 报错 · Issue #7 · wukan1986/ta_cn · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
alpha83 报错 #7
Open
Open
@0xhhh321321

Description

@0xhhh321321
Traceback (most recent call last):
  File "/Users/xxx/code/futudata/main.py", line 46, in <module>
    ret = func(**kwargs)
  File "/Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/ta_cn/alphas/alpha191.py", line 622, in alpha_083
    t1 = COVIANCE(RANK(HIGH), RANK(VOLUME), 5)
  File "/Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/ta_cn/utils_long.py", line 88, in decorated
    s3 = s2.groupby(by=by, group_keys=False).apply(to_pd(dataframe_split(func)), **_kwargs)
  File "/Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/pandas/core/groupby/groupby.py", line 1423, in apply
    result = self._python_apply_general(f, self._selected_obj)
  File "/Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/pandas/core/groupby/groupby.py", line 1464, in _python_apply_general
    values, mutated = self.grouper.apply(f, data, self.axis)
  File "/Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/pandas/core/groupby/ops.py", line 761, in apply
    res = f(group)
  File "/Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/pandas/core/groupby/groupby.py", line 1397, in f
    return func(g, *args, **kwargs)
  File "/Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/ta_cn/utils.py", line 14, in decorated
    return np_to_pd(func(*args, **kwargs),
  File "/Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/ta_cn/utils_long.py", line 107, in decorated
    return func(*args_input, *args, **kwargs_input, **kwargs)
  File "/Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/ta_cn/statistics.py", line 79, in COVAR
    return numpy_rolling_apply([pd_to_np(real0), pd_to_np(real1)],
  File "/Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/ta_cn/nb.py", line 289, in numpy_rolling_apply
    return func1(*arrs, out, window, func2, *args)
  File "/Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/numba/core/dispatcher.py", line 468, in _compile_for_args
    error_rewrite(e, 'typing')
  File "/Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/numba/core/dispatcher.py", line 409, in error_rewrite
    raise e.with_traceback(None)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<function cov at 0x10408ecb0>) found for signature:
 
 >>> cov(readonly array(float64, 1d, A), readonly array(float64, 1d, A))
 
There are 2 candidate implementations:
  - Of which 2 did not match due to:
  Overload in function 'np_cov': File: numba/np/arraymath.py: Line 2888.
    With argument(s): '(readonly array(float64, 1d, A), readonly array(float64, 1d, A))':
   Rejected as the implementation raised a specific error:
     TypingError: Failed in nopython mode pipeline (step: nopython frontend)
   No implementation of function Function(<function np_cov_impl_inner at 0x148201240>) found for signature:
    
    >>> np_cov_impl_inner(array(float64, 2d, C), Literal[bool](False), none)
    
   There are 2 candidate implementations:
         - Of which 2 did not match due to:
         Overload in function 'register_jitable.<locals>.wrap.<locals>.ov_wrap': File: numba/core/extending.py: Line 159.
           With argument(s): '(array(float64, 2d, C), bool, none)':
          Rejected as the implementation raised a specific error:
            TypingError: Failed in nopython mode pipeline (step: nopython frontend)
          No implementation of function Function(<function dot at 0x103259870>) found for signature:
           
           >>> dot(array(float64, 2d, C), array(float64, 2d, F))
           
          There are 4 candidate implementations:
                - Of which 4 did not match due to:
                Overload in function '_OverloadWrapper._build.<locals>.ol_generated': File: numba/core/overload_glue.py: Line 131.
                  With argument(s): '(array(float64, 2d, C), array(float64, 2d, F))':
                 Rejected as the implementation raised a specific error:
                   LoweringError: Failed in nopython mode pipeline (step: native lowering)
                 scipy 0.16+ is required for linear algebra
                 
                 File "<string>", line 3:
                 <source missing, REPL/exec in use?>
                 
                 During: lowering "$8call_function.3 = call $2load_global.0(tmp0, tmp1, func=$2load_global.0, args=[Var(tmp0, <string>:3), Var(tmp1, <string>:3)], kws=(), vararg=None, target=None)" at <string> (3)
            raised from /Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/numba/core/errors.py:837
          
          During: resolving callee type: Function(<function dot at 0x103259870>)
          During: typing of call at /Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/numba/np/arraymath.py (2739)
          
          
          File "../../.conda/envs/futudata/lib/python3.10/site-packages/numba/np/arraymath.py", line 2739:
          def np_cov_impl_inner(X, bias, ddof):
              <source elided>
              # calculate result - requires blas
              c = np.dot(X, np.conj(X.T))
              ^
   
     raised from /Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/numba/core/typeinfer.py:1086
   
   During: resolving callee type: Function(<function np_cov_impl_inner at 0x148201240>)
   During: typing of call at /Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/numba/np/arraymath.py (2927)
   
   
   File "../../.conda/envs/futudata/lib/python3.10/site-packages/numba/np/arraymath.py", line 2927:
       def np_cov_impl(m, y=None, rowvar=True, bias=False, ddof=None):
           <source elided>
           else:
               return np_cov_impl_inner(X, bias, ddof)
               ^

  raised from /Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/numba/core/typeinfer.py:1086

During: resolving callee type: Function(<function cov at 0x10408ecb0>)
During: typing of call at /Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/ta_cn/nb.py (207)


File "../../.conda/envs/futudata/lib/python3.10/site-packages/ta_cn/nb.py", line 207:
def _cov_nb(arr0, arr1):
    <source elided>
    """协方差矩阵"""
    return _np.cov(arr0, arr1)[0, 1]
    ^

During: resolving callee type: type(CPUDispatcher(<function _cov_nb at 0x13709edd0>))
During: typing of call at /Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/ta_cn/nb.py (239)

During: resolving callee type: type(CPUDispatcher(<function _cov_nb at 0x13709edd0>))
During: typing of call at /Users/xxx/.conda/envs/futudata/lib/python3.10/site-packages/ta_cn/nb.py (239)


File "../../.conda/envs/futudata/lib/python3.10/site-packages/ta_cn/nb.py", line 239:
def _rolling_func_2_nb(arr0, arr1, out, timeperiod, func, *args):
    <source elided>
        for i, (a, b) in enumerate(zip(arr0, arr1)):
            out[i + timeperiod - 1] = func(a, b, *args)
            ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0