Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-healpy for openSUSE:Factory checked in at 2023-05-31 21:54:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-healpy (Old)
and /work/SRC/openSUSE:Factory/.python-healpy.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-healpy"
Wed May 31 21:54:49 2023 rev:6 rq:1089962 version:1.16.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-healpy/python-healpy.changes 2022-10-11 18:05:58.878126659 +0200
+++ /work/SRC/openSUSE:Factory/.python-healpy.new.1533/python-healpy.changes 2023-05-31 21:54:55.549157310 +0200
@@ -1,0 +2,9 @@
+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
+
+-------------------------------------------------------------------
Old:
----
healpy-1.16.1.tar.gz
New:
----
healpy-1.16.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-healpy.spec ++++++
--- /var/tmp/diff_new_pack.lT9IPH/_old 2023-05-31 21:54:56.037160194 +0200
+++ /var/tmp/diff_new_pack.lT9IPH/_new 2023-05-31 21:54:56.045160241 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-healpy
#
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,11 +16,9 @@
#
-# Builds on astropy, which is python >= 3.7 on TW
-%define skip_python2 1
-%define skip_python36 1
+%{?sle15_python_module_pythons}
Name: python-healpy
-Version: 1.16.1
+Version: 1.16.2
Release: 0
Summary: Python library to handle pixelated data on the sphere based on HEALPix
License: GPL-2.0-only
++++++ healpy-1.16.1.tar.gz -> healpy-1.16.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/healpy-1.16.1/CHANGELOG.rst new/healpy-1.16.2/CHANGELOG.rst
--- old/healpy-1.16.1/CHANGELOG.rst 2022-07-23 01:28:49.000000000 +0200
+++ new/healpy-1.16.2/CHANGELOG.rst 2023-01-10 05:52:33.000000000 +0100
@@ -1,5 +1,11 @@
Unreleased
+Release 1.16.2 26 October 2022
+
+* Add `resize_alm` function to change a Alm array to a different ell max https://github.com/healpy/healpy/pull/803
+* Build wheels for Python 3.11 https://github.com/healpy/healpy/pull/793
+* Instructions on how to build an optimized package for healpy https://github.com/healpy/healpy/pull/779
+
Release 1.16.1 22 July 2022, included in HEALPix 3.8.2
* Updated CFITSIO included in `healpy` to 4.1.0, necessary for compatibility with Apple ARM chips https://github.com/healpy/healpy/pull/776
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/healpy-1.16.1/INSTALL.rst new/healpy-1.16.2/INSTALL.rst
--- old/healpy-1.16.1/INSTALL.rst 2022-07-23 01:28:49.000000000 +0200
+++ new/healpy-1.16.2/INSTALL.rst 2023-01-10 05:52:33.000000000 +0100
@@ -1,6 +1,11 @@
Installation procedure for Healpy
=================================
+(NOTE: if high performance of the installed package is important, e.g. when
+installing in computing centers or for performing benchmarks, please be sure
+to read the `Generating native binaries`_ section below.)
+
+
Requirements
------------
@@ -227,6 +232,24 @@
In case of compilation errors, see the note above in the ``pip`` section.
+Generating native binaries
+--------------------------
+
+Using pre-compiled wheels is typically the easiest and quickest way
+to install ``healpy`` on a system. However, the performance of the installed
+package may not be optimal, since the wheel has to work on all CPUs of a given
+architecture (e.g. x86_64) and will therefore probably not use all features
+present in your local CPU. A ``healpy`` installation which is custom-tailored
+for a specific target CPU may be two or three times faster for some operations
+(most notably ``alm2map*`` and ``map2alm*`` calls).
+
+To achieve target-specific compilation, ``healpy`` must be installed from source
+and the ``-march=native`` flag has to be passed to the compilers.
+While details may vary slightly depending on the target platform,
+the installation command will have this basic form::
+
+ CC=gcc CXX=g++ CFLAGS="-fPIC -O3 -march=native" CXXFLAGS="-fPIC -O3 -march=native" pip3 install --user --no-binary healpy healpy
+
Clean
-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/healpy-1.16.1/PKG-INFO new/healpy-1.16.2/PKG-INFO
--- old/healpy-1.16.1/PKG-INFO 2022-07-23 01:29:28.953338100 +0200
+++ new/healpy-1.16.2/PKG-INFO 2023-01-10 05:52:59.115606800 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: healpy
-Version: 1.16.1
+Version: 1.16.2
Summary: Healpix tools package for Python
Home-page: http://github.com/healpy
Author: C. Rosset, A. Zonca
@@ -16,6 +16,7 @@
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.7
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/healpy-1.16.1/healpy/__init__.py new/healpy-1.16.2/healpy/__init__.py
--- old/healpy-1.16.1/healpy/__init__.py 2022-07-23 01:28:49.000000000 +0200
+++ new/healpy-1.16.2/healpy/__init__.py 2023-01-10 05:52:33.000000000 +0100
@@ -84,7 +84,8 @@
check_max_nside,
map2alm_spin,
alm2map_spin,
- blm_gauss
+ blm_gauss,
+ resize_alm
)
from ._query_disc import query_disc, query_strip, query_polygon, boundaries
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/healpy-1.16.1/healpy/newvisufunc.py new/healpy-1.16.2/healpy/newvisufunc.py
--- old/healpy-1.16.1/healpy/newvisufunc.py 2022-07-23 01:28:49.000000000 +0200
+++ new/healpy-1.16.2/healpy/newvisufunc.py 2023-01-10 05:52:33.000000000 +0100
@@ -113,7 +113,7 @@
remove_dip=False,
remove_mono=False,
gal_cut=0,
- **kwargs
+ **kwargs,
):
"""Plot a healpix map (given as an array) in the chosen projection.
@@ -379,9 +379,9 @@
lpad = (
4 if override_plot_properties["vertical_tick_rotation"] != 90 else lpad
)
- if title is not None:
+ if title is not None:
lpad += 8
-
+
# pass the default settings to the plot_properties dictionary
plot_properties = {
"cbar_shrink": shrink,
@@ -432,12 +432,8 @@
else:
nrows, ncols, idx = sub // 100, (sub % 100) // 10, (sub % 10)
if idx < 1 or idx > ncols * nrows:
- raise ValueError(
- "Wrong values for sub: %d, %d, %d" % (nrows, ncols, idx)
- )
+ raise ValueError("Wrong values for sub: %d, %d, %d" % (nrows, ncols, idx))
-
-
if not (hold or reuse_axes) and sub == 111:
fig = plt.figure(
figsize=(
@@ -446,7 +442,7 @@
plot_properties["figure_width"]
* plot_properties["figure_size_ratio"]
),
- ),
+ )
)
extent = (0.02, 0.05, 0.96, 0.9)
elif hold:
@@ -468,7 +464,7 @@
* plot_properties["figure_size_ratio"]
)
* (nrows / ncols),
- ),
+ )
)
else:
fig = plt.gcf()
@@ -494,7 +490,7 @@
)
"""
# FIXME: make a more general axes creation that works also with subplots
- #ax = fig.add_axes(extent, projection=projection_type)
+ # ax = fig.add_axes(extent, projection=projection_type)
if projection_type == "cart":
ax = fig.add_subplot(nrows, ncols, idx)
else:
@@ -509,12 +505,6 @@
# end if not
if graticule and graticule_labels:
left += 0.02
- plt.subplots_adjust(
- left=left,
- right=right,
- top=top,
- bottom=bottom,
- )
ysize = xsize // 2
theta = np.linspace(np.pi, 0, ysize)
@@ -524,6 +514,7 @@
if flip == "astro":
longitude = longitude[::-1]
if not return_only_data:
+ plt.subplots_adjust(left=left, right=right, top=top, bottom=bottom)
# set property on ax so it can be used in newprojplot
ax.healpy_flip = flip
@@ -547,12 +538,7 @@
max = m[w].max()
cm, nn = get_color_table(
- min,
- max,
- m[w],
- cmap=cmap,
- norm=norm,
- **norm_dict_defaults,
+ min, max, m[w], cmap=cmap, norm=norm, **norm_dict_defaults
)
grid_pix = ang2pix(nside, THETA, PHI, nest=nest)
grid_map = m[grid_pix]
@@ -617,9 +603,7 @@
elif phi_convention == "symmetrical":
xtick_formatter = ThetaFormatterSymmetricPhi(longitude_grid_spacing)
- ax.xaxis.set_major_formatter(
- xtick_formatter,
- )
+ ax.xaxis.set_major_formatter(xtick_formatter)
ax.yaxis.set_major_formatter(ThetaFormatterTheta(latitude_grid_spacing))
if custom_xtick_labels is not None:
@@ -688,10 +672,10 @@
# Hide all tickslabels not in tick variable. Do not delete tick-markers
if show_tickmarkers:
- ticks = list(set(cb.get_ticks()) | set(cbar_ticks))
+ ticks = list(set(cb.get_ticks()) | set(cbar_ticks))
ticks = np.sort(ticks)
- ticks = ticks[ticks>=min]
- ticks = ticks[ticks<=max]
+ ticks = ticks[ticks >= min]
+ ticks = ticks[ticks <= max]
labels = [format % tick if tick in cbar_ticks else "" for tick in ticks]
cb.set_ticks(ticks, labels)
@@ -701,10 +685,7 @@
if cb_orientation == "horizontal":
# labels = cb.ax.get_xticklabels() if norm is not None else labels
- cb.ax.set_xticklabels(
- labels,
- fontname=fontname,
- )
+ cb.ax.set_xticklabels(labels, fontname=fontname)
cb.ax.xaxis.set_label_text(
unit, fontsize=fontsize_defaults["cbar_label"], fontname=fontname
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/healpy-1.16.1/healpy/rotator.py new/healpy-1.16.2/healpy/rotator.py
--- old/healpy-1.16.1/healpy/rotator.py 2022-07-23 01:28:49.000000000 +0200
+++ new/healpy-1.16.2/healpy/rotator.py 2023-01-10 05:52:33.000000000 +0100
@@ -285,7 +285,7 @@
)
rots = b._rots + self._rots
coords = b._coords + self._coords
- invs = self._invs + a._invs
+ invs = self._invs + b._invs
return Rotator(rot=rots, coord=coords, inv=invs, deg=False)
def __nonzero__(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/healpy-1.16.1/healpy/sphtfunc.py new/healpy-1.16.2/healpy/sphtfunc.py
--- old/healpy-1.16.1/healpy/sphtfunc.py 2022-07-23 01:28:49.000000000 +0200
+++ new/healpy-1.16.2/healpy/sphtfunc.py 2023-01-10 05:52:33.000000000 +0100
@@ -1432,3 +1432,43 @@
blm[2] = 1j * blm[1]
return blm
+
+
+def resize_alm(alm, lmax, mmax, lmax_out, mmax_out):
+ """Returns a resized copy of the input a_lm, either truncated or
+ padded with zeros.
+
+ Parameters
+ ----------
+ alm : array or sequence of arrays, complex
+ A complex array of alm, or a sequence of such arrays.
+ Size of each array must be of the form mmax*(lmax-mmax+1)/2+lmax
+ lmax, mmax: int, scalar
+ maximum l and m multipole moments of the input alm
+ lmax_out, mmax_out: int, scalar
+ maximum l and m multipole moments of the output alm
+
+ Returns
+ -------
+ array or sequence of arrays, complex
+ A complex array of alm, or a sequence of such arrays.
+ Size of each array will be of the form mmax_out*(lmax_out-mmax_out+1)/2+lmax_out
+ """
+ alm = np.array(alm)
+ if alm.ndim < 1 or alm.ndim > 2:
+ raise ValueError("incorrect dimensionality of the input a_lm")
+ if alm.ndim == 2:
+ return [resize_alm(almi, lmax, mmax, lmax_out, mmax_out) for almi in alm]
+ # alm is a 1D array
+ if alm.shape[0] != Alm.getsize(lmax, mmax):
+ raise ValueError("inconsistent number of input a_lm")
+ res = np.zeros(Alm.getsize(lmax_out, mmax_out), dtype=alm.dtype)
+ lmaxmin = min(lmax, lmax_out)
+ mmaxmin = min(mmax, mmax_out)
+ ofs_i, ofs_o = 0, 0
+ for m in range(0, mmaxmin + 1):
+ nval = lmaxmin - m + 1
+ res[ofs_o : ofs_o + nval] = alm[ofs_i : ofs_i + nval]
+ ofs_i += lmax - m + 1
+ ofs_o += lmax_out - m + 1
+ return res
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/healpy-1.16.1/healpy/src/_healpy_pixel_lib.cc new/healpy-1.16.2/healpy/src/_healpy_pixel_lib.cc
--- old/healpy-1.16.1/healpy/src/_healpy_pixel_lib.cc 2022-07-23 01:28:49.000000000 +0200
+++ new/healpy-1.16.2/healpy/src/_healpy_pixel_lib.cc 2023-01-10 05:52:33.000000000 +0100
@@ -378,8 +378,8 @@
{
int64 nside = *(int64*)ip1;
if (nside!=oldnside)
- { oldnside=nside; hb.SetNside(nside, NEST);
- /* ring and nest should give the same result */
+ { oldnside=nside; hb.SetNside(nside, RING);
+ /* RING and NEST should give the same result but use RING because NEST only allows power of 2 nside */
}
double max_pixrad = hb.max_pixrad();
*(double *)op1 = max_pixrad;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/healpy-1.16.1/healpy/test/test_sphtfunc.py new/healpy-1.16.2/healpy/test/test_sphtfunc.py
--- old/healpy-1.16.1/healpy/test/test_sphtfunc.py 2022-07-23 01:28:49.000000000 +0200
+++ new/healpy-1.16.2/healpy/test/test_sphtfunc.py 2023-01-10 05:52:33.000000000 +0100
@@ -406,7 +406,7 @@
"""Test whether 'smoothing' wrapped with accept_ma works with only
keyword arguments."""
- ma = np.ones(12 * 16 ** 2)
+ ma = np.ones(12 * 16**2)
try:
hp.smoothing(map_in=ma)
except IndexError:
@@ -417,10 +417,10 @@
theta = np.linspace(0, np.radians(1.0), 1000)
sigma = np.radians(10.0 / 60.0) / np.sqrt(8.0 * np.log(2.0))
- gaussian_beam = np.exp(-0.5 * (theta / sigma) ** 2) / (2 * np.pi * sigma ** 2)
+ gaussian_beam = np.exp(-0.5 * (theta / sigma) ** 2) / (2 * np.pi * sigma**2)
ell = np.arange(512 + 1.0)
- gaussian_window = np.exp(-0.5 * ell * (ell + 1) * sigma ** 2)
+ gaussian_window = np.exp(-0.5 * ell * (ell + 1) * sigma**2)
bl = hp.beam2bl(gaussian_beam, theta, 512)
np.testing.assert_allclose(gaussian_window, bl, rtol=1e-4)
@@ -430,10 +430,10 @@
theta = np.linspace(0, np.radians(3.0), 1000)
sigma = np.radians(1.0) / np.sqrt(8.0 * np.log(2.0))
- gaussian_beam = np.exp(-0.5 * (theta / sigma) ** 2) / (2 * np.pi * sigma ** 2)
+ gaussian_beam = np.exp(-0.5 * (theta / sigma) ** 2) / (2 * np.pi * sigma**2)
ell = np.arange(2048 + 1.0)
- gaussian_window = np.exp(-0.5 * ell * (ell + 1) * sigma ** 2)
+ gaussian_window = np.exp(-0.5 * ell * (ell + 1) * sigma**2)
beam = hp.bl2beam(gaussian_window, theta)
np.testing.assert_allclose(gaussian_beam, beam, rtol=1e-3)
@@ -452,7 +452,7 @@
def test_pixwin_base(self):
# Base case
- nsides = [2 ** p for p in np.arange(1, 14)]
+ nsides = [2**p for p in np.arange(1, 14)]
[hp.pixwin(nside) for nside in nsides]
# Test invalid nside
@@ -645,5 +645,33 @@
np.testing.assert_allclose(blm, blm_ref, atol=1e-7)
+
+@pytest.mark.parametrize(
+ "lmax, mmax, lmax_out, mmax_out", [(5, 5, 10, 10), (5, 5, 3, 3), (8, 5, 7, 6)]
+)
+def test_resize_alm(lmax, mmax, lmax_out, mmax_out):
+ alm = np.random.uniform(size=hp.Alm.getsize(lmax, mmax)).astype(np.complex128)
+ alm_out = hp.resize_alm(alm, lmax, mmax, lmax_out, mmax_out)
+ lmaxmax = max(lmax, lmax_out)
+ lmaxmin = min(lmax, lmax_out)
+ for m in range(0, mmax + 1):
+ for l in range(m, lmax + 1):
+ idx1 = hp.Alm.getidx(lmax, l, m)
+ if l <= lmax_out and m <= mmax_out:
+ idx2 = hp.Alm.getidx(lmax_out, l, m)
+ assert alm[idx1] == alm_out[idx2]
+ for m in range(0, mmax_out + 1):
+ for l in range(m, lmax_out + 1):
+ idx2 = hp.Alm.getidx(lmax_out, l, m)
+ if l <= lmax and m <= mmax:
+ idx1 = hp.Alm.getidx(lmax, l, m)
+ assert alm[idx1] == alm_out[idx2]
+ else:
+ assert alm_out[idx2] == 0
+ alm_out2 = hp.resize_alm([alm, 2 * alm], lmax, mmax, lmax_out, mmax_out)
+ np.testing.assert_allclose(alm_out, alm_out2[0])
+ np.testing.assert_allclose(2 * alm_out, alm_out2[1])
+
+
if __name__ == "__main__":
unittest.main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/healpy-1.16.1/healpy/version.py new/healpy-1.16.2/healpy/version.py
--- old/healpy-1.16.1/healpy/version.py 2022-07-23 01:28:49.000000000 +0200
+++ new/healpy-1.16.2/healpy/version.py 2023-01-10 05:52:33.000000000 +0100
@@ -1 +1 @@
-__version__ = "1.16.1"
+__version__ = "1.16.2"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/healpy-1.16.1/healpy.egg-info/PKG-INFO new/healpy-1.16.2/healpy.egg-info/PKG-INFO
--- old/healpy-1.16.1/healpy.egg-info/PKG-INFO 2022-07-23 01:29:28.000000000 +0200
+++ new/healpy-1.16.2/healpy.egg-info/PKG-INFO 2023-01-10 05:52:58.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: healpy
-Version: 1.16.1
+Version: 1.16.2
Summary: Healpix tools package for Python
Home-page: http://github.com/healpy
Author: C. Rosset, A. Zonca
@@ -16,6 +16,7 @@
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.7
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/healpy-1.16.1/pyproject.toml new/healpy-1.16.2/pyproject.toml
--- old/healpy-1.16.1/pyproject.toml 2022-07-23 01:28:49.000000000 +0200
+++ new/healpy-1.16.2/pyproject.toml 2023-01-10 05:52:33.000000000 +0100
@@ -17,4 +17,4 @@
[tool.cibuildwheel.macos]
before-all = "brew install automake"
-environment = {"CC" = "gcc-9", "CXX" = "g++-9"}
+environment = {"CC" = "gcc-11", "CXX" = "g++-11"}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/healpy-1.16.1/setup.py new/healpy-1.16.2/setup.py
--- old/healpy-1.16.1/setup.py 2022-07-23 01:28:49.000000000 +0200
+++ new/healpy-1.16.2/setup.py 2023-01-10 05:52:33.000000000 +0100
@@ -336,6 +336,7 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Astronomy",
"Topic :: Scientific/Engineering :: Visualization",
],