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

test failed due to cannot import name 'rand' from 'scipy' #62

Open
yuzibo opened this issue Jun 25, 2024 · 0 comments
Open

test failed due to cannot import name 'rand' from 'scipy' #62

yuzibo opened this issue Jun 25, 2024 · 0 comments

Comments

@yuzibo
Copy link

yuzibo commented Jun 25, 2024

Hi,

From Debian build log, we got:

...
> Traceback (most recent call last):
>   File "/<<PKGBUILDDIR>>/interface/tests/python/./check_levelset.py", line 30, in <module>
>     from scipy import rand
> ImportError: cannot import name 'rand' from 'scipy' (/usr/lib/python3/dist-packages/scipy/__init__.py)
> FAIL check_levelset.py (exit status: 1)

I have proposed one patch to fix the issue:

--- a/interface/tests/python/check_levelset.py
+++ b/interface/tests/python/check_levelset.py
@@ -27,7 +27,6 @@
   $Id$
 """
 import numpy as np
-from scipy import rand

 import getfem as gf

@@ -76,7 +75,7 @@

 if True:
   sl = gf.Slice(('none',), mls, 2);
-  U = rand(1,nbd);
+  U = np.random.rand(1,nbd);
   sl.export_to_pos('slU.pos',mfls,U,'U')
   mfls.export_to_pos('U.pos',U,'U')
   cm.export_to_pos('cm.pos')

Please help to review it.

TIA.

BR,
Bo

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

1 participant