1
0
python-astropy/python-astropy.spec
Todd R 1063d850d3 Accepting request 717717 from home:TheBlackCat:branches:devel:languages:python:numeric
- Update to 3.2.1
  + Bug fixes
    * astropy.io.fits
      > Avoid reporting a warning with ``BinTableHDU.from_columns`` with keywords that
        are not provided by the user.  
      > Fix ``Header.fromfile`` to work on FITS files. 
      > Fix reading of empty ``BinTableHDU`` when stored in a gzip-compressed file.
    * astropy.table
      > Fix a problem where mask was dropped when creating a ``MaskedColumn``
        from a list of ``MaskedArray`` objects. 
    * astropy.wcs
      > Added ``None`` to be displayed as a ``world_axis_physical_types`` in
        the ``WCS`` repr, as ``None`` values are now supported in ``APE14``. 
- Update to 3.2
  + New Features
    * astropy.constants
      > Add CODATA 2018 constants but not make them default because the
        redefinition of SI units that will follow has not been implemented
        yet. 
    * astropy.coordinates
      > New ``BarycentricMeanEcliptic``, ``HeliocentricTrueEcliptic`` and
        ``GeocentricTrueEcliptic`` frames.
        The ecliptic frames are no longer considered experimental. 
      > The default time scale for epochs like 'J2000' or 'B1975' is now "tt",
        which is the correct one for 'J2000' and avoids leap-second warnings
        for epochs in the far future or past. 
    * astropy.extern
      > Bundled ``six`` now emits ``AstropyDeprecationWarning``. It will be removed
        in 4.0. 
    * astropy.io.ascii
      > IPAC tables now output data types of ``float`` instead of ``double``, or
        ``int`` instead of ``long``, based on the column ``dtype.itemsize``. 
      > Update handling of MaskedColumn columns when using the 'data_mask' serialization
        method.  This can make writing ECSV significantly faster if the data do not
        actually have any masked values. 
      > Fixed a bug that caused newlines to be incorrect when writing out ASCII tables
        on Windows (they were ``\r\r\n`` instead of ``\r\n``). 
    * astropy.io.misc
      > Implement serialization of ``TimeDelta`` in ASDF. 
      > Implement serialization of ``EarthLocation`` in ASDF. 
      > Implement serialization of ``SkyCoord`` in ASDF. 
      > Support serialization of Astropy tables with mixin columns in ASDF. 
      > No warnings when reading HDF5 files with only one table and no ``path=``
        argument 
      > The HDF5 writer will now create a default table instead of raising an
        exception when ``path=`` is not specified and when writing to empty/new HDF5
        files. 
    * astropy.io.fits
      > Optimize parsing of cards within the ``Header`` class. 
      > Optimize the parsing of headers to get the structural keywords that are
        needed to find extensions. Thanks to this, getting a random HDU from a file
        with many extensions is much faster than before, in particular when the
        extension headers contain many keywords. 
      >  Change behavior of FITS undefined value in ``Header`` such that ``None``
              is used in Python to represent FITS undefined when using dict interface.
              ``Undefined`` can also be assigned and is translated to ``None``.
              Previously setting a header card value to ``None`` resulted in an
              empty string field rather than a FITS undefined value. 
      > Allow ``Header.fromstring`` and ``Card.fromstring`` to accept ``bytes``.
    * astropy.io.registry
      > Implement ``Table`` reader and writer for ``ASDF``. 
      > Implement ``Table`` reader and writer methods to wrap ``pandas`` I/O methods
        for CSV, Fixed width format, HTML, and JSON. 
      > Add ``help()`` and ``list_formats()`` methods to unified I/O ``read`` and
        ``write`` methods. For example ``Table.read.help()`` gives help on available
        ``Table`` read formats and ``Table.read.help('fits')`` gives detailed
        help on the arguments for reading FITS table file. 
    * astropy.table
      > Initializing a table with ``Table(rows=...)``, if the first item is an ``OrderedDict``,
        now uses the column order of the first row. 
      > Added new pprint_all() and pformat_all() methods to Table. These two new
        methods print the entire table by default. 
      > Removed restriction of initializing a Table from a dict with copy=False. 
      > Improved speed of table row access by a factor of about 2-3.  Improved speed
        of Table len() by a factor of around 3-10 (depending on the number of columns).
      > Improved the Table - pandas ``DataFrame`` interface (``to_pandas()`` and
        ``from_pandas()``).  Mixin columns like ``Time`` and ``Quantity`` can now be
        converted to pandas by flattening the columns as necessary to plain
        columns.  ``Time`` and ``TimeDelta`` columns get converted to
        corresponding pandas date or time delta types.  The ``DataFrame``
        index is now handled in the conversion methods. 
      > Added ``rename_columns`` method to rename multiple columns in one call.
      > Improved Table performance by reducing unnecessary calls to copy and deepcopy,
        especially as related to the table and column ``meta`` attributes.  Changed the
        behavior when slicing a table (either in rows or with a list of column names)
        so now the sliced output gets a light (key-only) copy of ``meta`` instead of a
        deepcopy.  Changed the ``Table.meta`` class-level descriptor so that assigning
        directly to ``meta``, e.g. ``tbl.meta = new_meta`` no longer does a deepcopy
        and instead just directly assigns the ``new_meta`` object reference.  Changed
        Table initialization so that input ``meta`` is copied only if ``copy=True``.
      > Improved Table slicing performance with internal implementation changes
        related to column attribute access and certain input validation. 
      > Added ``reverse`` argument to the ``sort`` and ``argsort`` methods to allow
        sorting in reverse order. 
      > Improved ``Table.sort()`` performance by removing ``self[keys]`` from code
        which is creating deep copies of ``meta`` attribute and adding a new keyword
        ``names`` in ``get_index()`` to get index by using a list or tuple containing
        names of columns. 
      > Expose ``represent_mixins_as_columns`` as a public function in the
        ``astropy.table`` subpackage.  This previously-private function in the
        ``table.serialize`` module is used to represent mixin columns in a Table as
        one or more plain Column objects. 
    * astropy.timeseries
      > Added a new astropy.timeseries sub-package to represent and manipulate
        sampled and binned time series. 
      > The ``BoxLeastSquares`` and ``LombScargle`` classes have been moved to
        ``astropy.timeseries.periodograms`` from ``astropy.stats``. 
      > Added the ability to provide absolute ``Time`` objects to the
        ``BoxLeastSquares`` and ``LombScargle`` periodogram classes. 
      > Added model inspection methods (``model_parameters()``, ``design_matrix()``,
        and ``offset()``) to ``astropy.timeseries.LombScargle`` class .
    * astropy.units
      > ``Quantity`` overrides of ``ndarray`` methods such as ``sum``, ``min``,
        ``max``, which are implemented via reductions, have been removed since they
        are dealt with in ``Quantity.__array_ufunc__``. This should not affect
        subclasses, but they may consider doing similarly.   Note that this
        does not include methods that use more complicated python code such as
        ``mean``, ``std`` and ``var``. 
    * astropy.visualization
      > Added ``CompositeStretch``, which inherits from ``CompositeTransform`` and
        also ``BaseStretch`` so that it can be used with ``ImageNormalize``. 
      > Added a ``log_a`` argument to the ``simple_norm`` method. Similar to the
        exposing of the ``asinh_a`` argument for ``AsinhStretch``, the new
        ``log_a`` argument is now exposed for ``LogStretch``. 
    * astropy.wcs
      > WCSLIB was updated to v 6.2.
        This adds support for time-related WCS keywords (WCS Paper VII).
        FITS headers containing ``Time`` axis are parsed and the axis is included in
        the WCS object. 
      > The ``OBSGEO`` attribute as expanded to 6 members - ``XYZLBH``. 
      > Added a new class ``SlicedLowLevelWCS`` in ``astropy.wcs.wcsapi`` that can be
        used to slice any WCS that conforms to the ``BaseLowLevelWCS`` API. 
      > Updated implementation of ``WCS.__getitem__`` and ``WCS.slice`` to now return
        a ``SlicedLowLevelWCS`` rather than raising an error when reducing the
        dimensionality of the WCS. 
  + API Changes
    * astropy.coordinates
      > ``QuantityAttribute`` no longer has a default value for ``default``.  The
        previous value of None was misleading as it always was an error. 
      > The default J2000 has been changed to use be January 1, 2000 12:00 TT instead
        of UTC.  This is more in line with convention. 
    * astropy.io.ascii
      > IPAC tables now output data types of ``float`` instead of ``double``, or
        ``int`` instead of ``long``, based on the column ``dtype.itemsize``. 
    * astropy.io.misc
      > Unit equivalencies can now be serialized to ASDF. 
    * astropy.modeling
      > Composition of model classes is deprecated and will be removed in 4.0.
        Composition of model instances remain unaffected.
    * astropy.stats
      > The ``BoxLeastSquares`` and ``LombScargle`` classes have been moved to the
        ``astropy.timeseries.periodograms`` module and will now emit a deprecation
        warning when imported from ``astropy.stats``. 
    * astropy.table
      > Converting an empty table to an array using ``as_array`` method now returns
        an empty array instead of ``None``. 
      > Changed the behavior when slicing a table (either in rows or with a list of column
        names) so now the sliced output gets a light (key-only) copy of ``meta`` instead of
        a deepcopy.  Changed the ``Table.meta`` class-level descriptor so that assigning
        directly to ``meta``, e.g. ``tbl.meta = new_meta`` no longer does a deepcopy
        and instead just directly assigns the ``new_meta`` object reference. Changed
        Table initialization so that input ``meta`` is copied only if ``copy=True``.
      > Added a keyword ``names`` in ``Table.as_array()``.  If provided this specifies
        a list of column names to include for the returned structured array. 
    * astropy.tests
      > Removed ``pytest_plugins`` as they are completely broken for ``pytest>=4``.
      > Removed the ``astropy.tests.plugins.config`` plugin and removed the
        ``--astropy-config-dir`` and ``--astropy-cache-dir`` options from
        testing. Please use caching functionality that is natively in ``pytest``.
    * astropy.time
      > The default time scale for epochs like 'J2000' or 'B1975' is now "tt",
        which is the correct one for 'J2000' and avoids leap-second warnings
        for epochs in the far future or past. 
    * astropy.units
      > Unit equivalencies can now be introspected. 
    * astropy.wcs
      > The ``world_to_pixel``, ``world_to_array_index*``, ``pixel_to_world*`` and
        ``array_index_to_world*`` methods now all consistently return scalars, arrays,
        or objects not wrapped in a one-element tuple/list when only one scalar,
        array, or object (as was previously already the case for ``WCS.pixel_to_world``
        and ``WCS.array_index_to_world``). 
    * astropy.utils
      > It is now possible to control the number of cores used by ``ProgressBar.map``
        by passing a positive integer as the ``multiprocess`` keyword argument. Use
        ``True`` to use all cores. 
  + Bug Fixes
    * astropy.coordinates
      > ``BarycentricTrueEcliptic``, ``HeliocentricTrueEcliptic`` and
        ``GeocentricTrueEcliptic`` now use the correct transformation
        (including nutation), whereas the new ``*MeanEcliptic`` classes
        use the nutation-free transformation. 
      > Representations with ``float32`` coordinates can now be transformed,
        although the output will always be ``float64``. 
      > Fixed bug that prevented using differentials with HCRS<->ICRS
        transformations. 
    * astropy.io.ascii
      > Fixed a bug where an exception was raised when writing a table which includes
        mixin columns (e.g. a Quantity column) and the output format was specified
        using the ``formats`` keyword. 
    * astropy.io.misc
      > Fixed bug in ASDF tag that inadvertently introduced dependency on ``pytest``.
    * astropy.modeling
      > Fixed slowness for certain compound models consisting of large numbers
        of multi-input models
      > Fixed bugs in fitting of compound models with units. 
    * astropy.nddata
      > Fixed bug in reading multi-extension FITS files written by earlier versions
        of ``CCDData``. 
      > Fixed two errors in the way ``CCDData`` handles FITS files with WCS in the
        header. Some of the WCS keywords that should have been removed from the
        header were not, potentially leading to FITS files with inconsistent
        WCS. 
    * astropy.table
      > Fixed a bug when initializing from an empty list: ``Table([])`` no longer
        results in a crash. 
      > Fixed a bug when initializing from an existing ``Table``.  In this case the
        input ``meta`` argument was being ignored.  Now the input ``meta``, if
        supplied, will be used as the ``meta`` for the new ``Table``. 
      > Fix the conversion of bytes values to Python ``str`` with ``Table.tolist``.
    * astropy.time
      > Fixed a number of issues to ensure a consistent output type resulting from
        multiplication or division involving a ``TimeDelta`` instance. The output is
        now always a ``TimeDelta`` if the result is a time unit (like u.s or u.d),
        otherwise it will be a ``Quantity``. 
      > Multiplication between two ``TimeDelta`` instances is now possible, resulting
        in a ``Quantity`` with units of time squared (division already correctly
        resulted in a dimensionless ``Quantity``). 
      > Like for comparisons, addition, and subtraction of ``Time`` instances with
        with non-time instances, multiplication and division of ``TimeDelta``
        instances with incompatible other instances no longer immediately raise an
        ``UnitsError`` or ``TypeError`` (depending on the other instance), but
        rather go through the regular Python mechanism of ``TimeDelta`` returning
        ``NotImplemented`` (which will lead to a regular ``TypeError`` unless the
        other instance can handle ``TimeDelta``). 
      > Corrected small rounding errors that could cause the ``jd2`` values in
        ``Time`` to fall outside the range of -0.5 to 0.5. 
    * astropy.units
      > Added a ``Quantity.to_string`` method to add flexibility to the string formatting
        of quantities. It produces unadorned or LaTeX strings, and accepts two different
        sets of delimiters in the latter case: ``inline`` and ``display``. 
      > Ensure classes that mimic quantities by having a ``unit`` attribute and/or
        ``to`` and ``to_value`` methods can be properly used to initialize ``Quantity``
        or set ``Quantity`` instance items. 
      > Add support for ``<<`` to create logarithmic units. 
      > Add support for the ``clip`` ufunc, which in numpy 1.17 is used to implement
        ``np.clip``.  As part of that, remove the ``Quantity.clip`` method under
        numpy 1.17. 
      > Fix parsing of numerical powers in FITS-compatible units. 
    * astropy.wcs
      > Added a ``PyUnitListProxy_richcmp`` method in ``UnitListProxy`` class to enable
        ``WCS.wcs.cunit`` equality testing. It helps to check whether the two instances of
        ``WCS.wcs.cunit`` are equal or not by comparing the data members of
        ``UnitListProxy`` class 
      > Fixed ``SlicedLowLevelWCS`` when ``array_shape`` is ``None``. 
      > Do not attempt to delete repeated distortion keywords multiple times when
        loading distortions with ``_read_distortion_kw`` and
        ``_read_det2im_kw``. 
  + Other Changes and Additions
      > Update bundled expat to 2.2.6. 
      > Added instructions for uploading releases to Zenodo. 
      > The bug fixes to the behaviour of ``TimeDelta`` for multiplcation and
        division, which ensure that the output is now always a ``TimeDelta`` if the
        result is a time unit (like u.s or u.d) and otherwise a ``Quantity``, imply
        that sometimes the output type will be different than it was before. 
      > For types unrecognized by ``TimeDelta``, multiplication and division now
        will consistently return a ``TypeError`` if the other instance cannot handle
        ``TimeDelta`` (rather than ``UnitsError`` or ``TypeError`` depending on
        presumed abilities of the other instance). 
      > Multiplication between two ``TimeDelta`` instances will no longer result in
        an ``OperandTypeError``, but rather result in a ``Quantity`` with units of
        time squared (division already correctly resulted in a dimensionless
        ``Quantity``). 
      > Made running the tests insensitive to local user configuration when running
        the tests in parallel mode or directly with pytest. 
      > Added a narrative style guide to the documentation for contributor reference.
      > Ensure we call numpy equality functions in a way that reduces the number
        of ``DeprecationWarning``. 
  + Installation
      > We now require setuptools 30.3.0 or later to install the core astropy
        package. 
      > We now define groups of dependencies that can be installed with pip, e.g.
        ``pip install astropy[all]`` (to install all optional dependencies).

