1
0
Files
python-skyfield/python-skyfield.spec

101 lines
4.1 KiB
RPMSpec
Raw Permalink Normal View History

#
# spec file for package python-skyfield
#
# Copyright (c) 2024 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/
#
%define assaycommit 74617d70e77afa09f58b3169cf496679ac5d5621
%define assayver 288.74617d7
Name: python-skyfield
Version: 1.48
Release: 0
Summary: Elegant astronomy for Python
License: MIT
URL: https://github.com/skyfielders/python-skyfield/
Source0: https://files.pythonhosted.org/packages/source/s/skyfield/skyfield-%{version}.tar.gz
# Test data that is needed by the unit tests and would be downloaded on networking hosts
Source1: https://naif.jpl.nasa.gov/pub/naif/generic_kernels/fk/satellites/moon_080317.tf
Source2: https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/moon_pa_de421_1900-2050.bpc
Source3: https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/a_old_versions/pck00008.tpc
- Update to v1.43.1 * An attempt at overly clever scripting resulted in a Skyfield 1.43 release without a setup.py in its .tar.gz; within an hour, a Python 2.7 user had reported that Skyfield could no longer install. This release is identical to 1.43 but (hopefully) installs correctly for everyone! - Changelog v1.43 * Fixed planetary_magnitude() so it works for Saturn even when the time is an array rather than a single time; also, improved its calculation slightly with respect to Uranus. #739 * Improved load_comets_dataframe() so that parsing CometEls.txt with the most recent version of Pandas doesn’t stumble over the commas in the final field of (for example) Halley’s Comet and give the error ParserError: Error tokenizing data. C error: Expected 12 fields…saw 13. #707 - Changelog v1.42 * Added two new position methods phase_angle() and fraction_illuminated() that, given an illuminator (usually the Sun) as their argument, compute whether the observer is looking at the bright side or the dark side of the target body. They replace a pair of old functions in the almanac module. * The almanac routine moon_nodes() would sometimes skip nodes that were closer together than 14.0 days. It has been tightened down and should now detect all lunar nodes. #662 * Time objects now feature a to_astropy() method. * The position method to_skycoord() now sets the frame attribute of the sky coordinate it returns, and for now only supports barycentric and geocentric positions. #577 - Changelog v1.41 * Times now support arithmetic: you can add or subtract from a OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-skyfield?expand=0&rev=43
2022-08-11 09:31:00 +00:00
Source4: https://ssd.jpl.nasa.gov/ftp/eph/planets/bsp/de405.bsp
Source5: https://ssd.jpl.nasa.gov/ftp/eph/planets/bsp/de421.bsp
Accepting request 822762 from home:bnavigator:branches:devel:languages:python:numeric - Update to version 1.25 * Added skyfield.data.stellarium.parse_constellations() and skyfield.data.stellarium.parse_star_names() to load Stellarium star names and constellation lines. Constellation lines are featured in a new example script neowise-chart that produces a finder chart for comet C/2020 F3 NEOWISE. * The Hipparcos star catalog should now load faster, having switched behind the scenes to a higher performance Pandas import routine. * Fixed the ability of skyfield.timelib.Timescale.utc() to accept a Python datetime.date object as its argument. #409 * Slightly lowered the precision of two tests when they detect that Python is compiled for a 32-bit processor, so the test suite can succeed when contributors package Skyfield for 32-bit Linux. #411 - use upstreams custom test runner 'assay' * The runner does not have any releases yet. No package available, so use assay-master-252.79f5d78.tar.gz directly * drop skyfield-pr405-replace-assay-by-pytest.patch * gh#brandon-rhodes/assay#6, gh#skyfielders/python-skyfield#405 - the unit test expect a truncated hipparcos catalog * generate-hipparcos.sh * hip_main.dat.gz - drop skyfield-pr404-comparefloat.patch addressed upstream gh#skyfielders/python-skyfield#404 gh#skyfielders/python-skyfield#411 OBS-URL: https://build.opensuse.org/request/show/822762 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-skyfield?expand=0&rev=14
2020-07-25 12:13:42 +00:00
# use generate-hipparcos.sh to download and truncate the test data
Source6: hip_main.dat.gz
# This is not static. Download manually https://datacenter.iers.org/data/9/finals2000A.all
Source7: finals2000A.all
# Original with invalid https certificate or http url: http://astro.ukho.gov.uk/nao/lvm/Table-S15.2020.txt
Source8: https://github.com/skyfielders/python-skyfield/raw/%{version}/Table-S15.2020.txt
Source9: https://github.com/skyfielders/python-skyfield/raw/%{version}/ci/tyc_main_head.dat
Source97: generate-hipparcos.sh
Accepting request 822762 from home:bnavigator:branches:devel:languages:python:numeric - Update to version 1.25 * Added skyfield.data.stellarium.parse_constellations() and skyfield.data.stellarium.parse_star_names() to load Stellarium star names and constellation lines. Constellation lines are featured in a new example script neowise-chart that produces a finder chart for comet C/2020 F3 NEOWISE. * The Hipparcos star catalog should now load faster, having switched behind the scenes to a higher performance Pandas import routine. * Fixed the ability of skyfield.timelib.Timescale.utc() to accept a Python datetime.date object as its argument. #409 * Slightly lowered the precision of two tests when they detect that Python is compiled for a 32-bit processor, so the test suite can succeed when contributors package Skyfield for 32-bit Linux. #411 - use upstreams custom test runner 'assay' * The runner does not have any releases yet. No package available, so use assay-master-252.79f5d78.tar.gz directly * drop skyfield-pr405-replace-assay-by-pytest.patch * gh#brandon-rhodes/assay#6, gh#skyfielders/python-skyfield#405 - the unit test expect a truncated hipparcos catalog * generate-hipparcos.sh * hip_main.dat.gz - drop skyfield-pr404-comparefloat.patch addressed upstream gh#skyfielders/python-skyfield#404 gh#skyfielders/python-skyfield#411 OBS-URL: https://build.opensuse.org/request/show/822762 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-skyfield?expand=0&rev=14
2020-07-25 12:13:42 +00:00
# upstreams custom test runner assay: gh#skyfielders/python-skyfield#405
Source98: https://github.com/brandon-rhodes/assay/archive/%{assaycommit}.tar.gz#/assay-master-%{assayver}.tar.gz
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
# SECTION test
BuildRequires: %{python_module certifi >= 2017.4.17}
BuildRequires: %{python_module astropy}
BuildRequires: %{python_module jplephem >= 2.13}
BuildRequires: %{python_module matplotlib}
BuildRequires: %{python_module numpy}
BuildRequires: %{python_module pandas}
BuildRequires: %{python_module sgp4 >= 2.2}
# /SECTION
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-certifi >= 2017.4.17
Requires: python-jplephem >= 2.13
Requires: python-numpy
Requires: python-sgp4 >= 2.2
Recommends: python-astropy
Recommends: python-matplotlib
Recommends: python-pandas
BuildArch: noarch
%python_subpackages
%description
A Python astronomy package that makes it easy to generate high precision
research-grade positions for planets and Earth satellites.
%prep
Accepting request 822762 from home:bnavigator:branches:devel:languages:python:numeric - Update to version 1.25 * Added skyfield.data.stellarium.parse_constellations() and skyfield.data.stellarium.parse_star_names() to load Stellarium star names and constellation lines. Constellation lines are featured in a new example script neowise-chart that produces a finder chart for comet C/2020 F3 NEOWISE. * The Hipparcos star catalog should now load faster, having switched behind the scenes to a higher performance Pandas import routine. * Fixed the ability of skyfield.timelib.Timescale.utc() to accept a Python datetime.date object as its argument. #409 * Slightly lowered the precision of two tests when they detect that Python is compiled for a 32-bit processor, so the test suite can succeed when contributors package Skyfield for 32-bit Linux. #411 - use upstreams custom test runner 'assay' * The runner does not have any releases yet. No package available, so use assay-master-252.79f5d78.tar.gz directly * drop skyfield-pr405-replace-assay-by-pytest.patch * gh#brandon-rhodes/assay#6, gh#skyfielders/python-skyfield#405 - the unit test expect a truncated hipparcos catalog * generate-hipparcos.sh * hip_main.dat.gz - drop skyfield-pr404-comparefloat.patch addressed upstream gh#skyfielders/python-skyfield#404 gh#skyfielders/python-skyfield#411 OBS-URL: https://build.opensuse.org/request/show/822762 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-skyfield?expand=0&rev=14
2020-07-25 12:13:42 +00:00
%setup -q -n skyfield-%{version} -b 98
# copy all test data files into the rootdir from where the tests are run
cp %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} %{SOURCE8} %{SOURCE9} ./
Accepting request 886486 from home:bnavigator:branches:devel:languages:python:numeric - Update to 1.39 * The Angle.dstr() and Angle.hstr() methods now accept a format= argument that lets callers override Skyfield’s default angle formatting and supply their own; see Formatting angles. #513 * The prototype planetary_magnitude() function now works not only when given a single position, but when given a vector of several positions. - Release 1.38 * Replaced the old historic ∆T table from the United States Naval Observatory with up-to-date splines from the 2020 release of the extensive research by Morrison, Stephenson, Hohenkerk, and Zawilski and also adjusted the slope of Skyfield’s near-future ∆T estimates to make the slope of ∆T much less abrupt over the coming century. * Added a full reference frame object for the TEME reference frame used by SGP4 Earth satellite elements. - Release 1.37 * Added a frame_latlon_and_rates() method that can compute the rates at which angles like altitude and azimuth, or right ascension and declination, are changing. * Accepted a contributor’s helpful fix for a rounding error that had slightly shifted a few constellation boundaries. #548 * The Time tuple utc and method utc_strftime() are now backed by the same math, so they always advance to the next calendar day at the same moment. This makes it safe to mix values returned by one of them with values returned by the other. #542 * Vector subtraction now returns the position subclass specific to the resulting vector’s center. #549 - Release 1.36 OBS-URL: https://build.opensuse.org/request/show/886486 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-skyfield?expand=0&rev=35
2021-04-18 18:02:54 +00:00
# allow some float error for all platforms -- gh#skyfielders/python-skyfield#582
sed -i 's/if IS_32_BIT/if True/' skyfield/tests/test_planetarylib.py
sed -i 's/assert abs(distance.au - 1) < 1e-16/assert abs(distance.au - 1) < 1e-15/' skyfield/tests/test_positions.py
%build
- Update to v1.43.1 * An attempt at overly clever scripting resulted in a Skyfield 1.43 release without a setup.py in its .tar.gz; within an hour, a Python 2.7 user had reported that Skyfield could no longer install. This release is identical to 1.43 but (hopefully) installs correctly for everyone! - Changelog v1.43 * Fixed planetary_magnitude() so it works for Saturn even when the time is an array rather than a single time; also, improved its calculation slightly with respect to Uranus. #739 * Improved load_comets_dataframe() so that parsing CometEls.txt with the most recent version of Pandas doesn’t stumble over the commas in the final field of (for example) Halley’s Comet and give the error ParserError: Error tokenizing data. C error: Expected 12 fields…saw 13. #707 - Changelog v1.42 * Added two new position methods phase_angle() and fraction_illuminated() that, given an illuminator (usually the Sun) as their argument, compute whether the observer is looking at the bright side or the dark side of the target body. They replace a pair of old functions in the almanac module. * The almanac routine moon_nodes() would sometimes skip nodes that were closer together than 14.0 days. It has been tightened down and should now detect all lunar nodes. #662 * Time objects now feature a to_astropy() method. * The position method to_skycoord() now sets the frame attribute of the sky coordinate it returns, and for now only supports barycentric and geocentric positions. #577 - Changelog v1.41 * Times now support arithmetic: you can add or subtract from a OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-skyfield?expand=0&rev=43
2022-08-11 09:31:00 +00:00
export SKYFIELD_USE_SETUPTOOLS=1
%pyproject_wheel
%install
- Update to v1.43.1 * An attempt at overly clever scripting resulted in a Skyfield 1.43 release without a setup.py in its .tar.gz; within an hour, a Python 2.7 user had reported that Skyfield could no longer install. This release is identical to 1.43 but (hopefully) installs correctly for everyone! - Changelog v1.43 * Fixed planetary_magnitude() so it works for Saturn even when the time is an array rather than a single time; also, improved its calculation slightly with respect to Uranus. #739 * Improved load_comets_dataframe() so that parsing CometEls.txt with the most recent version of Pandas doesn’t stumble over the commas in the final field of (for example) Halley’s Comet and give the error ParserError: Error tokenizing data. C error: Expected 12 fields…saw 13. #707 - Changelog v1.42 * Added two new position methods phase_angle() and fraction_illuminated() that, given an illuminator (usually the Sun) as their argument, compute whether the observer is looking at the bright side or the dark side of the target body. They replace a pair of old functions in the almanac module. * The almanac routine moon_nodes() would sometimes skip nodes that were closer together than 14.0 days. It has been tightened down and should now detect all lunar nodes. #662 * Time objects now feature a to_astropy() method. * The position method to_skycoord() now sets the frame attribute of the sky coordinate it returns, and for now only supports barycentric and geocentric positions. #577 - Changelog v1.41 * Times now support arithmetic: you can add or subtract from a OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-skyfield?expand=0&rev=43
2022-08-11 09:31:00 +00:00
export SKYFIELD_USE_SETUPTOOLS=1
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
Accepting request 822762 from home:bnavigator:branches:devel:languages:python:numeric - Update to version 1.25 * Added skyfield.data.stellarium.parse_constellations() and skyfield.data.stellarium.parse_star_names() to load Stellarium star names and constellation lines. Constellation lines are featured in a new example script neowise-chart that produces a finder chart for comet C/2020 F3 NEOWISE. * The Hipparcos star catalog should now load faster, having switched behind the scenes to a higher performance Pandas import routine. * Fixed the ability of skyfield.timelib.Timescale.utc() to accept a Python datetime.date object as its argument. #409 * Slightly lowered the precision of two tests when they detect that Python is compiled for a 32-bit processor, so the test suite can succeed when contributors package Skyfield for 32-bit Linux. #411 - use upstreams custom test runner 'assay' * The runner does not have any releases yet. No package available, so use assay-master-252.79f5d78.tar.gz directly * drop skyfield-pr405-replace-assay-by-pytest.patch * gh#brandon-rhodes/assay#6, gh#skyfielders/python-skyfield#405 - the unit test expect a truncated hipparcos catalog * generate-hipparcos.sh * hip_main.dat.gz - drop skyfield-pr404-comparefloat.patch addressed upstream gh#skyfielders/python-skyfield#404 gh#skyfielders/python-skyfield#411 OBS-URL: https://build.opensuse.org/request/show/822762 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-skyfield?expand=0&rev=14
2020-07-25 12:13:42 +00:00
export PYTHONPATH="../assay-%{assaycommit}"
%python_exec -m assay --batch skyfield.tests
%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitelib}/skyfield
%{python_sitelib}/skyfield-%{version}.dist-info
%changelog