17
0

Accepting request 503716 from devel:languages:python

Needed by python-scikit-image, which is already in openSUSE:Factory.

OBS-URL: https://build.opensuse.org/request/show/503716
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-PyWavelets?expand=0&rev=1
This commit is contained in:
2017-08-24 16:30:13 +00:00
committed by Git OBS Bridge
commit b5274614fe
6 changed files with 279 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

3
PyWavelets-0.5.2.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ce36e2f0648ea1781490b09515363f1f64446b0eac524603e5db5e180113bed9
size 4430706

View File

@@ -0,0 +1,72 @@
From 91b0a7bdbdd181bfb765246a9ec949b1cf2d12ad Mon Sep 17 00:00:00 2001
From: "Gregory R. Lee" <grlee77@gmail.com>
Date: Sat, 10 Dec 2016 03:23:39 -0500
Subject: [PATCH] MAINT: add default to switch statement for
is_discrete_wavelet
on the Cython side, raise an error if is_discrete_wavelet returns -1
---
pywt/_extensions/_pywt.pyx | 15 ++++++++++++---
pywt/_extensions/c/wavelets.c | 2 ++
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/pywt/_extensions/_pywt.pyx b/pywt/_extensions/_pywt.pyx
index 5928d9e7..c9b10a1f 100644
--- a/pywt/_extensions/_pywt.pyx
+++ b/pywt/_extensions/_pywt.pyx
@@ -33,6 +33,15 @@ _attr_deprecation_msg = ('{old} has been renamed to {new} and will '
'of pywt.')
+# raises exception if the wavelet name is undefined
+cdef int is_discrete_wav(WAVELET_NAME name):
+ cdef int is_discrete
+ discrete = wavelet.is_discrete_wavelet(name)
+ if discrete == -1:
+ raise ValueError("unrecognized wavelet family name")
+ return discrete
+
+
class _Modes(object):
"""
Because the most common and practical way of representing digital signals
@@ -206,7 +215,7 @@ def wavelist(family=None, kind='all'):
return True
family_code, family_number = wname_to_code(name)
- is_discrete = wavelet.is_discrete_wavelet(family_code)
+ is_discrete = is_discrete_wav(family_code)
if kind == 'discrete':
return is_discrete
else:
@@ -299,7 +308,7 @@ def DiscreteContinuousWavelet(name=u"", object filter_bank=None):
if filter_bank is None:
name = name.lower()
family_code, family_number = wname_to_code(name)
- if (wavelet.is_discrete_wavelet(family_code)):
+ if is_discrete_wav(family_code):
return Wavelet(name, filter_bank)
else:
return ContinuousWavelet(name)
@@ -334,7 +343,7 @@ cdef public class Wavelet [type WaveletType, object WaveletObject]:
# builtin wavelet
self.name = name.lower()
family_code, family_number = wname_to_code(self.name)
- if (wavelet.is_discrete_wavelet(family_code)):
+ if is_discrete_wav(family_code):
self.w = <wavelet.DiscreteWavelet*> wavelet.discrete_wavelet(family_code, family_number)
if self.w is NULL:
raise ValueError("Invalid wavelet name.")
diff --git a/pywt/_extensions/c/wavelets.c b/pywt/_extensions/c/wavelets.c
index bc783af4..21b4c672 100644
--- a/pywt/_extensions/c/wavelets.c
+++ b/pywt/_extensions/c/wavelets.c
@@ -42,6 +42,8 @@ int is_discrete_wavelet(WAVELET_NAME name)
return 0;
case CMOR:
return 0;
+ default:
+ return -1;
}
}

54
python-PyWavelets.changes Normal file
View File

@@ -0,0 +1,54 @@
-------------------------------------------------------------------
Wed May 24 13:46:05 UTC 2017 - toddrme2178@gmail.com
- Implement single-spec version
- Fix source URL
- Update to version 0.5.2
Highlights:
* 1D, 2D and nD Forward and Inverse Discrete Wavelet Transform
(DWT and IDWT)
* 1D, 2D and nD Multilevel DWT and IDWT
* 1D and 2D Forward and Inverse Stationary Wavelet Transform
* 1D and 2D Wavelet Packet decomposition and reconstruction
* 1D Continuous Wavelet Transform
* When multiple valid implementations are available, we have
chosen to maintain consistency with |MATLAB|'s Wavelet Toolbox.
- Add add_default_to_switch_statement.patch
Fixes no-return-in-nonvoid-function error
From: https://github.com/PyWavelets/pywt/commit/91b0a7bdbdd181bfb765246a9ec949b1cf2d12ad
-------------------------------------------------------------------
Mon Jan 11 08:29:46 UTC 2016 - toddrme2178@gmail.com
- Update to 0.4.0
+ Highlights:
* 1D and 2D inverse stationary wavelet transforms
* Substantially faster 2D and nD discrete wavelet transforms
* Complex number support
* nD versions of the multilevel DWT and IDWT
- Update to 0.3.0
+ Highlights:
* Support for Python 3.x (>=3.3)
* Added a test suite
(based on nose, coverage up to 61% so far)
* Maintenance work: C style complying to the Numpy style guide,
improved templating system, more complete docstrings,
pep8/pyflakes compliance, and more.
-------------------------------------------------------------------
Thu Oct 24 17:40:23 UTC 2013 - toddrme2178@gmail.com
- Update to 0.2.2
* Bugfixes
-------------------------------------------------------------------
Wed Jun 13 20:31:30 UTC 2012 - scorot@free.fr
- use proper python command instead of %%{__python} macro
- remove -O1 and --skip-build flags from the install command line
-------------------------------------------------------------------
Wed Jun 13 19:10:42 UTC 2012 - scorot@free.fr
- first package

126
python-PyWavelets.spec Normal file
View File

@@ -0,0 +1,126 @@
#
# spec file for package python-PyWavelets
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%bcond_without tests
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-PyWavelets
Version: 0.5.2
Release: 0
Summary: PyWavelets is a Python wavelet transforms module
License: MIT
Group: Development/Libraries/Python
Url: http://pypi.python.org/pypi/PyWavelets/
Source0: https://files.pythonhosted.org/packages/source/P/PyWavelets/PyWavelets-%{version}.tar.gz
# PATCH-FIX-UPSTREAM add_default_to_switch_statement.patch -- Fix no return in nonvoid function error
Patch0: add_default_to_switch_statement.patch
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module numpy-devel >= 1.6.2}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
# Documentation requirements
BuildRequires: python3-Pygments
BuildRequires: python3-Sphinx
BuildRequires: python3-numpydoc
%if %{with tests}
BuildRequires: %{python_module nose}
%endif
Requires: python-numpy >= 1.6.2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%python_subpackages
%description
PyWavelets is a Python wavelet transforms module that can do:
* 1D and 2D Forward and Inverse Discrete Wavelet Transform (DWT and IDWT)
* 1D and 2D Stationary Wavelet Transform (Undecimated Wavelet Transform)
* 1D and 2D Wavelet Packet decomposition and reconstruction
* Computing Approximations of wavelet and scaling functions
* Over seventy built-in wavelet filters and support for custom wavelets
* Single and double precision calculations
* Results compatibility with Matlab Wavelet Toolbox
%package -n %{name}-doc
Summary: This package contains the HMTL documentation of %{name}
Group: Documentation/HTML
Provides: %{python_module PyWavelets-doc = %{version}}
%description -n %{name}-doc
PyWavelets is a Python wavelet transforms module that can do:
* 1D and 2D Forward and Inverse Discrete Wavelet Transform (DWT and IDWT)
* 1D and 2D Stationary Wavelet Transform (Undecimated Wavelet Transform)
* 1D and 2D Wavelet Packet decomposition and reconstruction
* Computing Approximations of wavelet and scaling functions
* Over seventy built-in wavelet filters and support for custom wavelets
* Single and double precision calculations
* Results compatibility with Matlab Wavelet Toolbox
This Package contains the documentation of %{name} in HTML format.
%prep
%setup -q -n PyWavelets-%{version}
%patch0 -p1
# Make docs non-executable
chmod a-x *.rst
chmod a-x *.txt
chmod a-x PyWavelets.egg-info/*
# Remove unneeded shebangs
sed -i '1{\@^#!/usr/bin/env python@d}' pywt/data/create_dat.py
# Remove unneeded executable bits
for lib in test_concurrent test_data test_deprecations test_doc test_matlab_compatibility test_matlab_compatibility_cwt test_thresholding data/generate_matlab_data data/generate_matlab_data_cwt ; do
chmod a-x pywt/tests/$lib.py
done
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
# Create docs. These need the package to already be built and installed
PYTHONPATH="$PYTHONPATH:%{buildroot}%{python3_sitearch}" make -C doc PAPER=letter html
# Remove hiden files
find doc/build/html -name '.*' -exec rm {} \;
%if %{with tests}
%check
export CFLAGS="%{optflags} -fno-strict-aliasing"
%python_exec setup.py test
%endif
%files %{python_files}
%defattr(-,root,root)
%doc CHANGES.txt README.rst THANKS.txt
%{python_sitearch}/pywt/
%{python_sitearch}/PyWavelets-%{version}-py*.egg-info
%files -n %{name}-doc
%defattr(-,root,root)
%doc doc/build/html
%doc demo/
%changelog