Skip to content

Commit

Permalink
alvistack/v1.5.4
Browse files Browse the repository at this point in the history
    git clean -xdf
    tar zcvf ../python-scipy_1.5.4.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-scipy.spec ../python-scipy_1.5.4-1.spec
    cp ../python*-scipy*1.5.4*.{gz,xz,spec,dsc} /osc/home\:alvistack/scipy-scipy-1.5.4/
    rm -rf ../python*-scipy*1.5.4*.*

See scipy#16719

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
  • Loading branch information
hswong3i committed Dec 24, 2023
1 parent 19acfed commit 3ce7545
Show file tree
Hide file tree
Showing 12 changed files with 250 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -271,3 +271,5 @@ scipy/optimize/_group_columns.c
scipy/optimize/cython_optimize/_zeros.c
scipy/optimize/cython_optimize/_zeros.pyx
scipy/optimize/lbfgsb/_lbfgsbmodule.c

.pybuild/
6 changes: 6 additions & 0 deletions debian/.gitignore
@@ -0,0 +1,6 @@
*.substvars
*debhelper*
.debhelper
files
python3-scipy
tmp
5 changes: 5 additions & 0 deletions debian/changelog
@@ -0,0 +1,5 @@
python-scipy (100:1.5.4-1) UNRELEASED; urgency=medium

* https://github.com/scipy/scipy/releases/tag/v1.5.4

-- Wong Hoi Sing Edison <hswong3i@pantarei-design.com> Sun, 24 Dec 2023 12:34:50 +0800
47 changes: 47 additions & 0 deletions debian/control
@@ -0,0 +1,47 @@
Source: python-scipy
Section: python
Priority: optional
Standards-Version: 4.5.0
Maintainer: Wong Hoi Sing Edison <hswong3i@gmail.com>
Homepage: https://github.com/scipy/scipy/tags
Vcs-Browser: https://github.com/alvistack/scipy-scipy
Vcs-Git: https://github.com/alvistack/scipy-scipy.git
Build-Depends:
debhelper,
debhelper-compat (= 10),
dh-python,
cython3 (>= 0.29.18),
cython3 (<< 3.0.0),
fdupes,
gfortran,
liblapack-dev,
liblbfgsb-dev,
libopenblas-dev,
libsuitesparse-dev,
python3-decorator,
python3-dev,
python3-numpy (>= 1.14.5),
python3-pybind11 (>= 2.4.3),
python3-setuptools,

Package: python3-scipy
Architecture: amd64
Description: Scientific Library for Python
SciPy (pronounced "Sigh Pie") is open-source software for mathematics,
science, and engineering. The SciPy library depends on NumPy, which
provides convenient and fast N-dimensional array manipulation. The SciPy
library is built to work with NumPy arrays, and provides many
user-friendly and efficient numerical routines such as routines for
numerical integration and optimization. Together, they run on all
popular operating systems, are quick to install, and are free of charge.
NumPy and SciPy are easy to use, but powerful enough to be depended upon
by some of the world’s leading scientists and engineers. If you need to
manipulate numbers on a computer and display or publish the results,
give SciPy a try!
Depends:
${misc:Depends},
${python3:Depends},
${shlibs:Depends},
python3,
python3-decorator,
python3-numpy (>= 1.14.5),
21 changes: 21 additions & 0 deletions debian/copyright
@@ -0,0 +1,21 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/