OBS-URL: https://build.opensuse.org/request/show/717717
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-astropy?expand=0&rev=9
2019-07-23 02:10:03 +00:00

164 lines
6.1 KiB
RPMSpec

#
# spec file for package python-astropy
#
# Copyright (c) 2019 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 https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-astropy
Version: 3.2.1
Release: 0
Summary: Community-developed python astronomy tools
License: BSD-3-Clause
Group: Development/Languages/Python
URL: http://astropy.org
Source: https://files.pythonhosted.org/packages/source/a/astropy/astropy-%{version}.tar.gz
# 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
BuildRequires: %{python_module Cython >= 0.21}
BuildRequires: %{python_module astropy-helpers}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module jupyter_ipython}
BuildRequires: %{python_module numpy-devel >= 1.7.0}
BuildRequires: %{python_module ply}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: hdf5-devel
BuildRequires: libxml2-tools
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: pkgconfig(cfitsio)
BuildRequires: pkgconfig(erfa) >= 1.3.0
BuildRequires: pkgconfig(expat)
BuildRequires: pkgconfig(wcslib)
Requires: hdf5
Requires: liberfa1 >= 1.3.0
Requires: python-numpy >= 1.7.0
Requires(post): update-alternatives
Requires(preun): update-alternatives
Recommends: libxml2-tools
Recommends: python-Jinja2
Recommends: python-PyYAML
Recommends: python-beautifulsoup4
Recommends: python-bleach
Recommends: python-h5py
Recommends: python-jplephem
Recommends: python-matplotlib
Recommends: python-pandas
Recommends: python-scikit-image
Recommends: python-scipy
# SECTION Optional requirements
BuildRequires: %{python_module Jinja2}
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module beautifulsoup4}
BuildRequires: %{python_module bleach}
BuildRequires: %{python_module h5py}
BuildRequires: %{python_module jplephem}
BuildRequires: %{python_module matplotlib}
BuildRequires: %{python_module pandas}
BuildRequires: %{python_module scipy}
# /SECTION
# SECTION test requirements
BuildRequires: %{python_module mpmath}
BuildRequires: %{python_module pytest >= 3.1.0}
BuildRequires: %{python_module pytest-arraydiff >= 0.1}
BuildRequires: %{python_module pytest-astropy}
BuildRequires: %{python_module pytest-doctestplus}
BuildRequires: %{python_module pytest-openfiles}
BuildRequires: %{python_module pytest-remotedata}
# /SECTION
%python_subpackages
%description
Astropy is a package intended to contain core functionality and some
common tools needed for performing astronomy and astrophysics research with
Python. It also provides an index for other astronomy packages and tools for
managing them.
%prep
%setup -q -n astropy-%{version}
# Make sure bundled libs are not used
rm -rf cextern/expat
rm -rf cextern/erfa
rm -rf cextern/cfitsio
rm -rf cextern/wcslib
echo "[build]" >> setup.cfg
echo "use_system_libraries=1" >> setup.cfg
%build
%python_build --use-system-libraries --offline
%install
%python_install --use-system-libraries --offline
%python_clone -a %{buildroot}%{_bindir}/fitscheck
%python_clone -a %{buildroot}%{_bindir}/fitsdiff
%python_clone -a %{buildroot}%{_bindir}/fitsheader
%python_clone -a %{buildroot}%{_bindir}/fitsinfo
%python_clone -a %{buildroot}%{_bindir}/fits2bitmap
%python_clone -a %{buildroot}%{_bindir}/samp_hub
%python_clone -a %{buildroot}%{_bindir}/showtable
%python_clone -a %{buildroot}%{_bindir}/volint
%python_clone -a %{buildroot}%{_bindir}/wcslint
# Deduplicating files can generate a RPMLINT warning for pyc mtime
%{python_expand %fdupes %{buildroot}%{$python_sitearch}
$python -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/astropy/io/misc/tests/
$python -O -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/astropy/io/misc/tests/
$python -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/astropy/io/votable/tests/
$python -O -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/astropy/io/votable/tests/
$python -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/astropy/stats/bls/tests/
$python -O -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/astropy/stats/bls/tests/
$python -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/astropy/wcs/tests/
$python -O -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/astropy/wcs/tests/
%fdupes %{buildroot}%{$python_sitearch}
}
%check
export PYTHONDONTWRITEBYTECODE=1
pushd static
%{python_expand export PYTHONPATH="%{buildroot}%{$python_sitearch}"
$python -B -c "import astropy;astropy.test()"
rm -rf %{buildroot}%{$python_sitearch}/astropy/wcs/tests/extension/build
}
popd
%post
%{python_install_alternative fitscheck fitsdiff fitsheader fitsinfo fits2bitmap samp_hub showtable volint wcslint}
%preun
%python_uninstall_alternative fitscheck
%files %{python_files}
%doc CHANGES.rst README.rst
%doc licenses/
%python_alternative %{_bindir}/fitsdiff
%python_alternative %{_bindir}/fitsheader
%python_alternative %{_bindir}/fitscheck
%python_alternative %{_bindir}/fitsinfo
%python_alternative %{_bindir}/fits2bitmap
%python_alternative %{_bindir}/samp_hub
%python_alternative %{_bindir}/showtable
%python_alternative %{_bindir}/volint
%python_alternative %{_bindir}/wcslint
%{python_sitearch}/astropy/
%{python_sitearch}/astropy-%{version}-py*.egg-info
%changelog