Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
daiquanyu opened this issue Apr 13, 2021 · 1 comment

Comments

@daiquanyu
Copy link

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.

@Mamba413
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants