Skip to content

Commit

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

See scipy#16719

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
  • Loading branch information
hswong3i committed Dec 31, 2023
1 parent 59e6539 commit daf30b5
Show file tree
Hide file tree
Showing 13 changed files with 257 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -288,3 +288,5 @@ scipy/optimize/cython_optimize/_zeros.pyx
scipy/optimize/lbfgsb/_lbfgsbmodule.c
scipy/optimize/_highs/cython/src/_highs_wrapper.cxx
scipy/optimize/_highs/cython/src/_highs_constants.cxx

.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.7.3-1) UNRELEASED; urgency=medium

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

-- Wong Hoi Sing Edison <hswong3i@pantarei-design.com> Mon, 25 Dec 2023 15:36:54 +0800
46 changes: 46 additions & 0 deletions debian/control
@@ -0,0 +1,46 @@
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,
cython0,
fdupes,
gfortran,
liblapack-dev,
liblbfgsb-dev,
libopenblas-dev,
libsuitesparse-dev,
python3-decorator,
python3-dev,
python3-numpy (>= 1.16.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.16.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: 2024 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
17 changes: 17 additions & 0 deletions debian/rules
@@ -0,0 +1,17 @@
#!/usr/bin/make -f

SHELL := /bin/bash

export SCIPY_USE_PYTHRAN=0

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
135 changes: 135 additions & 0 deletions python-scipy.spec
@@ -0,0 +1,135 @@
# Copyright 2024 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.7.3
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-Cython0
BuildRequires: python3-decorator
BuildRequires: python3-devel
BuildRequires: python3-numpy >= 1.16.5
BuildRequires: python3-numpy-f2py >= 1.16.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
set -ex && \
export SCIPY_USE_PYTHRAN=0 && \
export CFLAGS="%{optflags} -lm -fno-strict-aliasing" && \
export FFLAGS="%{optflags} -fPIC -fallow-argument-mismatch" && \
%{__python3} setup.py config_fc --fcompiler=gnu95 --noarch build

%install
set -ex && \
export SCIPY_USE_PYTHRAN=0 && \
%{__python3} setup.py install --prefix=%{_prefix} --root=%{buildroot}
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.16.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.16.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 @@ -172,6 +172,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 @@ -190,6 +195,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 @@ -238,28 +245,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
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -394,7 +394,7 @@ def parse_setuppy_commands():
# below and not standalone. Hence they're not added to good_commands.
good_commands = ('develop', 'sdist', 'build', 'build_ext', 'build_py',
'build_clib', 'build_scripts', 'bdist_wheel', 'bdist_rpm',
'bdist_wininst', 'bdist_msi', 'bdist_mpkg')
'bdist_wininst', 'bdist_msi', 'bdist_mpkg', 'config')

for command in good_commands:
if command in args:
Expand Down

0 comments on commit daf30b5

Please sign in to comment.