1
0

Accepting request 1044138 from home:bnavigator:branches:devel:languages:python:numeric

- Update to 5.2
  * Astropy 5.2 is a major release that adds significant new
    functionality since the 5.1 release.
  * In particular, this release includes:
  * Quantity data types
  * Updates to astropy.cosmology
  * Topocentric ITRS Frame
  * Enhanced Fixed Width ASCII Tables
  * Accessing cloud-hosted FITS files
  * Drawing the instrument beam and a physical scale bar on
    celestial images
  * Interior ticks and tick labels
  * Support for tilde-prefixed paths
  * CCDData PSF Image representation
  * In addition to these major changes, Astropy 5.2 includes a
    large number of smaller improvements and bug fixes.
- Move to PEP517 build
- Revert rpmlintrc: the whitelist error category has been removed
  from rpmlint

OBS-URL: https://build.opensuse.org/request/show/1044138
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-astropy?expand=0&rev=85
This commit is contained in:
Benjamin Greiner 2022-12-21 23:34:54 +00:00 committed by Git OBS Bridge
parent d47cd6e399
commit 8b28111bda
6 changed files with 136 additions and 21 deletions

View File

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

3
astropy-5.2.tar.gz Normal file
View File

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

View File

@ -0,0 +1,90 @@
From 505533d3048e9193ea00a4eaae00490cc4f1c74d Mon Sep 17 00:00:00 2001
From: "P. L. Lim" <2090236+pllim@users.noreply.github.com>
Date: Mon, 19 Dec 2022 14:41:48 -0500
Subject: [PATCH] Backport PR #14193: Fix compat with Numpy 1.24
---
astropy/units/quantity.py | 5 +++++
astropy/utils/compat/numpycompat.py | 2 +-
astropy/utils/masked/function_helpers.py | 6 +++---
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/astropy/units/quantity.py b/astropy/units/quantity.py
index b98abfafb09..1a11625ae98 100644
--- a/astropy/units/quantity.py
+++ b/astropy/units/quantity.py
@@ -1679,27 +1679,32 @@ def itemset(self, *args):
self.view(np.ndarray).itemset(*(args[:-1] + (self._to_own_unit(args[-1]),)))
def tostring(self, order="C"):
+ """Not implemented, use ``.value.tostring()`` instead."""
raise NotImplementedError(
"cannot write Quantities to string. Write array with"
" q.value.tostring(...)."
)
def tobytes(self, order="C"):
+ """Not implemented, use ``.value.tobytes()`` instead."""
raise NotImplementedError(
"cannot write Quantities to bytes. Write array with q.value.tobytes(...)."
)
def tofile(self, fid, sep="", format="%s"):
+ """Not implemented, use ``.value.tofile()`` instead."""
raise NotImplementedError(
"cannot write Quantities to file. Write array with q.value.tofile(...)"
)
def dump(self, file):
+ """Not implemented, use ``.value.dump()`` instead."""
raise NotImplementedError(
"cannot dump Quantities to file. Write array with q.value.dump()"
)
def dumps(self):
+ """Not implemented, use ``.value.dumps()`` instead."""
raise NotImplementedError(
"cannot dump Quantities to string. Write array with q.value.dumps()"
)
diff --git a/astropy/utils/compat/numpycompat.py b/astropy/utils/compat/numpycompat.py
index 0698ef6279f..9b744448668 100644
--- a/astropy/utils/compat/numpycompat.py
+++ b/astropy/utils/compat/numpycompat.py
@@ -24,5 +24,5 @@
NUMPY_LT_1_22 = not minversion(np, "1.22")
NUMPY_LT_1_22_1 = not minversion(np, "1.22.1")
NUMPY_LT_1_23 = not minversion(np, "1.23")
-NUMPY_LT_1_24 = not minversion(np, "1.24dev0")
+NUMPY_LT_1_24 = not minversion(np, "1.24")
NUMPY_LT_1_25 = not minversion(np, "1.25.0.dev0+151")
diff --git a/astropy/utils/masked/function_helpers.py b/astropy/utils/masked/function_helpers.py
index eefd099ba4a..7440ec5b59f 100644
--- a/astropy/utils/masked/function_helpers.py
+++ b/astropy/utils/masked/function_helpers.py
@@ -12,7 +12,7 @@
import numpy as np
from astropy.units.quantity_helper.function_helpers import FunctionAssigner
-from astropy.utils.compat import NUMPY_LT_1_23, NUMPY_LT_1_25
+from astropy.utils.compat import NUMPY_LT_1_23, NUMPY_LT_1_24
# This module should not really be imported, but we define __all__
# such that sphinx can typeset the functions with docstrings.
@@ -587,7 +587,7 @@ def median(a, axis=None, out=None, **kwargs):
a = Masked(a)
- if NUMPY_LT_1_25:
+ if NUMPY_LT_1_24:
keepdims = kwargs.pop("keepdims", False)
r, k = np.lib.function_base._ureduce(
a, func=_masked_median, axis=axis, out=out, **kwargs
@@ -643,7 +643,7 @@ def quantile(a, q, axis=None, out=None, **kwargs):
if not np.lib.function_base._quantile_is_valid(q):
raise ValueError("Quantiles must be in the range [0, 1]")
- if NUMPY_LT_1_25:
+ if NUMPY_LT_1_24:
keepdims = kwargs.pop("keepdims", False)
r, k = np.lib.function_base._ureduce(
a, func=_masked_quantile, q=q, axis=axis, out=out, **kwargs

View File

@ -1,5 +1,3 @@
addFilter('devel-file-in-non-devel-package .*/wcs/.*')
addFilter('hidden-file-or-dir .*/tests/data/.*')
addFilter('zero-length .*/tests/data/.*')
# https://github.com/rpm-software-management/rpmlint/issues/965, https://docs.astropy.org/en/latest/development/testguide.html#astropy-test
addFilter('python-tests-in-package .*astropy/.*tests')

View File

@ -1,3 +1,26 @@
-------------------------------------------------------------------
Wed Dec 21 22:56:59 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Update to 5.2
* Astropy 5.2 is a major release that adds significant new
functionality since the 5.1 release.
* In particular, this release includes:
* Quantity data types
* Updates to astropy.cosmology
* Topocentric ITRS Frame
* Enhanced Fixed Width ASCII Tables
* Accessing cloud-hosted FITS files
* Drawing the instrument beam and a physical scale bar on
celestial images
* Interior ticks and tick labels
* Support for tilde-prefixed paths
* CCDData PSF Image representation
* In addition to these major changes, Astropy 5.2 includes a
large number of smaller improvements and bug fixes.
- Move to PEP517 build
- Revert rpmlintrc: the whitelist error category has been removed
from rpmlint
-------------------------------------------------------------------
Mon Nov 21 11:03:53 UTC 2022 - Ben Greiner <code@bnavigator.de>

View File

@ -54,33 +54,38 @@
%{?unbundle_wcs}
Name: python-astropy%{psuffix}
Version: 5.1.1
Version: 5.2
Release: 0
Summary: Community-developed python astronomy tools
License: BSD-3-Clause
URL: https://astropy.org
Source: https://files.pythonhosted.org/packages/source/a/astropy/astropy-%{version}.tar.gz
# SourceRepository: https://github.com/astropy/astropy
# Mark wcs headers as false positives for devel-file-in-non-devel-package
# These are used by the python files so they must be available.
Source100: python-astropy-rpmlintrc
# https://docs.astropy.org/en/v5.0/install.html#requirements
BuildRequires: %{python_module Cython >= 0.29.22}
# PATCH-FIX-UPSTREAM
Patch1: https://github.com/astropy/astropy/pull/14194.patch#/astropy-pr14194-numpy1.24.patch
# https://docs.astropy.org/en/v5.2/install.html#requirements
BuildRequires: %{python_module Cython >= 0.29.30}
BuildRequires: %{python_module Jinja2}
BuildRequires: %{python_module PyYAML >= 3.13}
BuildRequires: %{python_module devel >= 3.8}
BuildRequires: %{python_module extension-helpers}
BuildRequires: %{python_module numpy-devel >= 1.18}
BuildRequires: %{python_module numpy-devel >= 1.20}
BuildRequires: %{python_module packaging >= 19.0}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pyerfa >= 2.0}
BuildRequires: %{python_module setuptools_scm >= 6.2}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: hdf5-devel
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
Requires: python-PyYAML >= 3.13
Requires: python-dbm
Requires: python-numpy >= 1.18
Requires: python-numpy >= 1.20
Requires: python-packaging >= 19.0
Requires: python-pyerfa >= 2.0
Requires(post): update-alternatives
@ -98,12 +103,13 @@ Recommends: python-matplotlib >= 3.1
Recommends: python-mpmath
Recommends: python-pandas
Recommends: python-pyarrow >= 5
Recommends: python-scipy >= 1.3
Recommends: python-scipy >= 1.5
Recommends: python-setuptools
Recommends: python-sortedcontainers
Recommends: python-typing_extensions >= 3.10.0.1
Conflicts: perl-Data-ShowTable
Conflicts: python-matplotlib = 3.4.0
Conflicts: python-matplotlib = 3.5.2
%if %{with system_cfitsio}
BuildRequires: pkgconfig(cfitsio)
%endif
@ -142,8 +148,8 @@ BuildRequires: %{python_module pytest-astropy-header >= 0.2.1}
BuildRequires: %{python_module pytest-doctestplus >= 0.12}
BuildRequires: %{python_module pytest-mpl}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module sgp4}
BuildRequires: %{python_module skyfield}
BuildRequires: %{python_module sgp4 >= 2.3}
BuildRequires: %{python_module skyfield >= 1.20}
# /SECTION
%endif
%python_subpackages
@ -159,8 +165,6 @@ managing them.
%autosetup -p1 -n astropy-%{version}
# avoid rpmlint zero-length error for empty module
echo '# empty module' > astropy/samp/setup_package.py
# Reverse gh#astropy/astropy#13205, patch MPL instead
sed -i '/matplotlib/ s/,!=3.5.2//' setup.cfg
# Make sure bundled libs are not used
%if %{with system_cfitsio}
@ -188,11 +192,11 @@ sed -i 's/--color=yes//' setup.cfg
%build
%{?unbundle_libs}
%python_build
%pyproject_wheel
%install
%{?unbundle_libs}
%python_install
%pyproject_install
for b in %{binaries}; do
%python_clone -a %{buildroot}%{_bindir}/$b
done
@ -209,15 +213,15 @@ donttest+=" or (test_wcs and test_spectra)"
donttest+=" or (test_standard_profile and test_main)"
# segfaults on obs, but are okay when run on live system -- gh#astropy/astropy/13286
donttest+=" or test_celprm or test_prjprm"
# gh#astropy/astropy#13275
donttest+=" or (test_precision and (test_day_frac_exact or test_resolution_never_decreases_utc))"
# gh#astropy/astropy#13805 -- requires fix in matplotlib
donttest+=" or test_units"
%ifarch aarch64
# doctest failure because of precision errors
donttest+=" or bayesian_info_criterion_lsq"
%endif
%ifarch %arm32
# gh#astropy/astropy#12017
donttest+=" or test_stats"
donttest+=" or test_stats"
%endif
%ifarch %ix86 %arm
donttest+=" or (test_models_quantities and test_models_fitting and LevMarLSQFitter)"
@ -248,7 +252,7 @@ sys.exit(returncode)
%license LICENSE.rst licenses/*
%{expand:%(for b in %{binaries}; do echo "%%python_alternative %%{_bindir}/$b"; done)}
%{python_sitearch}/astropy/
%{python_sitearch}/astropy-%{version}*-info
%{python_sitearch}/astropy-%{version}.dist-info
%endif
%changelog