Open mbaudin47 opened 4 weeks ago
It seems that the bug was already fixed in numpoly
by @gboehl:
https://github.com/jonathf/numpoly/commit/ce854b4e24293e594238d06bbf3ad43fdf370896
I just updated numpoly
. Update to 1.2.13 and this should be resolved.
Let me know if it doesn't solve the issue.
Thank you very much for solving that issue. It seems to me that the library now fails a little later, with generate_quadrature
:
nodes, weights = chaospy.generate_quadrature(
File "/home/circleci/.pyenv/versions/3.10.14/lib/python3.10/site-packages/chaospy/quadrature/frontend.py", line 152, in generate_quadrature
return sparse_grid(
File "/home/circleci/.pyenv/versions/3.10.14/lib/python3.10/site-packages/chaospy/quadrature/sparse_grid.py", line 81, in sparse_grid
x_lookup, w_lookup = _construct_lookup(
File "/home/circleci/.pyenv/versions/3.10.14/lib/python3.10/site-packages/chaospy/quadrature/sparse_grid.py", line 144, in _construct_lookup
(abscissas,), weights = chaospy.generate_quadrature(
File "/home/circleci/.pyenv/versions/3.10.14/lib/python3.10/site-packages/chaospy/quadrature/frontend.py", line 171, in generate_quadrature
abscissas, weights = _generate_quadrature(
File "/home/circleci/.pyenv/versions/3.10.14/lib/python3.10/site-packages/chaospy/quadrature/frontend.py", line 287, in _generate_quadrature
abscissas, weights = quad_function(order, dist, **parameters)
File "/home/circleci/.pyenv/versions/3.10.14/lib/python3.10/site-packages/chaospy/quadrature/gaussian.py", line 81, in gaussian
coefficients = chaospy.construct_recurrence_coefficients(
File "/home/circleci/.pyenv/versions/3.10.14/lib/python3.10/site-packages/chaospy/recurrence/frontend.py", line 117, in construct_recurrence_coefficients
coeffs, _, _ = stieltjes(order, dist, rule=rule, tolerance=tolerance)
File "/home/circleci/.pyenv/versions/3.10.14/lib/python3.10/site-packages/chaospy/recurrence/stieltjes.py", line 68, in stieltjes
return analytical_stieltjes(order=order, dist=dist)
File "/home/circleci/.pyenv/versions/3.10.14/lib/python3.10/site-packages/chaospy/recurrence/stieltjes.py", line 165, in analytical_stieltjes
coeffs = dist.ttr(mom_order)
File "/home/circleci/.pyenv/versions/3.10.14/lib/python3.10/site-packages/chaospy/distributions/baseclass/distribution.py", line 721, in ttr
out[:, idx, idy] = self._get_ttr(kloc_[idx], idx)
File "/home/circleci/.pyenv/versions/3.10.14/lib/python3.10/site-packages/chaospy/distributions/baseclass/distribution.py", line 735, in _get_ttr
alpha = numpy.asfarray(alpha).item()
File "/home/circleci/.pyenv/versions/3.10.14/lib/python3.10/site-packages/numpy/__init__.py", line 397, in __getattr__
raise AttributeError(
AttributeError: `np.asfarray` was removed in the NumPy 2.0 release. Use `np.asarray` with a proper dtype instead.. Did you mean: 'asarray'?
Is that correct from your point of view?
I resolved this issue in #425 but there are some other checks that are still failing.
Describe the bug Importing the module makes Python fail when
chaospy
is installed frompip
usingnumpy
2.0. It is likely to be a problem related to the support of numpy 2.0 innumpoly
.To Reproduce Provide a minimal code example that reproduces the error.
Expected behavior A clear and concise description of what you expected to happen. If an exception is raised, please provide the exception traceback.
Desktop (please complete the following information):
Additional context Add any other context about the problem here. I installed chaospy using pip. Here are the versions used from the log: