[packages/python3-scipy] - updated to 1.4.1 - updated numpy-deprecation-warnings patch - build docs (require Sphinx 2 now)
qboosh
qboosh at pld-linux.org
Wed Apr 8 19:23:19 CEST 2020
commit 18ff5e120acce2c4ef36b33355402a3b9949bdd6
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Apr 8 19:23:19 2020 +0200
- updated to 1.4.1
- updated numpy-deprecation-warnings patch
- build docs (require Sphinx 2 now)
numpy-deprecation-warnings.patch | 587 +--------------------------------------
python3-scipy.spec | 56 ++--
2 files changed, 42 insertions(+), 601 deletions(-)
---
diff --git a/python3-scipy.spec b/python3-scipy.spec
index ef76d66..67bfb6a 100644
--- a/python3-scipy.spec
+++ b/python3-scipy.spec
@@ -3,41 +3,44 @@
# - tests
#
# Conditional build:
-%bcond_with doc # Sphinx documentation
+%bcond_without doc # Sphinx documentation
%define module scipy
Summary: A library of scientific tools
Summary(pl.UTF-8): Biblioteka narzędzi naukowych
Name: python3-%{module}
-Version: 1.3.1
+Version: 1.4.1
Release: 1
License: BSD
Group: Development/Languages/Python
#Source0Download: https://github.com/scipy/scipy/releases/
-Source0: https://github.com/scipy/scipy/releases/download/v%{version}/%{module}-%{version}.tar.gz
-# Source0-md5: 69db58ceb4b4c3ff3f3ea816e4e426b9
+Source0: https://github.com/scipy/scipy/releases/download/v%{version}/%{module}-%{version}.tar.xz
+# Source0-md5: 27608d42755c1acb097c7ab3616aafe0
Patch0: numpy-deprecation-warnings.patch
URL: https://www.scipy.org/
BuildRequires: blas-devel >= 3.6.0
BuildRequires: gcc-fortran
BuildRequires: lapack-devel >= 3.6.0
BuildRequires: rpmbuild(macros) >= 1.714
-BuildRequires: f2py3 >= 1:1.8.2
+BuildRequires: f2py3 >= 1:1.13.3
BuildRequires: python3 >= 1:3.5
-BuildRequires: python3-devel >= 1:3.4
+BuildRequires: python3-devel >= 1:3.5
BuildRequires: python3-numpy >= 1:1.13.3
BuildRequires: python3-numpy-devel >= 1:1.13.3
+BuildRequires: python3-pybind11 >= 2.4.0
BuildRequires: python3-setuptools
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz
%if %{with doc}
BuildRequires: pydoc3
# matplotlib.sphinxext.plot_directive.__version__ >= 2
BuildRequires: python3-matplotlib >= 1.1.0
-BuildRequires: sphinx-pdg-3 >= 1.6
+BuildRequires: sphinx-pdg-3 >= 2.0
%endif
Requires: lapack >= 3.6.0
Requires: python3-modules >= 1:3.5
Requires: python3-numpy >= 1:1.13.3
-Suggests: python3-PIL
+Suggests: python3-pillow
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -81,7 +84,7 @@ export LAPACK=%{_libdir}
%if %{with doc}
LANG=C \
PYTHONPATH=$(readlink -f build-3/lib.*) \
-%{__make} -C doc html \
+%{__make} -C doc html-build \
SPHINXBUILD=sphinx-build-3
%endif
@@ -94,6 +97,12 @@ export LAPACK=%{_libdir}
%py3_install
%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/*.txt
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/_lib/_uarray/LICENSE
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/fft/_pocketfft/LICENSE.md
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/linalg/src/{id_dist/doc/doc.tex,lapack_deprecations/LICENSE}
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/optimize/lbfgsb_src/README
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/sparse/linalg/{dsolve/SuperLU/License.txt,eigen/arpack/ARPACK/COPYING}
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/spatial/qhull_src/COPYING.txt
%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/*/tests
%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/*/*/tests
%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/*/*/*/tests
@@ -104,7 +113,7 @@ rm -rf $RPM_BUILD_ROOT
%files -n python3-%{module}
%defattr(644,root,root,755)
-%doc INSTALL.rst.txt LICENSE.txt THANKS.txt doc/README.txt
+%doc INSTALL.rst.txt LICENSE.txt THANKS.txt doc/{API.rst.txt,README.md,ROADMAP.rst.txt}
%dir %{py3_sitedir}/%{module}
%{py3_sitedir}/%{module}/*.py
%{py3_sitedir}/%{module}/__pycache__
@@ -112,6 +121,17 @@ rm -rf $RPM_BUILD_ROOT
%dir %{py3_sitedir}/%{module}/_build_utils
%{py3_sitedir}/%{module}/_build_utils/*.py
%{py3_sitedir}/%{module}/_build_utils/__pycache__
+%dir %{py3_sitedir}/%{module}/_lib
+%attr(755,root,root) %{py3_sitedir}/%{module}/_lib/_ccallback_c.*.so
+%attr(755,root,root) %{py3_sitedir}/%{module}/_lib/_fpumode.*.so
+%attr(755,root,root) %{py3_sitedir}/%{module}/_lib/_test_ccallback.*.so
+%attr(755,root,root) %{py3_sitedir}/%{module}/_lib/messagestream.*.so
+%{py3_sitedir}/%{module}/_lib/*.py
+%{py3_sitedir}/%{module}/_lib/__pycache__
+%dir %{py3_sitedir}/%{module}/_lib/_uarray
+%attr(755,root,root) %{py3_sitedir}/%{module}/_lib/_uarray/_uarray.cpython-*.so
+%{py3_sitedir}/%{module}/_lib/_uarray/*.py
+%{py3_sitedir}/%{module}/_lib/_uarray/__pycache__
%dir %{py3_sitedir}/%{module}/cluster
%attr(755,root,root) %{py3_sitedir}/%{module}/cluster/*.so
%{py3_sitedir}/%{module}/cluster/*.py
@@ -119,6 +139,13 @@ rm -rf $RPM_BUILD_ROOT
%dir %{py3_sitedir}/%{module}/constants
%{py3_sitedir}/%{module}/constants/*.py
%{py3_sitedir}/%{module}/constants/__pycache__
+%dir %{py3_sitedir}/%{module}/fft
+%{py3_sitedir}/%{module}/fft/*.py
+%{py3_sitedir}/%{module}/fft/__pycache__
+%dir %{py3_sitedir}/%{module}/fft/_pocketfft
+%attr(755,root,root) %{py3_sitedir}/%{module}/fft/_pocketfft/pypocketfft.cpython-*.so
+%{py3_sitedir}/%{module}/fft/_pocketfft/*.py
+%{py3_sitedir}/%{module}/fft/_pocketfft/__pycache__
%dir %{py3_sitedir}/%{module}/fftpack
%attr(755,root,root) %{py3_sitedir}/%{module}/fftpack/*.so
%{py3_sitedir}/%{module}/fftpack/*.py
@@ -148,13 +175,6 @@ rm -rf $RPM_BUILD_ROOT
%dir %{py3_sitedir}/%{module}/io/harwell_boeing
%{py3_sitedir}/%{module}/io/harwell_boeing/*.py
%{py3_sitedir}/%{module}/io/harwell_boeing/__pycache__
-%dir %{py3_sitedir}/%{module}/_lib
-%{py3_sitedir}/%{module}/_lib/*.py
-%{py3_sitedir}/%{module}/_lib/__pycache__
-%attr(755,root,root) %{py3_sitedir}/%{module}/_lib/_ccallback_c.*.so
-%attr(755,root,root) %{py3_sitedir}/%{module}/_lib/_fpumode.*.so
-%attr(755,root,root) %{py3_sitedir}/%{module}/_lib/_test_ccallback.*.so
-%attr(755,root,root) %{py3_sitedir}/%{module}/_lib/messagestream.*.so
%dir %{py3_sitedir}/%{module}/linalg
%{py3_sitedir}/%{module}/linalg/*.pxd
%attr(755,root,root) %{py3_sitedir}/%{module}/linalg/*.so
@@ -259,5 +279,5 @@ rm -rf $RPM_BUILD_ROOT
%if %{with doc}
%files apidocs
%defattr(644,root,root,755)
-%doc doc/build/html/*
+%doc doc/build/html/{_images,_static,generated,tutorial,*.html,*.js}
%endif
diff --git a/numpy-deprecation-warnings.patch b/numpy-deprecation-warnings.patch
index 5099879..62c712d 100644
--- a/numpy-deprecation-warnings.patch
+++ b/numpy-deprecation-warnings.patch
@@ -1,589 +1,10 @@
-diff -ru scipy-1.2.1/scipy/odr/__odrpack.c scipy-1.2.1_patched/scipy/odr/__odrpack.c
---- scipy-1.2.1/scipy/odr/__odrpack.c 2019-01-28 04:57:51.000000000 +0100
-+++ scipy-1.2.1_patched/scipy/odr/__odrpack.c 2019-06-06 16:11:32.947892754 +0200
-@@ -9,6 +9,8 @@
- *
+--- scipy-1.4.1/scipy/odr/__odrpack.c.orig 2019-12-18 20:27:46.000000000 +0100
++++ scipy-1.4.1/scipy/odr/__odrpack.c 2020-04-01 21:34:52.050513623 +0200
+@@ -10,6 +10,7 @@
*/
-+#define PY_SSIZE_T_CLEAN
+ #define PY_SSIZE_T_CLEAN
+#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include "odrpack.h"
-@@ -44,7 +46,7 @@
- double *fjacb, double *fjacd, int *istop)
- {
- PyObject *arg01, *arglist;
-- PyObject *result;
-+ PyObject *result = NULL;
- PyArrayObject *result_array = NULL;
- PyArrayObject *pyXplusD;
- void *beta_dst;
-@@ -57,14 +59,14 @@
- dim2[0] = *m;
- dim2[1] = *n;
- pyXplusD = (PyArrayObject *) PyArray_SimpleNew(2, dim2, NPY_DOUBLE);
-- memcpy(pyXplusD->data, (void *)xplusd, (*m) * (*n) * sizeof(double));
-+ memcpy(PyArray_DATA(pyXplusD), (void *)xplusd, (*m) * (*n) * sizeof(double));
- }
- else
- {
- npy_intp dim1[1];
- dim1[0] = *n;
- pyXplusD = (PyArrayObject *) PyArray_SimpleNew(1, dim1, NPY_DOUBLE);
-- memcpy(pyXplusD->data, (void *)xplusd, (*n) * sizeof(double));
-+ memcpy(PyArray_DATA(pyXplusD), (void *)xplusd, (*n) * sizeof(double));
- }
-
- PyTuple_SetItem(arg01, 0, odr_global.pyBeta);
-@@ -84,7 +86,7 @@
- Py_DECREF(arg01);
- *istop = 0;
-
-- beta_dst = ((PyArrayObject *) (odr_global.pyBeta))->data;
-+ beta_dst = (PyArray_DATA((PyArrayObject *) odr_global.pyBeta));
- if (beta != beta_dst) {
- memcpy(beta_dst, (void *)beta, (*np) * sizeof(double));
- }
-@@ -121,7 +123,7 @@
- "Result from function call is not a proper array of floats.");
- }
-
-- memcpy((void *)f, result_array->data, (*n) * (*nq) * sizeof(double));
-+ memcpy((void *)f, PyArray_DATA(result_array), (*n) * (*nq) * sizeof(double));
- Py_DECREF(result_array);
- }
-
-@@ -161,7 +163,7 @@
- {
- /* result_array should be rank-3 */
-
-- if (result_array->nd != 3)
-+ if (PyArray_NDIM(result_array) != 3)
- {
- Py_DECREF(result_array);
- PYERR2(odr_error, "Beta Jacobian is not rank-3");
-@@ -171,14 +173,14 @@
- {
- /* result_array should be rank-2 */
-
-- if (result_array->nd != 2)
-+ if (PyArray_NDIM(result_array) != 2)
- {
- Py_DECREF(result_array);
- PYERR2(odr_error, "Beta Jacobian is not rank-2");
- }
- }
-
-- memcpy((void *)fjacb, result_array->data,
-+ memcpy((void *)fjacb, PyArray_DATA(result_array),
- (*n) * (*nq) * (*np) * sizeof(double));
- Py_DECREF(result_array);
-
-@@ -220,7 +222,7 @@
- {
- /* result_array should be rank-3 */
-
-- if (result_array->nd != 3)
-+ if (PyArray_NDIM(result_array) != 3)
- {
- Py_DECREF(result_array);
- PYERR2(odr_error, "xplusd Jacobian is not rank-3");
-@@ -230,7 +232,7 @@
- {
- /* result_array should be rank-2 */
-
-- if (result_array->nd != 2)
-+ if (PyArray_NDIM(result_array) != 2)
- {
- Py_DECREF(result_array);
- PYERR2(odr_error, "xplusd Jacobian is not rank-2");
-@@ -240,14 +242,14 @@
- {
- /* result_array should be rank-1 */
-
-- if (result_array->nd != 1)
-+ if (PyArray_NDIM(result_array) != 1)
- {
- Py_DECREF(result_array);
- PYERR2(odr_error, "xplusd Jacobian is not rank-1");
- }
- }
-
-- memcpy((void *)fjacd, result_array->data,
-+ memcpy((void *)fjacd, PyArray_DATA(result_array),
- (*n) * (*nq) * (*m) * sizeof(double));
- Py_DECREF(result_array);
- }
-@@ -291,7 +293,7 @@
- return NULL;
- }
-
-- lwkmn = work->dimensions[0];
-+ lwkmn = PyArray_DIMS(work)[0];
-
- F_FUNC(dwinf,DWINF)(&n, &m, &np, &nq, &ldwe, &ld2we, &isodr,
- &delta, &eps, &xplus, &fn, &sd, &vcv, &rvar, &wss, &wssde,
-@@ -352,15 +354,15 @@
- wrk6--;
- wrk7--;
-
-- dim1[0] = beta->dimensions[0];
-+ dim1[0] = PyArray_DIMS(beta)[0];
- sd_beta = (PyArrayObject *) PyArray_SimpleNew(1, dim1, NPY_DOUBLE);
-- dim2[0] = beta->dimensions[0];
-- dim2[1] = beta->dimensions[0];
-+ dim2[0] = PyArray_DIMS(beta)[0];
-+ dim2[1] = PyArray_DIMS(beta)[0];
- cov_beta = (PyArrayObject *) PyArray_SimpleNew(2, dim2, NPY_DOUBLE);
-
-- memcpy(sd_beta->data, (void *)((double *)(work->data) + sd),
-+ memcpy(PyArray_DATA(sd_beta), (void *)((double *)(PyArray_DATA(work)) + sd),
- np * sizeof(double));
-- memcpy(cov_beta->data, (void *)((double *)(work->data) + vcv),
-+ memcpy(PyArray_DATA(cov_beta), (void *)((double *)(PyArray_DATA(work)) + vcv),
- np * np * sizeof(double));
-
- if (!full_output)
-@@ -427,21 +429,21 @@
- fnA = (PyArrayObject *) PyArray_SimpleNew(2, dim2, NPY_DOUBLE);
- }
-
-- memcpy(deltaA->data, (void *)((double *)(work->data) + delta),
-+ memcpy(PyArray_DATA(deltaA), (void *)((double *)(PyArray_DATA(work)) + delta),
- m * n * sizeof(double));
-- memcpy(epsA->data, (void *)((double *)(work->data) + eps),
-+ memcpy(PyArray_DATA(epsA), (void *)((double *)(PyArray_DATA(work)) + eps),
- nq * n * sizeof(double));
-- memcpy(xplusA->data, (void *)((double *)(work->data) + xplus),
-+ memcpy(PyArray_DATA(xplusA), (void *)((double *)(PyArray_DATA(work)) + xplus),
- m * n * sizeof(double));
-- memcpy(fnA->data, (void *)((double *)(work->data) + fn),
-+ memcpy(PyArray_DATA(fnA), (void *)((double *)(PyArray_DATA(work)) + fn),
- nq * n * sizeof(double));
-
-- res_var = *((double *)(work->data) + rvar);
-- sum_square = *((double *)(work->data) + wss);
-- sum_square_delta = *((double *)(work->data) + wssde);
-- sum_square_eps = *((double *)(work->data) + wssep);
-- inv_condnum = *((double *)(work->data) + rcond);
-- rel_error = *((double *)(work->data) + eta);
-+ res_var = *((double *)(PyArray_DATA(work)) + rvar);
-+ sum_square = *((double *)(PyArray_DATA(work)) + wss);
-+ sum_square_delta = *((double *)(PyArray_DATA(work)) + wssde);
-+ sum_square_eps = *((double *)(PyArray_DATA(work)) + wssep);
-+ inv_condnum = *((double *)(PyArray_DATA(work)) + rcond);
-+ rel_error = *((double *)(PyArray_DATA(work)) + eta);
-
- retobj =
- Py_BuildValue
-@@ -623,7 +625,7 @@
- PYERR(PyExc_ValueError,
- "y could not be made into a suitable array");
- }
-- n = y->dimensions[y->nd - 1]; /* pick the last dimension */
-+ n = PyArray_DIMS(y)[PyArray_NDIM(y) - 1]; /* pick the last dimension */
- if ((x =
- (PyArrayObject *) PyArray_CopyFromObject(px, NPY_DOUBLE, 1,
- 2)) == NULL)
-@@ -631,18 +633,18 @@
- PYERR(PyExc_ValueError,
- "x could not be made into a suitable array");
- }
-- if (n != x->dimensions[x->nd - 1])
-+ if (n != PyArray_DIMS(x)[PyArray_NDIM(x) - 1])
- {
- PYERR(PyExc_ValueError,
- "x and y don't have matching numbers of observations");
- }
-- if (y->nd == 1)
-+ if (PyArray_NDIM(y) == 1)
- {
- nq = 1;
- }
- else
- {
-- nq = y->dimensions[0];
-+ nq = PyArray_DIMS(y)[0];
- }
-
- ldx = ldy = n;
-@@ -664,17 +666,17 @@
- "x could not be made into a suitable array");
- }
-
-- n = x->dimensions[x->nd - 1];
-+ n = PyArray_DIMS(x)[PyArray_NDIM(x) - 1];
- ldx = n;
- }
-
-- if (x->nd == 1)
-+ if (PyArray_NDIM(x) == 1)
- {
- m = 1;
- }
- else
- {
-- m = x->dimensions[0];
-+ m = PyArray_DIMS(x)[0];
- } /* x, y */
-
- if ((beta =
-@@ -684,14 +686,14 @@
- PYERR(PyExc_ValueError,
- "initbeta could not be made into a suitable array");
- }
-- np = beta->dimensions[0];
-+ np = PyArray_DIMS(beta)[0];
-
- if (pwe == NULL)
- {
- ldwe = ld2we = 1;
- dim1[0] = n;
- we = (PyArrayObject *) PyArray_SimpleNew(1, dim1, NPY_DOUBLE);
-- ((double *)(we->data))[0] = -1.0;
-+ ((double *)(PyArray_DATA(we)))[0] = -1.0;
- }
- else if (PyNumber_Check(pwe) && !PyArray_Check(pwe))
- {
-@@ -711,11 +713,11 @@
- we = (PyArrayObject *) PyArray_SimpleNew(3, dim3, NPY_DOUBLE);
- if (implicit)
- {
-- ((double *)(we->data))[0] = val;
-+ ((double *)(PyArray_DATA(we)))[0] = val;
- }
- else
- {
-- ((double *)(we->data))[0] = -val;
-+ ((double *)(PyArray_DATA(we)))[0] = -val;
- }
- ldwe = ld2we = 1;
- }
-@@ -730,29 +732,29 @@
- PYERR(PyExc_ValueError, "could not convert we to a suitable array");
- }
-
-- if (we->nd == 1 && nq == 1)
-+ if (PyArray_NDIM(we) == 1 && nq == 1)
- {
-
- ldwe = n;
- ld2we = 1;
- }
-- else if (we->nd == 1 && we->dimensions[0] == nq)
-+ else if (PyArray_NDIM(we) == 1 && PyArray_DIMS(we)[0] == nq)
- {
- /* we is a rank-1 array with diagonal weightings to be broadcast
- * to all observations */
- ldwe = 1;
- ld2we = 1;
- }
-- else if (we->nd == 3 && we->dimensions[0] == nq
-- && we->dimensions[1] == nq && we->dimensions[2] == 1)
-+ else if (PyArray_NDIM(we) == 3 && PyArray_DIMS(we)[0] == nq
-+ && PyArray_DIMS(we)[1] == nq && PyArray_DIMS(we)[2] == 1)
- {
- /* we is a rank-3 array with the covariant weightings
- to be broadcast to all observations */
- ldwe = 1;
- ld2we = nq;
- }
-- else if (we->nd == 2 && we->dimensions[0] == nq
-- && we->dimensions[1] == nq)
-+ else if (PyArray_NDIM(we) == 2 && PyArray_DIMS(we)[0] == nq
-+ && PyArray_DIMS(we)[1] == nq)
- {
- /* we is a rank-2 array with the full covariant weightings
- to be broadcast to all observations */
-@@ -760,16 +762,16 @@
- ld2we = nq;
- }
-
-- else if (we->nd == 2 && we->dimensions[0] == nq
-- && we->dimensions[1] == n)
-+ else if (PyArray_NDIM(we) == 2 && PyArray_DIMS(we)[0] == nq
-+ && PyArray_DIMS(we)[1] == n)
- {
- /* we is a rank-2 array with the diagonal elements of the
- covariant weightings for each observation */
- ldwe = n;
- ld2we = 1;
- }
-- else if (we->nd == 3 && we->dimensions[0] == nq
-- && we->dimensions[1] == nq && we->dimensions[2] == n)
-+ else if (PyArray_NDIM(we) == 3 && PyArray_DIMS(we)[0] == nq
-+ && PyArray_DIMS(we)[1] == nq && PyArray_DIMS(we)[2] == n)
- {
- /* we is the full specification of the covariant weights
- for each observation */
-@@ -788,7 +790,7 @@
-
- dim1[0] = m;
- wd = (PyArrayObject *) PyArray_SimpleNew(1, dim1, NPY_DOUBLE);
-- ((double *)(wd->data))[0] = -1.0;
-+ ((double *)(PyArray_DATA(wd)))[0] = -1.0;
- }
- else if (PyNumber_Check(pwd) && !PyArray_Check(pwd))
- {
-@@ -806,7 +808,7 @@
- dim3[1] = 1;
- dim3[2] = m;
- wd = (PyArrayObject *) PyArray_SimpleNew(3, dim3, NPY_DOUBLE);
-- ((double *)(wd->data))[0] = -val;
-+ ((double *)(PyArray_DATA(wd)))[0] = -val;
- ldwd = ld2wd = 1;
- }
- else if (PySequence_Check(pwd))
-@@ -820,12 +822,12 @@
- PYERR(PyExc_ValueError, "could not convert wd to a suitable array");
- }
-
-- if (wd->nd == 1 && m == 1)
-+ if (PyArray_NDIM(wd) == 1 && m == 1)
- {
- ldwd = n;
- ld2wd = 1;
- }
-- else if (wd->nd == 1 && wd->dimensions[0] == m)
-+ else if (PyArray_NDIM(wd) == 1 && PyArray_DIMS(wd)[0] == m)
- {
- /* wd is a rank-1 array with diagonal weightings to be broadcast
- * to all observations */
-@@ -833,16 +835,16 @@
- ld2wd = 1;
- }
-
-- else if (wd->nd == 3 && wd->dimensions[0] == m
-- && wd->dimensions[1] == m && wd->dimensions[2] == 1)
-+ else if (PyArray_NDIM(wd) == 3 && PyArray_DIMS(wd)[0] == m
-+ && PyArray_DIMS(wd)[1] == m && PyArray_DIMS(wd)[2] == 1)
- {
- /* wd is a rank-3 array with the covariant wdightings
- to be broadcast to all observations */
- ldwd = 1;
- ld2wd = m;
- }
-- else if (wd->nd == 2 && wd->dimensions[0] == m
-- && wd->dimensions[1] == m)
-+ else if (PyArray_NDIM(wd) == 2 && PyArray_DIMS(wd)[0] == m
-+ && PyArray_DIMS(wd)[1] == m)
- {
- /* wd is a rank-2 array with the full covariant weightings
- to be broadcast to all observations */
-@@ -850,16 +852,16 @@
- ld2wd = m;
- }
-
-- else if (wd->nd == 2 && wd->dimensions[0] == m
-- && wd->dimensions[1] == n)
-+ else if (PyArray_NDIM(wd) == 2 && PyArray_DIMS(wd)[0] == m
-+ && PyArray_DIMS(wd)[1] == n)
- {
- /* wd is a rank-2 array with the diagonal elements of the
- covariant weightings for each observation */
- ldwd = n;
- ld2wd = 1;
- }
-- else if (wd->nd == 3 && wd->dimensions[0] == m
-- && wd->dimensions[1] == m && wd->dimensions[2] == n)
-+ else if (PyArray_NDIM(wd) == 3 && PyArray_DIMS(wd)[0] == m
-+ && PyArray_DIMS(wd)[1] == m && PyArray_DIMS(wd)[2] == n)
- {
- /* wd is the full specification of the covariant weights
- for each observation */
-@@ -878,7 +880,7 @@
- {
- dim1[0] = np;
- ifixb = (PyArrayObject *) PyArray_SimpleNew(1, dim1, NPY_INT);
-- *(int *)(ifixb->data) = -1; /* set first element negative */
-+ *(int *)(PyArray_DATA(ifixb)) = -1; /* set first element negative */
- }
- else
- {
-@@ -892,7 +894,7 @@
- "could not convert ifixb to a suitable array");
- }
-
-- if (ifixb->dimensions[0] != np)
-+ if (PyArray_DIMS(ifixb)[0] != np)
- {
- PYERR(PyExc_ValueError,
- "could not convert ifixb to a suitable array");
-@@ -904,7 +906,7 @@
- dim2[0] = m;
- dim2[1] = 1;
- ifixx = (PyArrayObject *) PyArray_SimpleNew(2, dim2, NPY_INT);
-- *(int *)(ifixx->data) = -1; /* set first element negative */
-+ *(int *)(PyArray_DATA(ifixx)) = -1; /* set first element negative */
- ldifx = 1;
- }
- else
-@@ -919,16 +921,16 @@
- "could not convert ifixx to a suitable array");
- }
-
-- if (ifixx->nd == 1 && ifixx->dimensions[0] == m)
-+ if (PyArray_NDIM(ifixx) == 1 && PyArray_DIMS(ifixx)[0] == m)
- {
- ldifx = 1;
- }
-- else if (ifixx->nd == 1 && ifixx->dimensions[0] == n && m == 1)
-+ else if (PyArray_NDIM(ifixx) == 1 && PyArray_DIMS(ifixx)[0] == n && m == 1)
- {
- ldifx = n;
- }
-- else if (ifixx->nd == 2 && ifixx->dimensions[0] == m
-- && ifixx->dimensions[1] == n)
-+ else if (PyArray_NDIM(ifixx) == 2 && PyArray_DIMS(ifixx)[0] == m
-+ && PyArray_DIMS(ifixx)[1] == n)
- {
- ldifx = n;
- }
-@@ -957,14 +959,14 @@
- {
- dim1[0] = np;
- stpb = (PyArrayObject *) PyArray_SimpleNew(1, dim1, NPY_DOUBLE);
-- *(double *)(stpb->data) = 0.0;
-+ *(double *)(PyArray_DATA(stpb)) = 0.0;
- }
- else /* pstpb is a sequence */
- {
- if ((stpb =
- (PyArrayObject *) PyArray_CopyFromObject(pstpb, NPY_DOUBLE, 1,
- 1)) == NULL
-- || stpb->dimensions[0] != np)
-+ || PyArray_DIMS(stpb)[0] != np)
- {
- PYERR(PyExc_ValueError,
- "could not convert stpb to a suitable array");
-@@ -976,7 +978,7 @@
- dim2[0] = 1;
- dim2[1] = m;
- stpd = (PyArrayObject *) PyArray_SimpleNew(2, dim2, NPY_DOUBLE);
-- *(double *)(stpd->data) = 0.0;
-+ *(double *)(PyArray_DATA(stpd)) = 0.0;
- ldstpd = 1;
- }
- else
-@@ -989,16 +991,16 @@
- "could not convert stpb to a suitable array");
- }
-
-- if (stpd->nd == 1 && stpd->dimensions[0] == m)
-+ if (PyArray_NDIM(stpd) == 1 && PyArray_DIMS(stpd)[0] == m)
- {
- ldstpd = 1;
- }
-- else if (stpd->nd == 1 && stpd->dimensions[0] == n && m == 1)
-+ else if (PyArray_NDIM(stpd) == 1 && PyArray_DIMS(stpd)[0] == n && m == 1)
- {
- ldstpd = n;
- }
-- else if (stpd->nd == 2 && stpd->dimensions[0] == n &&
-- stpd->dimensions[1] == m)
-+ else if (PyArray_NDIM(stpd) == 2 && PyArray_DIMS(stpd)[0] == n &&
-+ PyArray_DIMS(stpd)[1] == m)
- {
- ldstpd = n;
- }
-@@ -1008,14 +1010,14 @@
- {
- dim1[0] = np;
- sclb = (PyArrayObject *) PyArray_SimpleNew(1, dim1, NPY_DOUBLE);
-- *(double *)(sclb->data) = 0.0;
-+ *(double *)(PyArray_DATA(sclb)) = 0.0;
- }
- else /* psclb is a sequence */
- {
- if ((sclb =
- (PyArrayObject *) PyArray_CopyFromObject(psclb, NPY_DOUBLE, 1,
- 1)) == NULL
-- || sclb->dimensions[0] != np)
-+ || PyArray_DIMS(sclb)[0] != np)
- {
- PYERR(PyExc_ValueError,
- "could not convert sclb to a suitable array");
-@@ -1027,7 +1029,7 @@
- dim2[0] = 1;
- dim2[1] = n;
- scld = (PyArrayObject *) PyArray_SimpleNew(2, dim2, NPY_DOUBLE);
-- *(double *)(scld->data) = 0.0;
-+ *(double *)(PyArray_DATA(scld)) = 0.0;
- ldscld = 1;
- }
- else
-@@ -1040,16 +1042,16 @@
- "could not convert stpb to a suitable array");
- }
-
-- if (scld->nd == 1 && scld->dimensions[0] == m)
-+ if (PyArray_NDIM(scld) == 1 && PyArray_DIMS(scld)[0] == m)
- {
- ldscld = 1;
- }
-- else if (scld->nd == 1 && scld->dimensions[0] == n && m == 1)
-+ else if (PyArray_NDIM(scld) == 1 && PyArray_DIMS(scld)[0] == n && m == 1)
- {
- ldscld = n;
- }
-- else if (scld->nd == 2 && scld->dimensions[0] == n &&
-- scld->dimensions[1] == m)
-+ else if (PyArray_NDIM(scld) == 2 && PyArray_DIMS(scld)[0] == n &&
-+ PyArray_DIMS(scld)[1] == m)
- {
- ldscld = n;
- }
-@@ -1110,9 +1112,9 @@
- PYERR(PyExc_ValueError,
- "could not convert work to a suitable array");
- }
-- if (work->dimensions[0] < lwork)
-+ if (PyArray_DIMS(work)[0] < lwork)
- {
-- printf("%d %d\n", work->dimensions[0], lwork);
-+ printf("%ld %d\n", PyArray_DIMS(work)[0], lwork);
- PYERR(PyExc_ValueError, "work is too small");
- }
- }
-@@ -1133,7 +1135,7 @@
- "could not convert iwork to a suitable array");
- }
-
-- if (iwork->dimensions[0] < liwork)
-+ if (PyArray_DIMS(iwork)[0] < liwork)
- {
- PYERR(PyExc_ValueError, "iwork is too small");
- }
-@@ -1170,19 +1172,18 @@
- Py_INCREF(beta);
- odr_global.extra_args = extra_args;
- Py_XINCREF(extra_args);
--
-- /* now call DODRC */
-- F_FUNC(dodrc,DODRC)(fcn_callback, &n, &m, &np, &nq, (double *)(beta->data),
-- (double *)(y->data), &ldy, (double *)(x->data), &ldx,
-- (double *)(we->data), &ldwe, &ld2we,
-- (double *)(wd->data), &ldwd, &ld2wd,
-- (int *)(ifixb->data), (int *)(ifixx->data), &ldifx,
-- &job, &ndigit, &taufac, &sstol, &partol, &maxit,
-- &iprint, &lunerr, &lunrpt,
-- (double *)(stpb->data), (double *)(stpd->data), &ldstpd,
-- (double *)(sclb->data), (double *)(scld->data), &ldscld,
-- (double *)(work->data), &lwork, (int *)(iwork->data), &liwork,
-- &info);
-+ /* now call DODRC */
-+ F_FUNC(dodrc,DODRC)(fcn_callback, &n, &m, &np, &nq, (double *)(PyArray_DATA(beta)),
-+ (double *)(PyArray_DATA(y)), &ldy, (double *)(PyArray_DATA(x)), &ldx,
-+ (double *)(PyArray_DATA(we)), &ldwe, &ld2we,
-+ (double *)(PyArray_DATA(wd)), &ldwd, &ld2wd,
-+ (int *)(PyArray_DATA(ifixb)), (int *)(PyArray_DATA(ifixx)), &ldifx,
-+ &job, &ndigit, &taufac, &sstol, &partol, &maxit,
-+ &iprint, &lunerr, &lunrpt,
-+ (double *)(PyArray_DATA(stpb)), (double *)(PyArray_DATA(stpd)), &ldstpd,
-+ (double *)(PyArray_DATA(sclb)), (double *)(PyArray_DATA(scld)), &ldscld,
-+ (double *)(PyArray_DATA(work)), &lwork, (int *)(PyArray_DATA(iwork)), &liwork,
-+ &info);
-
- result = gen_output(n, m, np, nq, ldwe, ld2we,
- beta, work, iwork, isodr, info, full_output);
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-scipy.git/commitdiff/18ff5e120acce2c4ef36b33355402a3b9949bdd6
More information about the pld-cvs-commit
mailing list