Accepting request 1245483 from devel:languages:python:numeric

- Update to 1.18.0
  * Update C++ sources to 3.83 #973
  * Drop support for Python 3.9 #967
  * Added lonlat parameter to newprojplot #963
  * Fix query_disc missing pixels near poles, fixed in C++ #968
  * Warn users about ud_grade effect on spectra in docstring #960
  * Update CFITSIO to 4.5.0 and ensure we build it as shared lib
    #942
- Release 1.17.3
  * Rename trapz function to support latest scipy version #953
- Release 1.17.1
  * Just fixing an issue in the PyPI publish action
- Release 1.17.0
  * The most important modification is that now scipy and
    matplotlib are optional dependencies, install them with pip
    install healpy[all]. Also includes a lot of packaging fixes.
  * Optional dependencies by @swyatt7 in #910
  * Fix errors with Matplotlib 3.9 by @QuLogic in #944
  * [doc] pull docstrings from dist2holes and hotspots cython
    functions by @zonca in #920
  * Improve docs of read_alm by @zonca in #930
  * update C++ sources to SVN commit 1238 by @zonca in #917
  * update healpix sources to r1239 by @zonca in #941
  * Use alice3 from libhealpix_cxx by @lpsinger in #939
  * Fix pytest-cython errors by requiring pytest<8 by @lpsinger in
    #913
- Drop patches
  * python-healpy-matplotlib-1_9-compat.patch
  * python-healpy-scipy-1_14-compat.patch
- Remove devel package: Unused, the src is no longer in the (forwarded request 1245482 from bnavigator)

OBS-URL: https://build.opensuse.org/request/show/1245483
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-healpy?expand=0&rev=10
This commit is contained in:
Ana Guerrero 2025-02-13 17:38:57 +00:00 committed by Git OBS Bridge
commit c6d6a99da3
6 changed files with 54 additions and 129 deletions

View File

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

3
healpy-1.18.0.tar.gz Normal file
View File

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

View File

