Creating a set of quadrature nodes-weights via chaospy.generate_quadrature() with the default method (i.e., rule=clenshaw_curtis) throws an AttributeError exception
>>> cp.generate_quadrature(2, j, rule="clenshaw_curtis")
Traceback (most recent call last):
...
AttributeError: 'tuple' object has no attribute 'pop'
To Reproduce
>>> import chaospy as cp
>>> x1 = cp.Uniform(-1, 1)
>>> x2 = cp.Uniform(-1, 1)
>>> j = cp.J(x1, x2)
>>> cp.generate_quadrature(2, j, rule="clenshaw_curtis")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "site-packages/chaospy/quadrature/frontend.py", line 171, in generate_quadrature
abscissas, weights = _generate_quadrature(
File "site-packages/chaospy/quadrature/frontend.py", line 287, in _generate_quadrature
abscissas, weights = quad_function(order, dist, **parameters)
File "site-packages/chaospy/quadrature/clenshaw_curtis.py", line 67, in clenshaw_curtis
return hypercube_quadrature(
File "site-packages/chaospy/quadrature/hypercube.py", line 69, in hypercube_quadrature
order, domain, segments = align_arguments(order, domain, segments)
File "site-packages/chaospy/quadrature/hypercube.py", line 133, in align_arguments
output = [args.pop(0)]
AttributeError: 'tuple' object has no attribute 'pop'
Desktop (please complete the following information):
OS: Linux
Python version: 3.9.20
Chaospy version 4.3.16
Additional context
I suspect there's a change behavior of numpy.broadcast_arrays() from outputting a list to a tuple between versions; as such, this issue may be related to Issue #424.
Describe the bug
Creating a set of quadrature nodes-weights via
chaospy.generate_quadrature()
with the default method (i.e.,rule=clenshaw_curtis
) throws anAttributeError
exceptionTo Reproduce
Curiously, another rule seems to work just fine:
Expected behavior
I expect the output to be the quadrature nodes and weights based on the Clenshaw-Curtis rule:
Desktop (please complete the following information):
Additional context
I suspect there's a change behavior of
numpy.broadcast_arrays()
from outputting a list to a tuple between versions; as such, this issue may be related to Issue #424.