From d1d436322bd6859c074e6e5d929f70cb8c0f09d7e266704e49ffe9daa9d88783 Mon Sep 17 00:00:00 2001 From: Benjamin Greiner Date: Wed, 12 Feb 2025 21:32:14 +0000 Subject: [PATCH] - 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 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-healpy?expand=0&rev=20 --- .gitattributes | 23 +++ .gitignore | 1 + healpy-1.16.6.tar.gz | 3 + healpy-1.18.0.tar.gz | 3 + python-healpy-matplotlib-1_9-compat.patch | 76 +++++++++ python-healpy-scipy-1_14-compat.patch | 20 +++ python-healpy.changes | 186 ++++++++++++++++++++++ python-healpy.spec | 107 +++++++++++++ 8 files changed, 419 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 healpy-1.16.6.tar.gz create mode 100644 healpy-1.18.0.tar.gz create mode 100644 python-healpy-matplotlib-1_9-compat.patch create mode 100644 python-healpy-scipy-1_14-compat.patch create mode 100644 python-healpy.changes create mode 100644 python-healpy.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/healpy-1.16.6.tar.gz b/healpy-1.16.6.tar.gz new file mode 100644 index 0000000..ed67a91 --- /dev/null +++ b/healpy-1.16.6.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ab26e828fcd251a141095af6d9bf3dba43cec6f0f5cd48b65bf0af8f56329f1 +size 4374432 diff --git a/healpy-1.18.0.tar.gz b/healpy-1.18.0.tar.gz new file mode 100644 index 0000000..f735188 --- /dev/null +++ b/healpy-1.18.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a12fd8f804c8a6d193dc43d1dcdf636808830e1ccc0aa7c53d83e394bb15289 +size 4812612 diff --git a/python-healpy-matplotlib-1_9-compat.patch b/python-healpy-matplotlib-1_9-compat.patch new file mode 100644 index 0000000..7e12d9b --- /dev/null +++ b/python-healpy-matplotlib-1_9-compat.patch @@ -0,0 +1,76 @@ +From 7a68c6d83a78961027601025fc6553a67f6a44a6 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +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) diff --git a/python-healpy-scipy-1_14-compat.patch b/python-healpy-scipy-1_14-compat.patch new file mode 100644 index 0000000..4d71757 --- /dev/null +++ b/python-healpy-scipy-1_14-compat.patch @@ -0,0 +1,20 @@ +--- + 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/" diff --git a/python-healpy.changes b/python-healpy.changes new file mode 100644 index 0000000..7345c46 --- /dev/null +++ b/python-healpy.changes @@ -0,0 +1,186 @@ +------------------------------------------------------------------- +Wed Feb 12 15:50:59 UTC 2025 - Ben Greiner + +- 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 + +- Add python-healpy-scipy-1_14-compat.patch: Account for the + renaming of trapz to trapezoid in scipy 1.14. +- Add python-healpy-matplotlib-1_9-compat.patch: Fix compatibility + with matplotlib >= 3.9; upstream commit 0b1f498 rebased for + current version. + +------------------------------------------------------------------- +Wed Oct 4 23:12:42 UTC 2023 - Atri Bhattacharya + +- Update to version 1.16.6: + * Support for Python 3.12. +- Split out -devel package containing C++ headers/sources. + +------------------------------------------------------------------- +Mon Sep 4 16:40:18 UTC 2023 - Atri Bhattacharya + +- Update to version 1.16.5: + * No documented changes. +- Changes from vesion 1.16.4: + * Updated HEALPix C++ to fix compilation issue, no actual + changes to the library (gh#healpy/healpy#875). + * Fix support for latest Cython (gh#healpy/healpy#862). + * Minor changes to packaging and actions (gh#healpy/healpy#872, + gh#healpy/healpy#865, gh#healpy/healpy#864, + gh#healpy/healpy#863). +- Changes from version 1.16.3: + * Drop support for Python 3.7 (gh#healpy/healpy#821). + * Added wheels for aarch64 under emulation in Github Actions + (gh#healpy/healpy#819). + * Allow pixelfunc.get_interp_val to operate on multiple maps + (gh#healpy/healpy#816). + * Add healpy-specific HealpyDeprecationWarning instead of using + astropy's (gh#healpy/healpy#822). + * Bugfix in Rotator in rmul (gh#healpy/healpy#810). +- Use wheel macros to package; new BuildRequires: + python-setuptools_scm, python-pip, python-wheel. + +------------------------------------------------------------------- +Wed May 31 08:31:02 UTC 2023 - Dirk Müller + +- update to 1.16.2: + * Add `resize_alm` function to change a Alm array to a + different ell max + * Build wheels for Python 3.11 + * Instructions on how to build an optimized package for healpy + +------------------------------------------------------------------- +Tue Oct 11 10:18:41 UTC 2022 - pgajdos@suse.com + +- version update to 1.16.1 + * Updated CFITSIO included in `healpy` to 4.1.0, necessary for + compatibility with Apple ARM chips +- Changes from versions 1.16.0: + * Update HEALPix C++ sources to revision 1206 + * Do not normalize binary arrays + * Fix unncessary log warning message in plots + * Fixed double application of `margins` in visualization + functions when using subplot syntax and implemented + `margins` parameter for `mollview`, `orthview`, and + `azeqview` when subplot syntax is not used + * Fixed `reuse_axes=True` for `cartview` and `gnomview` + * New features in `projview`: subplots, remove monopole-dipole, + labels, tickmarks, graticule, Planck and WMAP colormaps + * Fixed the CFITSIO version mismatch warning + * Added colorbar ticks and normalization +- python-six is not required + +------------------------------------------------------------------- +Tue Jul 12 00:16:21 UTC 2022 - Atri Bhattacharya + +- Update to version 1.15.2: + * Update HEALPix C++ sources after update of ABI + (gh#healpy/healpy#746). +- Changes from versions 1.15.1: + * New function hp.blm_gauss to generate alm of a gaussian beam + (gh#healpy/healpy#735). + * Implement rotation in the graticule of projview + (gh#healpy/healpy#732). + * Explain how to create a local datapath for pixel weights + (gh#healpy/healpy#720). + * Improvement on is_seq to avoid synalm breaking on JAX input + arrays, added unit tests (gh#healpy/healpy#716). + * Upgraded HEALPix C++ sources to HEALPix 3.8.1, fixing + incompatibility with CFITSIO 4 (gh#healpy/healpy#727) and + (gh#healpy/healpy#743). + +------------------------------------------------------------------- +Wed Aug 18 12:35:01 UTC 2021 - Atri Bhattacharya + +- Update to version 1.15.0: + * Write_map keeps dtype of input map array instead of float32 + (gh#healpy/healpy#688). + * Read_map keeps dtype of FITS file instead of upcasting to + float64 (gh#healpy/healpy#688). + * Write_cl uses dtype of input cl instead of float64 + (gh#healpy/healpy#688). + * Changed all warnings to using the logging module, deprecated + all verbose keywords (gh#healpy/healpy#693). + * Experimental projview function to plot maps using projections + from matplotlib (gh#healpy/healpy#695). + * Flip sign for spin-0 alm2map_spin and map2alm_spin + (gh#healpy/healpy#707). + * Support transparency in plotting with the alpha parameter + (gh#healpy/healpy#696). + * Removed the note that we will change order of cl in synfast + and synalm, we will leave new=False default + (gh#healpy/healpy#687). + * Added convenice functions order2npix and npix2order + (gh#healpy/healpy#685). + * Support nested maps hp.smoothing (gh#healpy/healpy#678). + * Improvements of the build system (gh#healpy/healpy#660). + * Automatically build wheels for Linux/MacOS on Github actions + (gh#healpy/healpy#656). + * Drop support for Python 2.7-3.5 (gh#healpy/healpy#658). + * Allow OBJECT FITS header not to be a string + (gh#healpy/healpy#665). + * Fixed indexing issue in bl2beam (gh#healpy/healpy#667). + * Fixed map2alm_spin bug for masked input + (gh#healpy/healpy#651). + * Minor bugfixes: + - Accept None for cls in synalm (gh#healpy/healpy#711) + - Get nside from length of array in read_map + (gh#healpy/healpy#710). + - Fix spin 0 transforms in alm2map_spin + (gh#healpy/healpy#708). + - Raise exception for rotate_alm with complex64 inputs + (gh#healpy/healpy#704). + - Replace deprecated numpy aliases (gh#healpy/healpy#698). +- New BuildRequires: python-Cython. +- Drop python-healpy-drop-pytest-runner.patch: Upstream no longer + requires pytest-runner for its tests. + +------------------------------------------------------------------- +Thu Jan 21 15:32:02 UTC 2021 - Benjamin Greiner + +- Skip python36 because astropy is python >= 3.7 + +------------------------------------------------------------------- +Sun Aug 16 11:13:22 UTC 2020 - Atri Bhattacharya + +- Add python-healpy-drop-pytest-runner.patch: Drop pytest-runner + which is unnecessary when running tests via pytest directly + (gh#healpy/healpy#649). + +------------------------------------------------------------------- +Sun Aug 16 09:19:36 UTC 2020 - Atri Bhattacharya + +- Initial package diff --git a/python-healpy.spec b/python-healpy.spec new file mode 100644 index 0000000..3cff795 --- /dev/null +++ b/python-healpy.spec @@ -0,0 +1,107 @@ +# +# spec file for package python-healpy +# +# 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 +# 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 https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-healpy +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 +BuildRequires: %{python_module Cython} +BuildRequires: %{python_module devel >= 3.10} +BuildRequires: %{python_module numpy-devel >= 1.19} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools >= 60} +BuildRequires: %{python_module setuptools_scm >= 8} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: gcc-c++ +BuildRequires: pkgconfig +BuildRequires: python-rpm-macros +BuildRequires: pkgconfig(cfitsio) +BuildRequires: pkgconfig(healpix_cxx) +BuildRequires: pkgconfig(libsharp) +Requires: python-astropy >= 4.0 +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} +BuildRequires: %{python_module matplotlib} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module requests} +BuildRequires: %{python_module scipy} +# /SECTION +%python_subpackages + +%description +healpy is a Python package to handle pixelated data on the sphere. It is based +on the Hierarchical Equal Area isoLatitude Pixelization (HEALPix) scheme and +bundles the HEALPix C++ library. + +healpy provides utilities to: +* convert between sky coordinates and pixel indices in HEALPix nested and ring schemes +* find pixels within a disk, a polygon or a strip in the sky +* apply coordinate transformations between Galactic, Ecliptic and Equatorial reference frames +* apply custom rotations either to vectors or full maps +* read and write HEALPix maps to disk in FITS format +* upgrade and downgrade the resolution of existing HEALPix maps +* visualize maps in Mollweide, Gnomonic and Cartographic projections +* 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 + +%prep +%autosetup -p1 -n healpy-%{version} +chmod -x lib/healpy/data/*.dat + +%build +export CFLAGS="%{optflags}" +%pyproject_wheel + +%install +%pyproject_install +%python_clone -a %{buildroot}%{_bindir}/healpy_get_wmap_maps.sh +%python_expand %fdupes %{buildroot}%{$python_sitearch} + +%check +export PYTEST_DEBUG_TEMPROOT=$(mktemp -d -p ./) +# Skip tests requiring network access +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 + +%postun +%python_uninstall_alternative healpy_get_wmap_maps.sh + +%files %{python_files} +%doc CHANGELOG.rst README.rst +%license COPYING +%python_alternative %{_bindir}/healpy_get_wmap_maps.sh +%{python_sitearch}/healpy/ +%{python_sitearch}/healpy-%{version}.dist-info/ + +%changelog