Files: debian/*
Copyright: 2023 Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
License: Apache-2.0

License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
The complete text of the Apache version 2.0 license
can be found in "/usr/share/common-licenses/Apache-2.0".
1 change: 1 addition & 0 deletions debian/python3-scipy.install
@@ -0,0 +1 @@
usr/lib/python*/*-packages/*
4 changes: 4 additions & 0 deletions debian/python3-scipy.lintian-overrides
@@ -0,0 +1,4 @@
python3-scipy: copyright-without-copyright-notice
python3-scipy: initial-upload-closes-no-bugs
python3-scipy: no-manual-page
python3-scipy: zero-byte-file-in-doc-directory
15 changes: 15 additions & 0 deletions debian/rules
@@ -0,0 +1,15 @@
#!/usr/bin/make -f

SHELL := /bin/bash

override_dh_auto_install:
dh_auto_install --destdir=debian/tmp
find debian/tmp/usr/lib/python*/*-packages -type f -name '*.pyc' -exec rm -rf {} \;
fdupes -qnrps debian/tmp/usr/lib/python*/*-packages

override_dh_auto_test:

override_dh_auto_clean:

%:
dh $@ --buildsystem=pybuild --with python3
1 change: 1 addition & 0 deletions debian/source/format
@@ -0,0 +1 @@
3.0 (quilt)
5 changes: 5 additions & 0 deletions debian/source/lintian-overrides
@@ -0,0 +1,5 @@
python-scipy source: file-without-copyright-information
python-scipy source: no-debian-changes
python-scipy source: source-contains-prebuilt-windows-binary
python-scipy source: source-is-missing
python-scipy source: source-package-encodes-python-version
130 changes: 130 additions & 0 deletions python-scipy.spec
@@ -0,0 +1,130 @@
# Copyright 2023 Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

%global debug_package %{nil}

Name: python-scipy
Epoch: 100
Version: 1.5.4
Release: 1%{?dist}
Summary: Scientific Library for Python
License: BSD-3-Clause
URL: https://github.com/scipy/scipy/tags
Source0: %{name}_%{version}.orig.tar.gz
BuildRequires: fdupes
BuildRequires: gcc-gfortran
BuildRequires: lapack-devel
BuildRequires: openblas-devel
BuildRequires: pybind11-devel >= 2.4.3
BuildRequires: python-rpm-macros
BuildRequires: python3-cython >= 0.29.18
BuildRequires: python3-cython < 3.0.0
BuildRequires: python3-decorator
BuildRequires: python3-devel
BuildRequires: python3-numpy >= 1.14.5
BuildRequires: python3-numpy-f2py >= 1.14.5
BuildRequires: python3-pybind11 >= 2.4.3
BuildRequires: python3-setuptools
BuildRequires: suitesparse-devel

%description
SciPy (pronounced "Sigh Pie") is open-source software for mathematics,
science, and engineering. The SciPy library depends on NumPy, which
provides convenient and fast N-dimensional array manipulation. The SciPy
library is built to work with NumPy arrays, and provides many
user-friendly and efficient numerical routines such as routines for
numerical integration and optimization. Together, they run on all
popular operating systems, are quick to install, and are free of charge.
NumPy and SciPy are easy to use, but powerful enough to be depended upon
by some of the world’s leading scientists and engineers. If you need to
manipulate numbers on a computer and display or publish the results,
give SciPy a try!

%prep
%autosetup -T -c -n %{name}_%{version}-%{release}
tar -zx -f %{S:0} --strip-components=1 -C .

%build
%py3_build

%install
%py3_install
find %{buildroot}%{python3_sitearch} -type f -name '*.pyc' -exec rm -rf {} \;
fdupes -qnrps %{buildroot}%{python3_sitearch}

%check

%if 0%{?suse_version} > 1500
%package -n python%{python3_version_nodots}-scipy
Summary: Scientific Library for Python
Requires: python3
Requires: python3-decorator
Requires: python3-numpy >= 1.14.5
Provides: python3-scipy = %{epoch}:%{version}-%{release}
Provides: python3dist(scipy) = %{epoch}:%{version}-%{release}
Provides: python%{python3_version}-scipy = %{epoch}:%{version}-%{release}
Provides: python%{python3_version}dist(scipy) = %{epoch}:%{version}-%{release}
Provides: python%{python3_version_nodots}-scipy = %{epoch}:%{version}-%{release}
Provides: python%{python3_version_nodots}dist(scipy) = %{epoch}:%{version}-%{release}

%description -n python%{python3_version_nodots}-scipy
SciPy (pronounced "Sigh Pie") is open-source software for mathematics,
science, and engineering. The SciPy library depends on NumPy, which
provides convenient and fast N-dimensional array manipulation. The SciPy
library is built to work with NumPy arrays, and provides many
user-friendly and efficient numerical routines such as routines for
numerical integration and optimization. Together, they run on all
popular operating systems, are quick to install, and are free of charge.
NumPy and SciPy are easy to use, but powerful enough to be depended upon
by some of the world’s leading scientists and engineers. If you need to
manipulate numbers on a computer and display or publish the results,
give SciPy a try!

%files -n python%{python3_version_nodots}-scipy
%license LICENSE.txt
%{python3_sitearch}/*
%endif

%if !(0%{?suse_version} > 1500)
%package -n python3-scipy
Summary: Scientific Library for Python
Requires: python3
Requires: python3-decorator
Requires: python3-numpy >= 1.14.5
Provides: python3-scipy = %{epoch}:%{version}-%{release}
Provides: python3dist(scipy) = %{epoch}:%{version}-%{release}
Provides: python%{python3_version}-scipy = %{epoch}:%{version}-%{release}
Provides: python%{python3_version}dist(scipy) = %{epoch}:%{version}-%{release}
Provides: python%{python3_version_nodots}-scipy = %{epoch}:%{version}-%{release}
Provides: python%{python3_version_nodots}dist(scipy) = %{epoch}:%{version}-%{release}

%description -n python3-scipy
SciPy (pronounced "Sigh Pie") is open-source software for mathematics,
science, and engineering. The SciPy library depends on NumPy, which
provides convenient and fast N-dimensional array manipulation. The SciPy
library is built to work with NumPy arrays, and provides many
user-friendly and efficient numerical routines such as routines for
numerical integration and optimization. Together, they run on all
popular operating systems, are quick to install, and are free of charge.
NumPy and SciPy are easy to use, but powerful enough to be depended upon
by some of the world’s leading scientists and engineers. If you need to
manipulate numbers on a computer and display or publish the results,
give SciPy a try!

%files -n python3-scipy
%license LICENSE.txt
%{python3_sitearch}/*
%endif

%changelog
19 changes: 13 additions & 6 deletions scipy/stats/_stats.pyx
Expand Up @@ -171,6 +171,11 @@ def _toint64(x):
@cython.wraparound(False)
@cython.boundscheck(False)
def _weightedrankedtau(ordered[:] x, ordered[:] y, intp_t[:] rank, weigher, bool additive):
# y_local and rank_local (declared below) are a work-around for a Cython
# bug; see gh-16718. When we can require Cython 3.0, y_local and
# rank_local can be removed, and the closure weigh() can refer directly
# to y and rank.
cdef ordered[:] y_local = y
cdef intp_t i, first
cdef float64_t t, u, v, w, s, sq
cdef int64_t n = np.int64(len(x))
Expand All @@ -189,6 +194,8 @@ def _weightedrankedtau(ordered[:] x, ordered[:] y, intp_t[:] rank, weigher, bool
rank[...] = perm[::-1]
_invert_in_place(rank)

cdef intp_t[:] rank_local = rank

# weigh joint ties
first = 0
t = 0
Expand Down Expand Up @@ -237,28 +244,28 @@ def _weightedrankedtau(ordered[:] x, ordered[:] y, intp_t[:] rank, weigher, bool
cdef float64_t weight, residual

if length == 1:
return weigher(rank[perm[offset]])
return weigher(rank_local[perm[offset]])
length0 = length // 2
length1 = length - length0
middle = offset + length0
residual = weigh(offset, length0)
weight = weigh(middle, length1) + residual
if y[perm[middle - 1]] < y[perm[middle]]:
if y_local[perm[middle - 1]] < y_local[perm[middle]]:
return weight

# merging
i = j = k = 0

while j < length0 and k < length1:
if y[perm[offset + j]] <= y[perm[middle + k]]:
if y_local[perm[offset + j]] <= y_local[perm[middle + k]]:
temp[i] = perm[offset + j]
residual -= weigher(rank[temp[i]])
residual -= weigher(rank_local[temp[i]])
j += 1
else:
temp[i] = perm[middle + k]
exchanges_weight[0] += weigher(rank[temp[i]]) * (
exchanges_weight[0] += weigher(rank_local[temp[i]]) * (
length0 - j) + residual if additive else weigher(
rank[temp[i]]) * residual
rank_local[temp[i]]) * residual
k += 1
i += 1

Expand Down

0 comments on commit 3ce7545

Please sign in to comment.