Ball icon indicating copy to clipboard operation
Ball copied to clipboard

Linux-AttributeError: module 'Ball._cball' has no attribute 'doubleArray_swiginit'

Open daiquanyu opened this issue 3 years ago • 1 comments

I successfully install the package in linux, but found the error while running the toy example provided in the code. Besides, I can successfully run the demo in windows.

The original code is as follows:


import Ball as ball import numpy as np import math

np.random.seed(2)

#%% both x, y are numeric vector n = 50 error = np.random.uniform(-0.3, 0.3, n) x = np.random.uniform(0, 4*math.pi, n) y = np.cos(x) + error a = ball.bcov_test(x, y)


The original log is as follows:


Traceback (most recent call last): File "Ball_test.py", line 19, in a = ball.bcov_test(x, y) File "/home/daiquanyu/anaconda3/envs/reco_gpu/lib/python3.6/site-packages/Ball/bcov.py", line 102, in bcov_test bcov_stat, bcov_pvalue = bcov_test_wrap_c(args[0], args[1], n, num_permutations, distance, num_thread) File "/home/daiquanyu/anaconda3/envs/reco_gpu/lib/python3.6/site-packages/Ball/wrap_c.py", line 96, in bcov_test_wrap_c bcov_stat = doubleArray(3) File "/home/daiquanyu/anaconda3/envs/reco_gpu/lib/python3.6/site-packages/Ball/cball.py", line 69, in init _cball.doubleArray_swiginit(self, _cball.new_doubleArray(nelements)) AttributeError: module 'Ball._cball' has no attribute 'doubleArray_swiginit'


Look forward to your reply. Thanks.

daiquanyu avatar Apr 13 '21 07:04 daiquanyu

I think this problem might come from the setting of SWIG in Linux, and I need some time to fix it. I suggest to use rpy2 (https://rpy2.github.io/doc/v2.9.x/html/introduction.html) to call R command for bcov.test.

Mamba413 avatar Apr 22 '21 08:04 Mamba413