UQTk icon indicating copy to clipboard operation
UQTk copied to clipboard

pytests out of date in release 3.1.2

Open omsai opened this issue 1 year ago • 11 comments

Looks like minor changes to the pytests are necessary like changing import PyUQTk.array as uqtkarray to from PyUQTk import uqtkarray etc:

$ spack load [email protected] +pyuqtk
$ git clone --depth=1 https://github.com/sandialabs/UQTk.git -b v3.1.2
$ cd UQTk/PyUQTk/pytests/
$ for file in *.py; do echo "=== $file ==="; python3 $file 1>/dev/null; done
=== PyArrayTest2.py ===
=== PyArrayTest.py ===
=== PyBADPTest.py ===
Traceback (most recent call last):
  File "/home/pnanda/src/UQTk/PyUQTk/pytests/PyBADPTest.py", line 137, in <module>
    pc_model0, c_k0, totquat0 = forward_propagation(mu, sigma, \
  File "/home/pnanda/src/UQTk/PyUQTk/pytests/PyBADPTest.py", line 85, in forward_propagation
    qdpts, totquat= pce_tools.UQTkGetQuadPoints(pc_model)
NameError: name 'pce_tools' is not defined
=== PyBCSTest1D.py ===
=== PyBCSTest2D.py ===
=== PyBCSTest.py ===
Traceback (most recent call last):
  File "/home/pnanda/src/UQTk/PyUQTk/pytests/PyBCSTest.py", line 105, in <module>
    regmodel = bcs.bcsreg(ndim=2,pcorder=pcorder,pctype="LU")
NameError: name 'bcs' is not defined
=== PyHMCMCTest.py ===
Traceback (most recent call last):
  File "/home/pnanda/src/UQTk/PyUQTk/pytests/PyHMCMCTest.py", line 118, in <module>
    qz =  exp(-U(array(zip(qx.flatten(),qy.flatten()))))
  File "/home/pnanda/src/UQTk/PyUQTk/pytests/PyHMCMCTest.py", line 57, in U
    return b*(q[:,1] - q[:,0]**2)**2 + (a - q[:,0])**2
IndexError: index 1 is out of bounds for axis 1 with size 1
=== PyMCMC2dTest.py ===
Traceback (most recent call last):
  File "/home/pnanda/src/UQTk/PyUQTk/pytests/PyMCMC2dTest.py", line 52, in <module>
    class pyLikelihood(uqtkmcmc.LikelihoodBase):
NameError: name 'uqtkmcmc' is not defined
=== PyMCMCTest.py ===
Traceback (most recent call last):
  File "/home/pnanda/src/UQTk/PyUQTk/pytests/PyMCMCTest.py", line 64, in <module>
    class pyLikelihood(uqtkmcmc.LikelihoodBase):
NameError: name 'uqtkmcmc' is not defined
=== PyModTest.py ===
Traceback (most recent call last):
  File "/home/pnanda/src/UQTk/PyUQTk/pytests/PyModTest.py", line 52, in <module>
    import _tools
ImportError: /home/pnanda/spack/opt/spack/linux-ubuntu18.04-westmere/gcc-11.3.0/uqtk-3.1.2-kfxhs7iftxrsy5isacage3clpadbtteo/PyUQTk/_tools.cpython-39-x86_64-linux-gnu.so: undefined symbol: _gfortran_transfer_character_write
=== PyPCE1dTest.py ===
Traceback (most recent call last):
  File "/home/pnanda/src/UQTk/PyUQTk/pytests/PyPCE1dTest.py", line 49, in <module>
    x = uqtkarray.dblArray2D()
NameError: name 'uqtkarray' is not defined
=== PyPCE2dTest.py ===
Traceback (most recent call last):
  File "/home/pnanda/src/UQTk/PyUQTk/pytests/PyPCE2dTest.py", line 49, in <module>
    x = uqtkarray.dblArray2D()
NameError: name 'uqtkarray' is not defined
=== PyQuadTest.py ===
$ grep import PyPCE1dTest.py 
from __future__ import print_function # To make print() in Python 2 behave like in Python 3
import sys
	from numpy import *
	from matplotlib.pyplot import *
	import PyUQTk.array as uqtkarray
	import PyUQTk.quad as uqtkquad
	import PyUQTk.pce as uqtkpce
$ python3
Python 3.9.13 (main, Jun 15 2022, 19:27:16) 
[GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyUQTk.array
Scipy and/or matplotlib may need to be installed
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'PyUQTk.array'
>>> import PyUQTk.quad
>>> import PyUQTk.pce
>>> from numpy import *
>>> from matplotlib.pyplot import *
$ python3
Python 3.9.13 (main, Jun 15 2022, 19:27:16) 
[GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyUQTk import uqtkarray
Scipy and/or matplotlib may need to be installed
>>> 

omsai avatar Feb 28 '23 19:02 omsai