@ -1,76 +0,0 @@
From 7a68c6d83a78961027601025fc6553a67f6a44a6 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Mon, 29 Apr 2024 16:15:05 -0400
Subject: [PATCH] Fix errors with Matplotlib 3.9
The `matplotlib.cm.get_cmap` API was deprecated in 3.7, and removed in
3.9, but `matplotlib.pyplot.get_cmap` remains.
---
projaxes.py | 4 ++--
src/_line_integral_convolution.pyx | 4 ++--
test/test_visufunc.py | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/healpy/projaxes.py b/healpy/projaxes.py
index 8c301647..dc6fcef9 100644
--- a/healpy/projaxes.py
+++ b/healpy/projaxes.py
@@ -948,14 +948,14 @@ def create_colormap(cmap, badcolor="gray", bgcolor="white"):
cmap_path = os.path.join(datapath, f"{cmap}_cmap.dat")
cmap0 = matplotlib.colors.ListedColormap(np.loadtxt(cmap_path) / 255.0, cmap)
else:
- cmap0 = matplotlib.cm.get_cmap(cmap)
+ cmap0 = plt.get_cmap(cmap)
elif type(cmap) in [
matplotlib.colors.LinearSegmentedColormap,
matplotlib.colors.ListedColormap,
]:
cmap0 = cmap
else:
- cmap0 = matplotlib.cm.get_cmap(matplotlib.rcParams["image.cmap"])
+ cmap0 = plt.get_cmap(matplotlib.rcParams["image.cmap"])
if hasattr(cmap0, "_segmentdata"):
newcm = matplotlib.colors.LinearSegmentedColormap(
"newcm", cmap0._segmentdata, cmap0.N
diff --git a/healpy/src/_line_integral_convolution.pyx b/healpy/src/_line_integral_convolution.pyx
index 1b3b6c8f..48af98dd 100644
--- a/healpy/src/_line_integral_convolution.pyx
+++ b/healpy/src/_line_integral_convolution.pyx
@@ -78,12 +78,12 @@ def line_integral_convolution(
-------
>>> import healpy as hp
>>> import numpy as np
- >>> import matplotlib.cm
>>> import matplotlib.colors
+ >>> import matplotlib.pyplot as plt
>>> I, Q, U = hp.read_map('iqu_map.fits', (0, 1, 2))
>>> lic = hp.line_integral_convolution(Q, U)
>>> hp.mollview(I)
- >>> cmap_colors = matplotlib.cm.get_cmap('binary', 256)(np.linspace(0, 1, 256))
+ >>> cmap_colors = plt.get_cmap('binary', 256)(np.linspace(0, 1, 256))
>>> cmap_colors[..., 3] = 0.5 # Make colormap partially transparent
>>> cmap = matplotlib.colors.ListedColormap(cmap_colors)
>>> hp.mollview(lic, cmap=cmap, cbar=False, reuse_axes=True)
diff --git a/healpy/test/test_visufunc.py b/healpy/test/test_visufunc.py
index e4d85906..ae3bb0c4 100644
--- a/healpy/test/test_visufunc.py
+++ b/healpy/test/test_visufunc.py
@@ -1,8 +1,8 @@
import matplotlib
-import matplotlib.cm
matplotlib.use("agg")
import unittest
+import matplotlib.pyplot as plt
import numpy as np
import copy
@@ -93,7 +93,7 @@ def test_azeqview_ma_nocrash(self):
def test_cmap_colors(self):
# Get a built-in colormap
name = 'viridis'
- cmap = copy.copy(matplotlib.cm.get_cmap(name))
+ cmap = copy.copy(plt.get_cmap(name))
# Set outlier colors
color = (0.25,0.75,0.95,1.0)

View File

@ -1,20 +0,0 @@
---
healpy/sphtfunc.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Index: healpy-1.16.6/healpy/sphtfunc.py
===================================================================
--- healpy-1.16.6.orig/healpy/sphtfunc.py
+++ healpy-1.16.6/healpy/sphtfunc.py
@@ -24,7 +24,10 @@ import numpy as np
import astropy.io.fits as pf
from .utils.deprecation import deprecated_renamed_argument
-from scipy.integrate import trapz
+try:
+ from scipy.integrate import trapezoid as trapz
+except ImportError:
+ from scipy.integrate import trapz
from astropy.utils import data
DATAURL = "https://healpy.github.io/healpy-data/"

View File

@ -1,3 +1,38 @@
-------------------------------------------------------------------
Wed Feb 12 15:50:59 UTC 2025 - Ben Greiner <code@bnavigator.de>
- Update to 1.18.0
* Update C++ sources to 3.83 #973
* Drop support for Python 3.9 #967
* Added lonlat parameter to newprojplot #963
* Fix query_disc missing pixels near poles, fixed in C++ #968
* Warn users about ud_grade effect on spectra in docstring #960
* Update CFITSIO to 4.5.0 and ensure we build it as shared lib
#942
- Release 1.17.3
* Rename trapz function to support latest scipy version #953
- Release 1.17.1
* Just fixing an issue in the PyPI publish action
- Release 1.17.0
* The most important modification is that now scipy and
matplotlib are optional dependencies, install them with pip
install healpy[all]. Also includes a lot of packaging fixes.
* Optional dependencies by @swyatt7 in #910
* Fix errors with Matplotlib 3.9 by @QuLogic in #944
* [doc] pull docstrings from dist2holes and hotspots cython
functions by @zonca in #920
* Improve docs of read_alm by @zonca in #930
* update C++ sources to SVN commit 1238 by @zonca in #917
* update healpix sources to r1239 by @zonca in #941
* Use alice3 from libhealpix_cxx by @lpsinger in #939
* Fix pytest-cython errors by requiring pytest<8 by @lpsinger in
#913
- Drop patches
* python-healpy-matplotlib-1_9-compat.patch
* python-healpy-scipy-1_14-compat.patch
- Remove devel package: Unused, the src is no longer in the
system site
-------------------------------------------------------------------
Sat Jul 20 10:19:17 UTC 2024 - Atri Bhattacharya <badshah400@gmail.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package python-healpy
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -18,22 +18,18 @@
%{?sle15_python_module_pythons}
Name: python-healpy
Version: 1.16.6
Version: 1.18.0
Release: 0
Summary: Python library to handle pixelated data on the sphere based on HEALPix
License: GPL-2.0-only
URL: https://github.com/healpy/healpy
Source: https://files.pythonhosted.org/packages/source/h/healpy/healpy-%{version}.tar.gz
# PATCH-FIX-UPSTREAM python-healpy-scipy-1_14-compat.patch badshah400@gmail.com -- Account for renaming of integrate.trapz to integrate.trapezoidal in scipy 1.14
Patch0: python-healpy-scipy-1_14-compat.patch
# PATCH-FIX-UPSTREAM python-healpy-matplotlib-1_9-compat.patch badshah400@gmail.com -- Compatibility with matplotlib 3.9 via upstream commit 0b1f498 rebased for current version
Patch1: python-healpy-matplotlib-1_9-compat.patch
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module numpy-devel >= 1.13}
BuildRequires: %{python_module devel >= 3.10}
BuildRequires: %{python_module numpy-devel >= 1.19}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module setuptools >= 60}
BuildRequires: %{python_module setuptools_scm >= 8}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: gcc-c++
@ -43,11 +39,11 @@ BuildRequires: pkgconfig(cfitsio)
BuildRequires: pkgconfig(healpix_cxx)
BuildRequires: pkgconfig(libsharp)
Requires: python-astropy >= 4.0
Requires: python-matplotlib
Requires: python-numpy >= 1.13
Requires: python-scipy
Requires: python-numpy >= 1.19
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends: python-matplotlib
Recommends: python-scipy
# SECTION Additional test requirements
# Symbol clashes with astropy < 4.0
BuildRequires: %{python_module astropy >= 4.0}
@ -74,18 +70,9 @@ healpy provides utilities to:
* transform maps to Spherical Harmonics space and back using multi-threaded C++ routines
* compute Auto and Cross Power Spectra from maps and create map realizations from spectra
%package devel
Summary: C++ header files and source codes for healpy
Requires: python-devel
Requires: python-numpy-devel
Requires: pkgconfig(healpix_cxx)
%description devel
This package provides the C++ header files and source codes for healpy.
%prep
%autosetup -p1 -n healpy-%{version}
chmod -x healpy/data/planck_*cmap.dat
chmod -x lib/healpy/data/*.dat
%build
export CFLAGS="%{optflags}"
@ -99,7 +86,10 @@ export CFLAGS="%{optflags}"
%check
export PYTEST_DEBUG_TEMPROOT=$(mktemp -d -p ./)
# Skip tests requiring network access
%pytest_arch -k 'not (test_astropy_download_file or test_rotate_map_polarization or test_pixelweights_local_datapath)' %{buildroot}%{$python_sitearch}/healpy
donttest="test_astropy_download_file or test_rotate_map_polarization or test_pixelweights_local_datapath"
# Upstream is investigating: gh#healpy/healpy#987
donttest="$donttest or test_map2alm_lsq"
%pytest_arch test -k "not ($donttest)"
%post
%python_install_alternative healpy_get_wmap_maps.sh
@ -112,10 +102,6 @@ export PYTEST_DEBUG_TEMPROOT=$(mktemp -d -p ./)
%license COPYING
%python_alternative %{_bindir}/healpy_get_wmap_maps.sh
%{python_sitearch}/healpy/
%{python_sitearch}/healpy-%{version}*-info/
%exclude %{python_sitearch}/healpy/src
%files %{python_files devel}
%{python_sitearch}/healpy/src/
%{python_sitearch}/healpy-%{version}.dist-info/
%changelog