From 915d48fa930346d99bf2b2359060c86e50e2ef4b Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Fri, 31 Mar 2023 11:51:12 +0100 Subject: [PATCH 01/34] tox indexserver is deprecated; use PIP_INDEX_URL and PIP_EXTRA_INDEX_URL in dev environments (#597) --- tox.ini | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index cbd3bd44..944e81be 100644 --- a/tox.ini +++ b/tox.ini @@ -11,8 +11,6 @@ requires = setuptools >= 30.3.0 pip >= 19.3.1 isolated_build = true -indexserver = - NIGHTLY = https://pypi.anaconda.org/scipy-wheels-nightly/simple [testenv] @@ -95,8 +93,8 @@ deps = astropy51: astropy==5.1.* astropy52: astropy==5.2.* - dev: :NIGHTLY:numpy - dev: :NIGHTLY:scipy + dev: numpy + dev: scipy dev: git+https://github.com/astropy/astropy.git#egg=astropy latest: astropy==5.2.* @@ -121,6 +119,13 @@ commands = !cov: pytest --pyargs skypy {toxinidir}/docs {posargs} cov: pytest --pyargs skypy {toxinidir}/docs --cov skypy --cov-config={toxinidir}/setup.cfg {posargs} +# For dev environment, use scipy-nightly-wheels as the default index server (for numpy and scipy) +# and PyPI as the extra index server (for all other dependencies, except astropy which is installed +# directly from GitHub). +setenv = + dev: PIP_INDEX_URL = https://pypi.anaconda.org/scipy-wheels-nightly/simple + dev: PIP_EXTRA_INDEX_URL = https://pypi.org/simple + [testenv:build_docs] changedir = docs description = invoke sphinx-build to build the HTML docs From 0be3a57b7bd914d4a6f04c15c3225ef672bf6866 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Sun, 9 Jul 2023 14:15:12 +0100 Subject: [PATCH 02/34] BLD: Set numpy latest supported version to 1.25 (#601) --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 944e81be..7c0a416e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = py{37,38,39,310,311}-test{,-all}{,-dev,-latest,-oldest}{,-cov} - py{37,38,39,310,311}-test-numpy{116,117,118,119,120,121,122,123,124} + py{37,38,39,310,311}-test-numpy{116,117,118,119,120,121,122,123,124,125} py{37,38,39,310,311}-test-scipy{12,13,14,15,16,17,18,19,110} py{37,38,39,310,311}-test-astropy{40,41,42,43,50,51,52} build_docs @@ -45,6 +45,7 @@ description = numpy122: with numpy 1.22.* numpy123: with numpy 1.23.* numpy124: with numpy 1.24.* + numpy125: with numpy 1.25.* scipy12: with scipy 1.2.* scipy13: with scipy 1.3.* scipy14: with scipy 1.4.* @@ -74,6 +75,7 @@ deps = numpy122: numpy==1.22.* numpy123: numpy==1.23.* numpy124: numpy==1.24.* + numpy125: numpy==1.25.* scipy12: scipy==1.2.* scipy13: scipy==1.3.* @@ -98,7 +100,7 @@ deps = dev: git+https://github.com/astropy/astropy.git#egg=astropy latest: astropy==5.2.* - latest: numpy==1.24.* + latest: numpy==1.25.* latest: scipy==1.10.* oldest: astropy==4.0.* From e0ded6df00afcd9f489a08abccddb064d8b304e3 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Mon, 10 Jul 2023 16:20:50 +0100 Subject: [PATCH 03/34] BLD: Set scipy latest supported version to 1.11 (#602) Co-authored-by: Ian Harrison --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 7c0a416e..e23daabd 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist = py{37,38,39,310,311}-test{,-all}{,-dev,-latest,-oldest}{,-cov} py{37,38,39,310,311}-test-numpy{116,117,118,119,120,121,122,123,124,125} - py{37,38,39,310,311}-test-scipy{12,13,14,15,16,17,18,19,110} + py{37,38,39,310,311}-test-scipy{12,13,14,15,16,17,18,19,110,111} py{37,38,39,310,311}-test-astropy{40,41,42,43,50,51,52} build_docs linkcheck @@ -55,6 +55,7 @@ description = scipy18: with scipy 1.8.* scipy19: with scipy 1.9.* scipy110: with scipy 1.10.* + scipy111: with scipy 1.11.* astropy40: with astropy 4.0.* astropy41: with astropy 4.1.* astropy42: with astropy 4.2.* @@ -86,6 +87,7 @@ deps = scipy18: scipy==1.8.* scipy19: scipy==1.9.* scipy110: scipy==1.10.* + scipy111: scipy==1.11.* astropy40: astropy==4.0.* astropy41: astropy==4.1.* @@ -101,7 +103,7 @@ deps = latest: astropy==5.2.* latest: numpy==1.25.* - latest: scipy==1.10.* + latest: scipy==1.11.* oldest: astropy==4.0.* oldest: numpy==1.16.* From 7120c11087f01245b18777fda473bdd141016030 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Mon, 10 Jul 2023 16:25:08 +0100 Subject: [PATCH 04/34] BLD: Set astropy latest supported version to 5.3 (#603) Co-authored-by: Ian Harrison --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index e23daabd..1fd826fe 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ envlist = py{37,38,39,310,311}-test{,-all}{,-dev,-latest,-oldest}{,-cov} py{37,38,39,310,311}-test-numpy{116,117,118,119,120,121,122,123,124,125} py{37,38,39,310,311}-test-scipy{12,13,14,15,16,17,18,19,110,111} - py{37,38,39,310,311}-test-astropy{40,41,42,43,50,51,52} + py{37,38,39,310,311}-test-astropy{40,41,42,43,50,51,52,53} build_docs linkcheck codestyle @@ -63,6 +63,7 @@ description = astropy50: with astropy 5.0.* astropy51: with astropy 5.1.* astropy52: with astropy 5.2.* + astropy53: with astropy 5.3.* # The following provides some specific pinnings for key packages deps = @@ -96,12 +97,13 @@ deps = astropy50: astropy==5.0.* astropy51: astropy==5.1.* astropy52: astropy==5.2.* + astropy53: astropy==5.3.* dev: numpy dev: scipy dev: git+https://github.com/astropy/astropy.git#egg=astropy - latest: astropy==5.2.* + latest: astropy==5.3.* latest: numpy==1.25.* latest: scipy==1.11.* From 752256c1babb9f450aa675201b81353b23f1d156 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Mon, 10 Jul 2023 16:29:29 +0100 Subject: [PATCH 05/34] TST: Use conftest from latest astropy package template (#604) Co-authored-by: Ian Harrison --- skypy/conftest.py | 47 ++++++++++++++++++----------------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/skypy/conftest.py b/skypy/conftest.py index 672b2733..482ddb89 100644 --- a/skypy/conftest.py +++ b/skypy/conftest.py @@ -1,27 +1,29 @@ -# This file is used to configure the behavior of pytest when using the Astropy -# test infrastructure. It needs to live inside the package in order for it to -# get picked up when running the tests inside an interpreter using -# packagename.test +"""Configure Test Suite. -import os +This file is used to configure the behavior of pytest when using the Astropy +test infrastructure. It needs to live inside the package in order for it to +get picked up when running the tests inside an interpreter using +`{{ cookiecutter.module_name }}.test()`. + +""" -from astropy.version import version as astropy_version +import os -# For Astropy 3.0 and later, we can use the standalone pytest plugin -if astropy_version < '3.0': - from astropy.tests.pytest_plugins import * # noqa - del pytest_report_header +try: + from pytest_astropy_header.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS ASTROPY_HEADER = True -else: - try: - from pytest_astropy_header.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS - ASTROPY_HEADER = True - except ImportError: - ASTROPY_HEADER = False +except ImportError: + ASTROPY_HEADER = False def pytest_configure(config): + """Configure Pytest with Astropy. + Parameters + ---------- + config : pytest configuration + + """ if ASTROPY_HEADER: config.option.astropy_header = True @@ -34,16 +36,3 @@ def pytest_configure(config): from . import __version__ packagename = os.path.basename(os.path.dirname(__file__)) TESTED_VERSIONS[packagename] = __version__ - -# Uncomment the last two lines in this block to treat all DeprecationWarnings as -# exceptions. For Astropy v2.0 or later, there are 2 additional keywords, -# as follow (although default should work for most cases). -# To ignore some packages that produce deprecation warnings on import -# (in addition to 'compiler', 'scipy', 'pygments', 'ipykernel', and -# 'setuptools'), add: -# modules_to_ignore_on_import=['module_1', 'module_2'] -# To ignore some specific deprecation warning messages for Python version -# MAJOR.MINOR or later, add: -# warnings_to_ignore_by_pyver={(MAJOR, MINOR): ['Message to ignore']} -# from astropy.tests.helper import enable_deprecations_as_exceptions # noqa -# enable_deprecations_as_exceptions() From 9d7c01f5a98a19bddb3af3362a651e18d3450446 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Fri, 22 Sep 2023 16:19:09 +0100 Subject: [PATCH 06/34] BLD: Set numpy latest supported version to 1.26 (#607) --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 1fd826fe..2fa10b1f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = py{37,38,39,310,311}-test{,-all}{,-dev,-latest,-oldest}{,-cov} - py{37,38,39,310,311}-test-numpy{116,117,118,119,120,121,122,123,124,125} + py{37,38,39,310,311}-test-numpy{116,117,118,119,120,121,122,123,124,125,126} py{37,38,39,310,311}-test-scipy{12,13,14,15,16,17,18,19,110,111} py{37,38,39,310,311}-test-astropy{40,41,42,43,50,51,52,53} build_docs @@ -46,6 +46,7 @@ description = numpy123: with numpy 1.23.* numpy124: with numpy 1.24.* numpy125: with numpy 1.25.* + numpy125: with numpy 1.26.* scipy12: with scipy 1.2.* scipy13: with scipy 1.3.* scipy14: with scipy 1.4.* @@ -78,6 +79,7 @@ deps = numpy123: numpy==1.23.* numpy124: numpy==1.24.* numpy125: numpy==1.25.* + numpy125: numpy==1.26.* scipy12: scipy==1.2.* scipy13: scipy==1.3.* @@ -104,7 +106,7 @@ deps = dev: git+https://github.com/astropy/astropy.git#egg=astropy latest: astropy==5.3.* - latest: numpy==1.25.* + latest: numpy==1.26.* latest: scipy==1.11.* oldest: astropy==4.0.* From dd62ba50fbd26548aca69b22933459d71c6f0b7f Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Sat, 18 Nov 2023 12:05:35 +0000 Subject: [PATCH 07/34] MAINT: Update .readthedocs.yml to latest version in astropy package-template (#609) * Update .readthedocs.yml to latest version in astropy package-template * Fix underline length * Add graphviz to apt_packages --- .readthedocs.yml | 7 +++++-- skypy/utils/photometry.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 46f01501..432dbdea 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,13 +1,16 @@ version: 2 build: - image: latest + os: ubuntu-20.04 + tools: + python: '3.7' + apt_packages: + - graphviz sphinx: fail_on_warning: true python: - version: 3.7 install: - method: pip path: . diff --git a/skypy/utils/photometry.py b/skypy/utils/photometry.py index 2b72cfd7..fad1b47c 100644 --- a/skypy/utils/photometry.py +++ b/skypy/utils/photometry.py @@ -436,7 +436,7 @@ def logistic_completeness_function(magnitude, magnitude_95, magnitude_50): is array_like of shape (nb, ) it returns array_like of shape (nb, ). References - ----------- + ---------- .. [1] López-Sanjuan, C. et al., `2017A&A…599A..62L`_ .. _2017A&A…599A..62L: https://ui.adsabs.harvard.edu/abs/2017A%26A...599A..62L From 8fbe5498c422bd5413842b7d5aad2f883f281b4f Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Sat, 18 Nov 2023 12:08:17 +0000 Subject: [PATCH 08/34] Update _astropy_init to latest version in astropy package-template (#608) --- skypy/_astropy_init.py | 49 +++++------------------------------------- 1 file changed, 5 insertions(+), 44 deletions(-) diff --git a/skypy/_astropy_init.py b/skypy/_astropy_init.py index 2dffe8fd..bd453245 100644 --- a/skypy/_astropy_init.py +++ b/skypy/_astropy_init.py @@ -1,52 +1,13 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst +import os -__all__ = ['__version__'] - -# this indicates whether or not we are in the package's setup.py -try: - _ASTROPY_SETUP_ -except NameError: - import builtins - builtins._ASTROPY_SETUP_ = False +__all__ = ['__version__', 'test'] try: from .version import version as __version__ except ImportError: __version__ = '' - -if not _ASTROPY_SETUP_: # noqa - import os - from warnings import warn - from astropy.config.configuration import ( - update_default_config, - ConfigurationDefaultMissingError, - ConfigurationDefaultMissingWarning) - - # Create the test function for self test - from astropy.tests.runner import TestRunner - test = TestRunner.make_test_runner_in(os.path.dirname(__file__)) - test.__test__ = False - __all__ += ['test'] - - # add these here so we only need to cleanup the namespace at the end - config_dir = None - - if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False): - config_dir = os.path.dirname(__file__) - config_template = os.path.join(config_dir, __package__ + ".cfg") - if os.path.isfile(config_template): - try: - update_default_config( - __package__, config_dir, version=__version__) - except TypeError as orig_error: - try: - update_default_config(__package__, config_dir) - except ConfigurationDefaultMissingError as e: - wmsg = (e.args[0] + - " Cannot install default profile. If you are " - "importing from source, this is expected.") - warn(ConfigurationDefaultMissingWarning(wmsg)) - del e - except Exception: - raise orig_error +# Create the test function for self test +from astropy.tests.runner import TestRunner +test = TestRunner.make_test_runner_in(os.path.dirname(__file__)) From 92a47611d88d2828cdb16f69b017fa9e6182ac81 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Mon, 11 Dec 2023 08:35:59 +0000 Subject: [PATCH 09/34] BLD: Set astropy latest supported version to 6.0 (#611) --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 2fa10b1f..770b0f1a 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ envlist = py{37,38,39,310,311}-test{,-all}{,-dev,-latest,-oldest}{,-cov} py{37,38,39,310,311}-test-numpy{116,117,118,119,120,121,122,123,124,125,126} py{37,38,39,310,311}-test-scipy{12,13,14,15,16,17,18,19,110,111} - py{37,38,39,310,311}-test-astropy{40,41,42,43,50,51,52,53} + py{37,38,39,310,311}-test-astropy{40,41,42,43,50,51,52,53,60} build_docs linkcheck codestyle @@ -65,6 +65,7 @@ description = astropy51: with astropy 5.1.* astropy52: with astropy 5.2.* astropy53: with astropy 5.3.* + astropy60: with astropy 6.0.* # The following provides some specific pinnings for key packages deps = @@ -100,12 +101,13 @@ deps = astropy51: astropy==5.1.* astropy52: astropy==5.2.* astropy53: astropy==5.3.* + astropy60: astropy==6.0.* dev: numpy dev: scipy dev: git+https://github.com/astropy/astropy.git#egg=astropy - latest: astropy==5.3.* + latest: astropy==6.0.* latest: numpy==1.26.* latest: scipy==1.11.* From a11c4193632889c1d7f52c61c07c790f167db9e8 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Mon, 11 Dec 2023 08:39:49 +0000 Subject: [PATCH 10/34] BLD: Upgrade GitHub actions that use deprecated node12 (#612) * BLD: Upgrade checkout action to v4 * BLD: Upgrade setup-python action to v4 * BLD: Upgrade codecov-action to v3 --- .github/workflows/codestyle.yaml | 4 ++-- .github/workflows/compatibility.yaml | 4 ++-- .github/workflows/tests.yaml | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codestyle.yaml b/.github/workflows/codestyle.yaml index 2e14de43..36345fd3 100644 --- a/.github/workflows/codestyle.yaml +++ b/.github/workflows/codestyle.yaml @@ -13,9 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Python 3.x - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.x - name: Install Dependencies diff --git a/.github/workflows/compatibility.yaml b/.github/workflows/compatibility.yaml index a65e452e..2cd8c586 100644 --- a/.github/workflows/compatibility.yaml +++ b/.github/workflows/compatibility.yaml @@ -14,7 +14,7 @@ jobs: release: [main, latest] steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - if: matrix.release != 'main' @@ -22,7 +22,7 @@ jobs: run: | git checkout tags/$(curl -s https://api.github.com/repos/skypyproject/skypy/releases/${{ matrix.release }} | python -c "import sys, json; print(json.load(sys.stdin)['tag_name'])") - name: Install Python ${{ matrix.python }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - name: Install Dependencies diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5bc9ca89..9e58c74a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -40,11 +40,11 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install Python ${{ matrix.python }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - name: Install Dependencies @@ -55,4 +55,4 @@ jobs: tox -e ${{ matrix.toxenv }} ${{ matrix.toxargs }} -- ${{ matrix.toxposargs }} - if: contains(matrix.toxenv, '-cov') name: Report Coverage - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 From cea1836541c055ef982d6db466d1cc7c224fce78 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Tue, 6 Feb 2024 21:14:53 +0000 Subject: [PATCH 11/34] BLD: Set scipy latest supported version to 1.12 (#613) --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 770b0f1a..9565656c 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist = py{37,38,39,310,311}-test{,-all}{,-dev,-latest,-oldest}{,-cov} py{37,38,39,310,311}-test-numpy{116,117,118,119,120,121,122,123,124,125,126} - py{37,38,39,310,311}-test-scipy{12,13,14,15,16,17,18,19,110,111} + py{37,38,39,310,311}-test-scipy{12,13,14,15,16,17,18,19,110,111,112} py{37,38,39,310,311}-test-astropy{40,41,42,43,50,51,52,53,60} build_docs linkcheck @@ -57,6 +57,7 @@ description = scipy19: with scipy 1.9.* scipy110: with scipy 1.10.* scipy111: with scipy 1.11.* + scipy112: with scipy 1.12.* astropy40: with astropy 4.0.* astropy41: with astropy 4.1.* astropy42: with astropy 4.2.* @@ -92,6 +93,7 @@ deps = scipy19: scipy==1.9.* scipy110: scipy==1.10.* scipy111: scipy==1.11.* + scipy112: scipy==1.12.* astropy40: astropy==4.0.* astropy41: astropy==4.1.* @@ -109,7 +111,7 @@ deps = latest: astropy==6.0.* latest: numpy==1.26.* - latest: scipy==1.11.* + latest: scipy==1.12.* oldest: astropy==4.0.* oldest: numpy==1.16.* From eb0efbf2cec9eb8fb473d6966fe90e75103226ca Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Tue, 28 May 2024 13:08:24 +0100 Subject: [PATCH 12/34] BLD: Set scipy latest supported version to 1.13 (#615) --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 9565656c..3e0bd406 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist = py{37,38,39,310,311}-test{,-all}{,-dev,-latest,-oldest}{,-cov} py{37,38,39,310,311}-test-numpy{116,117,118,119,120,121,122,123,124,125,126} - py{37,38,39,310,311}-test-scipy{12,13,14,15,16,17,18,19,110,111,112} + py{37,38,39,310,311}-test-scipy{12,13,14,15,16,17,18,19,110,111,112,113} py{37,38,39,310,311}-test-astropy{40,41,42,43,50,51,52,53,60} build_docs linkcheck @@ -58,6 +58,7 @@ description = scipy110: with scipy 1.10.* scipy111: with scipy 1.11.* scipy112: with scipy 1.12.* + scipy113: with scipy 1.13.* astropy40: with astropy 4.0.* astropy41: with astropy 4.1.* astropy42: with astropy 4.2.* @@ -94,6 +95,7 @@ deps = scipy110: scipy==1.10.* scipy111: scipy==1.11.* scipy112: scipy==1.12.* + scipy113: scipy==1.13.* astropy40: astropy==4.0.* astropy41: astropy==4.1.* @@ -111,7 +113,7 @@ deps = latest: astropy==6.0.* latest: numpy==1.26.* - latest: scipy==1.12.* + latest: scipy==1.13.* oldest: astropy==4.0.* oldest: numpy==1.16.* From ed7ed467e7cdc2a38ba4e62b19caa68a56f5d1ae Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Tue, 25 Jun 2024 20:14:17 +0100 Subject: [PATCH 13/34] BLD: Set astropy latest supported version to 6.1 (#616) --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 3e0bd406..c22df7ed 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ envlist = py{37,38,39,310,311}-test{,-all}{,-dev,-latest,-oldest}{,-cov} py{37,38,39,310,311}-test-numpy{116,117,118,119,120,121,122,123,124,125,126} py{37,38,39,310,311}-test-scipy{12,13,14,15,16,17,18,19,110,111,112,113} - py{37,38,39,310,311}-test-astropy{40,41,42,43,50,51,52,53,60} + py{37,38,39,310,311}-test-astropy{40,41,42,43,50,51,52,53,60,61} build_docs linkcheck codestyle @@ -68,6 +68,7 @@ description = astropy52: with astropy 5.2.* astropy53: with astropy 5.3.* astropy60: with astropy 6.0.* + astropy61: with astropy 6.1.* # The following provides some specific pinnings for key packages deps = @@ -106,12 +107,13 @@ deps = astropy52: astropy==5.2.* astropy53: astropy==5.3.* astropy60: astropy==6.0.* + astropy61: astropy==6.1.* dev: numpy dev: scipy dev: git+https://github.com/astropy/astropy.git#egg=astropy - latest: astropy==6.0.* + latest: astropy==6.1.* latest: numpy==1.26.* latest: scipy==1.13.* From f0a20fd68610018c665cb43c17a8e4604448d207 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Tue, 25 Jun 2024 20:19:31 +0100 Subject: [PATCH 14/34] BLD: Set scipy oldest supported version to 1.6 (#618) --- tox.ini | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tox.ini b/tox.ini index c22df7ed..985219cb 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist = py{37,38,39,310,311}-test{,-all}{,-dev,-latest,-oldest}{,-cov} py{37,38,39,310,311}-test-numpy{116,117,118,119,120,121,122,123,124,125,126} - py{37,38,39,310,311}-test-scipy{12,13,14,15,16,17,18,19,110,111,112,113} + py{37,38,39,310,311}-test-scipy{16,17,18,19,110,111,112,113} py{37,38,39,310,311}-test-astropy{40,41,42,43,50,51,52,53,60,61} build_docs linkcheck @@ -47,10 +47,6 @@ description = numpy124: with numpy 1.24.* numpy125: with numpy 1.25.* numpy125: with numpy 1.26.* - scipy12: with scipy 1.2.* - scipy13: with scipy 1.3.* - scipy14: with scipy 1.4.* - scipy15: with scipy 1.5.* scipy16: with scipy 1.6.* scipy17: with scipy 1.7.* scipy18: with scipy 1.8.* @@ -85,10 +81,6 @@ deps = numpy125: numpy==1.25.* numpy125: numpy==1.26.* - scipy12: scipy==1.2.* - scipy13: scipy==1.3.* - scipy14: scipy==1.4.* - scipy15: scipy==1.5.* scipy16: scipy==1.6.* scipy17: scipy==1.7.* scipy18: scipy==1.8.* @@ -119,7 +111,7 @@ deps = oldest: astropy==4.0.* oldest: numpy==1.16.* - oldest: scipy==1.2.* + oldest: scipy==1.6.* # The following indicates which extras_require from setup.cfg will be installed extras = From f4b4bc922cda75f06d9aef4d4b69a17fb8a44265 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Tue, 25 Jun 2024 20:23:29 +0100 Subject: [PATCH 15/34] Use scipy.integrate.cumulative_trapezoid (#617) --- skypy/galaxies/tests/test_stellar_mass.py | 2 +- skypy/galaxies/tests/test_velocity_dispersion.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/skypy/galaxies/tests/test_stellar_mass.py b/skypy/galaxies/tests/test_stellar_mass.py index b8809235..cc03ef10 100644 --- a/skypy/galaxies/tests/test_stellar_mass.py +++ b/skypy/galaxies/tests/test_stellar_mass.py @@ -68,7 +68,7 @@ def calc_cdf(m): mass_min = 10 ** 7 mass_max = 10 ** 13 pdf = calc_pdf(m, alpha, mass_star, mass_min, mass_max) - cdf = scipy.integrate.cumtrapz(pdf, m, initial=0) + cdf = scipy.integrate.cumulative_trapezoid(pdf, m, initial=0) cdf = cdf / cdf[-1] return cdf diff --git a/skypy/galaxies/tests/test_velocity_dispersion.py b/skypy/galaxies/tests/test_velocity_dispersion.py index b5be57ec..a01429de 100644 --- a/skypy/galaxies/tests/test_velocity_dispersion.py +++ b/skypy/galaxies/tests/test_velocity_dispersion.py @@ -1,7 +1,7 @@ import numpy as np from scipy.stats import kstest from scipy.special import gamma -from scipy.integrate import cumtrapz +from scipy.integrate import cumulative_trapezoid def test_schechter_vdf(): @@ -30,7 +30,7 @@ def calc_pdf(vd): def calc_cdf(m): pdf = calc_pdf(m) - cdf = cumtrapz(pdf, m, initial=0) + cdf = cumulative_trapezoid(pdf, m, initial=0) cdf /= cdf[-1] return cdf From dbcfff49ff84827e0f80e1b623f37a8dd950676f Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Sat, 29 Jun 2024 14:23:26 +0100 Subject: [PATCH 16/34] BLD: Set python latest supported version to 3.12 (#619) --- .github/workflows/compatibility.yaml | 4 ++-- .github/workflows/tests.yaml | 12 ++++++------ tox.ini | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/compatibility.yaml b/.github/workflows/compatibility.yaml index 2cd8c586..66818c9e 100644 --- a/.github/workflows/compatibility.yaml +++ b/.github/workflows/compatibility.yaml @@ -9,8 +9,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ['3.11'] - toxenv: [py311-test, py311-test-dev] + python: ['3.12'] + toxenv: [py312-test, py312-test-dev] release: [main, latest] steps: - name: Checkout Repository diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9e58c74a..ea2b43a9 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -19,8 +19,8 @@ jobs: - name: latest supported versions os: ubuntu-latest - python: '3.11' - toxenv: py311-test-all-latest-cov + python: '3.12' + toxenv: py312-test-all-latest-cov toxposargs: --cov-report=xml:${GITHUB_WORKSPACE}/coverage.xml - name: oldest supported versions @@ -30,13 +30,13 @@ jobs: - name: macOS latest supported os: macos-latest - python: '3.11' - toxenv: py311-test-latest + python: '3.12' + toxenv: py312-test-latest - name: Windows latest supported os: windows-latest - python: '3.11' - toxenv: py311-test-latest + python: '3.12' + toxenv: py312-test-latest steps: - name: Checkout Repository diff --git a/tox.ini b/tox.ini index 985219cb..f3ced749 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,9 @@ [tox] envlist = - py{37,38,39,310,311}-test{,-all}{,-dev,-latest,-oldest}{,-cov} - py{37,38,39,310,311}-test-numpy{116,117,118,119,120,121,122,123,124,125,126} - py{37,38,39,310,311}-test-scipy{16,17,18,19,110,111,112,113} - py{37,38,39,310,311}-test-astropy{40,41,42,43,50,51,52,53,60,61} + py{37,38,39,310,311,312}-test{,-all}{,-dev,-latest,-oldest}{,-cov} + py{37,38,39,310,311,312}-test-numpy{116,117,118,119,120,121,122,123,124,125,126} + py{37,38,39,310,311,312}-test-scipy{16,17,18,19,110,111,112,113} + py{37,38,39,310,311,312}-test-astropy{40,41,42,43,50,51,52,53,60,61} build_docs linkcheck codestyle From aa2b367256fe4ce3ab05e5dd9e4c1578e3daa41b Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Sat, 29 Jun 2024 14:40:44 +0100 Subject: [PATCH 17/34] BLD: Set python oldest supported version to 3.8 (#620) --- .github/workflows/tests.yaml | 4 ++-- .readthedocs.yml | 2 +- CONTRIBUTING.rst | 2 +- docs/install.rst | 2 +- setup.cfg | 2 +- tox.ini | 8 ++++---- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ea2b43a9..ef1069ec 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -25,8 +25,8 @@ jobs: - name: oldest supported versions os: ubuntu-latest - python: 3.7 - toxenv: py37-test-oldest + python: '3.8' + toxenv: py38-test-oldest - name: macOS latest supported os: macos-latest diff --git a/.readthedocs.yml b/.readthedocs.yml index 432dbdea..d6ba8088 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-20.04 tools: - python: '3.7' + python: '3.8' apt_packages: - graphviz diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index d749b965..43a4100b 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -168,7 +168,7 @@ Before your pull request can be merged into the codebase, it will be reviewed by General Guidelines ^^^^^^^^^^^^^^^^^^ -- SkyPy is compatible with Python>=3.7 (see `setup.cfg `_). SkyPy *does not* support backwards compatibility with Python 2.x; `six`, `__future__` and `2to3` should not be used. +- SkyPy is compatible with Python>=3.8 (see `setup.cfg `_). SkyPy *does not* support backwards compatibility with Python 2.x; `six`, `__future__` and `2to3` should not be used. - All contributions should follow the `PEP8 Style Guide for Python Code `_. We recommend using `flake8 `__ to check your code for PEP8 compliance. - Importing SkyPy should only depend on having `NumPy `_, `SciPy `_ and `Astropy `__ installed. - Code is grouped into submodules based on broad science areas e.g. `galaxies `_. There is also a `utils `_ submodule for general utility functions. diff --git a/docs/install.rst b/docs/install.rst index 986f8d9f..7203271f 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -40,7 +40,7 @@ can be installed directly from GitHub using a recent version of pip: Dependencies ------------ -SkyPy is compatble with Python versions 3.7 or later on Ubuntu, macOS and +SkyPy is compatble with Python versions 3.8 or later on Ubuntu, macOS and Windows operating systems. It has the following core dependencies: - `astropy `__ diff --git a/setup.cfg b/setup.cfg index baeb275f..0235fd84 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,7 +14,7 @@ github_project = skypyproject/skypy [options] zip_safe = False packages = find: -python_requires = >=3.7 +python_requires = >=3.8 setup_requires = setuptools_scm install_requires = astropy>=4 diff --git a/tox.ini b/tox.ini index f3ced749..b753ecda 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,9 @@ [tox] envlist = - py{37,38,39,310,311,312}-test{,-all}{,-dev,-latest,-oldest}{,-cov} - py{37,38,39,310,311,312}-test-numpy{116,117,118,119,120,121,122,123,124,125,126} - py{37,38,39,310,311,312}-test-scipy{16,17,18,19,110,111,112,113} - py{37,38,39,310,311,312}-test-astropy{40,41,42,43,50,51,52,53,60,61} + py{38,39,310,311,312}-test{,-all}{,-dev,-latest,-oldest}{,-cov} + py{38,39,310,311,312}-test-numpy{116,117,118,119,120,121,122,123,124,125,126} + py{38,39,310,311,312}-test-scipy{16,17,18,19,110,111,112,113} + py{38,39,310,311,312}-test-astropy{40,41,42,43,50,51,52,53,60,61} build_docs linkcheck codestyle From 2b5f39c9c48141657a88465160f2541a9c678a29 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Wed, 7 Aug 2024 10:10:22 +0100 Subject: [PATCH 18/34] BLD: Set scipy latest supported version to 1.14 (#621) --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index b753ecda..94af3c0e 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist = py{38,39,310,311,312}-test{,-all}{,-dev,-latest,-oldest}{,-cov} py{38,39,310,311,312}-test-numpy{116,117,118,119,120,121,122,123,124,125,126} - py{38,39,310,311,312}-test-scipy{16,17,18,19,110,111,112,113} + py{38,39,310,311,312}-test-scipy{16,17,18,19,110,111,112,113,114} py{38,39,310,311,312}-test-astropy{40,41,42,43,50,51,52,53,60,61} build_docs linkcheck @@ -55,6 +55,7 @@ description = scipy111: with scipy 1.11.* scipy112: with scipy 1.12.* scipy113: with scipy 1.13.* + scipy114: with scipy 1.14.* astropy40: with astropy 4.0.* astropy41: with astropy 4.1.* astropy42: with astropy 4.2.* @@ -89,6 +90,7 @@ deps = scipy111: scipy==1.11.* scipy112: scipy==1.12.* scipy113: scipy==1.13.* + scipy114: scipy==1.14.* astropy40: astropy==4.0.* astropy41: astropy==4.1.* @@ -107,7 +109,7 @@ deps = latest: astropy==6.1.* latest: numpy==1.26.* - latest: scipy==1.13.* + latest: scipy==1.14.* oldest: astropy==4.0.* oldest: numpy==1.16.* From 6f3881b8fb1b945b3fa52d9215ff76da10fa58a8 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Wed, 7 Aug 2024 10:53:48 +0100 Subject: [PATCH 19/34] BLD: Set numpy latest supported version to 2.0 (#622) --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 94af3c0e..7eeefe97 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = py{38,39,310,311,312}-test{,-all}{,-dev,-latest,-oldest}{,-cov} - py{38,39,310,311,312}-test-numpy{116,117,118,119,120,121,122,123,124,125,126} + py{38,39,310,311,312}-test-numpy{116,117,118,119,120,121,122,123,124,125,126,20} py{38,39,310,311,312}-test-scipy{16,17,18,19,110,111,112,113,114} py{38,39,310,311,312}-test-astropy{40,41,42,43,50,51,52,53,60,61} build_docs @@ -47,6 +47,7 @@ description = numpy124: with numpy 1.24.* numpy125: with numpy 1.25.* numpy125: with numpy 1.26.* + numpy20: with numpy 2.0.* scipy16: with scipy 1.6.* scipy17: with scipy 1.7.* scipy18: with scipy 1.8.* @@ -81,6 +82,7 @@ deps = numpy124: numpy==1.24.* numpy125: numpy==1.25.* numpy125: numpy==1.26.* + numpy20: numpy==2.0.* scipy16: scipy==1.6.* scipy17: scipy==1.7.* @@ -108,7 +110,7 @@ deps = dev: git+https://github.com/astropy/astropy.git#egg=astropy latest: astropy==6.1.* - latest: numpy==1.26.* + latest: numpy==2.0.* latest: scipy==1.14.* oldest: astropy==4.0.* From 693edbcd72db8ca9d7f6b70f69de7acce445d3fd Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Fri, 9 Aug 2024 08:46:39 +0100 Subject: [PATCH 20/34] MAINT: numpy.trapz is deprecated; use scipy.integrate.trapezoid (#623) --- examples/galaxies/plot_schechter.py | 3 ++- skypy/galaxies/redshift.py | 2 +- skypy/galaxies/tests/test_redshift.py | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/galaxies/plot_schechter.py b/examples/galaxies/plot_schechter.py index 11b060b4..51501279 100644 --- a/examples/galaxies/plot_schechter.py +++ b/examples/galaxies/plot_schechter.py @@ -47,6 +47,7 @@ from astropy.units import Quantity from matplotlib import pyplot as plt import numpy as np +import scipy.integrate from skypy.galaxies import schechter_lf z_range = np.linspace(0.2, 1.0, 100) @@ -81,7 +82,7 @@ # SkyPy simulated galaxies z_mask = np.logical_and(redshift >= z_min, redshift < z_max) dV_dz = (cosmology.differential_comoving_volume(z) * sky_area).to_value('Mpc3') - dV = np.trapz(dV_dz, z) + dV = scipy.integrate.trapezoid(dV_dz, z) dM = (np.max(bins)-np.min(bins)) / (np.size(bins)-1) phi_skypy = np.histogram(magnitude[z_mask], bins=bins)[0] / dV / dM diff --git a/skypy/galaxies/redshift.py b/skypy/galaxies/redshift.py index f048a357..3173c63d 100644 --- a/skypy/galaxies/redshift.py +++ b/skypy/galaxies/redshift.py @@ -249,7 +249,7 @@ def redshifts_from_comoving_density(redshift, density, sky_area, cosmology, nois dN_dz *= density # integrate density to get expected number of galaxies - N = np.trapz(dN_dz, redshift) + N = scipy.integrate.trapezoid(dN_dz, redshift) # Poisson sample galaxy number if requested if noise: diff --git a/skypy/galaxies/tests/test_redshift.py b/skypy/galaxies/tests/test_redshift.py index d41e92ac..c974bab3 100644 --- a/skypy/galaxies/tests/test_redshift.py +++ b/skypy/galaxies/tests/test_redshift.py @@ -1,5 +1,6 @@ import numpy as np import pytest +import scipy.integrate from scipy.stats import kstest @@ -38,7 +39,7 @@ def test_schechter_lf_redshift(): density *= (sky_area * cosmo.differential_comoving_volume(z)).to_value('Mpc3') # integrate total number - n_gal = np.trapz(density, z, axis=-1) + n_gal = scipy.integrate.trapezoid(density, z, axis=-1) # make sure noise-free sample has right size assert np.isclose(len(z_gal), n_gal, atol=1.0) @@ -85,7 +86,7 @@ def test_schechter_smf_redshift(): density *= (sky_area * cosmo.differential_comoving_volume(z)).to_value('Mpc3') # integrate total number - n_gal = np.trapz(density, z, axis=-1) + n_gal = scipy.integrate.trapezoid(density, z, axis=-1) # make sure noise-free sample has right size assert np.isclose(len(z_gal), n_gal, atol=1.0) From 58148721cafbe924667ec55fff04e9e6857e67b2 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Fri, 9 Aug 2024 09:10:08 +0100 Subject: [PATCH 21/34] MAINT: Upgrade to actions/setup-python@v5 (#624) --- .github/workflows/codestyle.yaml | 2 +- .github/workflows/compatibility.yaml | 2 +- .github/workflows/tests.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codestyle.yaml b/.github/workflows/codestyle.yaml index 36345fd3..09746787 100644 --- a/.github/workflows/codestyle.yaml +++ b/.github/workflows/codestyle.yaml @@ -15,7 +15,7 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - name: Install Python 3.x - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.x - name: Install Dependencies diff --git a/.github/workflows/compatibility.yaml b/.github/workflows/compatibility.yaml index 66818c9e..984ac748 100644 --- a/.github/workflows/compatibility.yaml +++ b/.github/workflows/compatibility.yaml @@ -22,7 +22,7 @@ jobs: run: | git checkout tags/$(curl -s https://api.github.com/repos/skypyproject/skypy/releases/${{ matrix.release }} | python -c "import sys, json; print(json.load(sys.stdin)['tag_name'])") - name: Install Python ${{ matrix.python }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - name: Install Dependencies diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ef1069ec..d8402d15 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -44,7 +44,7 @@ jobs: with: fetch-depth: 0 - name: Install Python ${{ matrix.python }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - name: Install Dependencies From 5541fe738d66fc279b47ecef4c30eb3085090c1b Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Sun, 8 Sep 2024 10:18:16 +0100 Subject: [PATCH 22/34] BLD: Set numpy oldest supported version to 1.17 (#626) --- tox.ini | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 7eeefe97..fbd13d98 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = py{38,39,310,311,312}-test{,-all}{,-dev,-latest,-oldest}{,-cov} - py{38,39,310,311,312}-test-numpy{116,117,118,119,120,121,122,123,124,125,126,20} + py{38,39,310,311,312}-test-numpy{117,118,119,120,121,122,123,124,125,126,20} py{38,39,310,311,312}-test-scipy{16,17,18,19,110,111,112,113,114} py{38,39,310,311,312}-test-astropy{40,41,42,43,50,51,52,53,60,61} build_docs @@ -36,7 +36,6 @@ description = latest: with the latest supported version of key dependencies oldest: with the oldest supported version of key dependencies cov: and test coverage - numpy116: with numpy 1.16.* numpy117: with numpy 1.17.* numpy118: with numpy 1.18.* numpy119: with numpy 1.19.* @@ -71,7 +70,6 @@ description = # The following provides some specific pinnings for key packages deps = - numpy116: numpy==1.16.* numpy117: numpy==1.17.* numpy118: numpy==1.18.* numpy119: numpy==1.19.* @@ -114,7 +112,7 @@ deps = latest: scipy==1.14.* oldest: astropy==4.0.* - oldest: numpy==1.16.* + oldest: numpy==1.17.* oldest: scipy==1.6.* # The following indicates which extras_require from setup.cfg will be installed From 05444f3c4a3fbc8b078a1a1b224c1aae1d7cbb5f Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Sun, 8 Sep 2024 10:23:33 +0100 Subject: [PATCH 23/34] BLD: Set numpy latest supported version to 2.1 (#625) --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index fbd13d98..78766b46 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = py{38,39,310,311,312}-test{,-all}{,-dev,-latest,-oldest}{,-cov} - py{38,39,310,311,312}-test-numpy{117,118,119,120,121,122,123,124,125,126,20} + py{38,39,310,311,312}-test-numpy{117,118,119,120,121,122,123,124,125,126,20,21} py{38,39,310,311,312}-test-scipy{16,17,18,19,110,111,112,113,114} py{38,39,310,311,312}-test-astropy{40,41,42,43,50,51,52,53,60,61} build_docs @@ -47,6 +47,7 @@ description = numpy125: with numpy 1.25.* numpy125: with numpy 1.26.* numpy20: with numpy 2.0.* + numpy21: with numpy 2.1.* scipy16: with scipy 1.6.* scipy17: with scipy 1.7.* scipy18: with scipy 1.8.* @@ -81,6 +82,7 @@ deps = numpy125: numpy==1.25.* numpy125: numpy==1.26.* numpy20: numpy==2.0.* + numpy21: numpy==2.1.* scipy16: scipy==1.6.* scipy17: scipy==1.7.* @@ -108,7 +110,7 @@ deps = dev: git+https://github.com/astropy/astropy.git#egg=astropy latest: astropy==6.1.* - latest: numpy==2.0.* + latest: numpy==2.1.* latest: scipy==1.14.* oldest: astropy==4.0.* From ee05b5aba9118663c68fc69ffae523bc0e450e8a Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Sun, 8 Sep 2024 11:50:24 +0100 Subject: [PATCH 24/34] CI: Run tests and codestyle on release branches and tags (#627) --- .github/workflows/codestyle.yaml | 4 ++++ .github/workflows/tests.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/codestyle.yaml b/.github/workflows/codestyle.yaml index 09746787..8dd0fa39 100644 --- a/.github/workflows/codestyle.yaml +++ b/.github/workflows/codestyle.yaml @@ -4,10 +4,14 @@ on: branches: - main - module/* + - 'v*x' + tags: + - 'v*' pull_request: branches: - main - module/* + - 'v*x' jobs: flake8: runs-on: ubuntu-latest diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d8402d15..2800cb6a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -4,10 +4,14 @@ on: branches: - main - module/* + - 'v*x' + tags: + - 'v*' pull_request: branches: - main - module/* + - 'v*x' jobs: test: name: ${{ matrix.name }} From a2c20e9851f5a26fa709b3991aea4394332e671a Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Fri, 22 Nov 2024 16:08:27 +0000 Subject: [PATCH 25/34] BLD: Set astropy latest supported version to 7.0 (#633) --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 78766b46..81897cee 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ envlist = py{38,39,310,311,312}-test{,-all}{,-dev,-latest,-oldest}{,-cov} py{38,39,310,311,312}-test-numpy{117,118,119,120,121,122,123,124,125,126,20,21} py{38,39,310,311,312}-test-scipy{16,17,18,19,110,111,112,113,114} - py{38,39,310,311,312}-test-astropy{40,41,42,43,50,51,52,53,60,61} + py{38,39,310,311,312}-test-astropy{40,41,42,43,50,51,52,53,60,61,70} build_docs linkcheck codestyle @@ -67,6 +67,7 @@ description = astropy53: with astropy 5.3.* astropy60: with astropy 6.0.* astropy61: with astropy 6.1.* + astropy70: with astropy 7.0.* # The following provides some specific pinnings for key packages deps = @@ -104,12 +105,13 @@ deps = astropy53: astropy==5.3.* astropy60: astropy==6.0.* astropy61: astropy==6.1.* + astropy70: astropy==7.0.* dev: numpy dev: scipy dev: git+https://github.com/astropy/astropy.git#egg=astropy - latest: astropy==6.1.* + latest: astropy==7.0.* latest: numpy==2.1.* latest: scipy==1.14.* From 363d4ef9ec8ef2670ec87398cbd6ecfaf8cddc58 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:02:18 +0000 Subject: [PATCH 26/34] BLD: Set python oldest supported version to 3.9 (#636) --- .github/workflows/tests.yaml | 4 ++-- .readthedocs.yml | 2 +- CONTRIBUTING.rst | 2 +- docs/install.rst | 2 +- setup.cfg | 2 +- tox.ini | 8 ++++---- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2800cb6a..9657878d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -29,8 +29,8 @@ jobs: - name: oldest supported versions os: ubuntu-latest - python: '3.8' - toxenv: py38-test-oldest + python: '3.9' + toxenv: py39-test-oldest - name: macOS latest supported os: macos-latest diff --git a/.readthedocs.yml b/.readthedocs.yml index d6ba8088..47d12ba3 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-20.04 tools: - python: '3.8' + python: '3.9' apt_packages: - graphviz diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 43a4100b..f0fa350f 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -168,7 +168,7 @@ Before your pull request can be merged into the codebase, it will be reviewed by General Guidelines ^^^^^^^^^^^^^^^^^^ -- SkyPy is compatible with Python>=3.8 (see `setup.cfg `_). SkyPy *does not* support backwards compatibility with Python 2.x; `six`, `__future__` and `2to3` should not be used. +- SkyPy is compatible with Python>=3.9 (see `setup.cfg `_). SkyPy *does not* support backwards compatibility with Python 2.x; `six`, `__future__` and `2to3` should not be used. - All contributions should follow the `PEP8 Style Guide for Python Code `_. We recommend using `flake8 `__ to check your code for PEP8 compliance. - Importing SkyPy should only depend on having `NumPy `_, `SciPy `_ and `Astropy `__ installed. - Code is grouped into submodules based on broad science areas e.g. `galaxies `_. There is also a `utils `_ submodule for general utility functions. diff --git a/docs/install.rst b/docs/install.rst index 7203271f..4d368c63 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -40,7 +40,7 @@ can be installed directly from GitHub using a recent version of pip: Dependencies ------------ -SkyPy is compatble with Python versions 3.8 or later on Ubuntu, macOS and +SkyPy is compatble with Python versions 3.9 or later on Ubuntu, macOS and Windows operating systems. It has the following core dependencies: - `astropy `__ diff --git a/setup.cfg b/setup.cfg index 0235fd84..f827e7ce 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,7 +14,7 @@ github_project = skypyproject/skypy [options] zip_safe = False packages = find: -python_requires = >=3.8 +python_requires = >=3.9 setup_requires = setuptools_scm install_requires = astropy>=4 diff --git a/tox.ini b/tox.ini index 81897cee..1e1e0663 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,9 @@ [tox] envlist = - py{38,39,310,311,312}-test{,-all}{,-dev,-latest,-oldest}{,-cov} - py{38,39,310,311,312}-test-numpy{117,118,119,120,121,122,123,124,125,126,20,21} - py{38,39,310,311,312}-test-scipy{16,17,18,19,110,111,112,113,114} - py{38,39,310,311,312}-test-astropy{40,41,42,43,50,51,52,53,60,61,70} + py{39,310,311,312}-test{,-all}{,-dev,-latest,-oldest}{,-cov} + py{39,310,311,312}-test-numpy{117,118,119,120,121,122,123,124,125,126,20,21} + py{39,310,311,312}-test-scipy{16,17,18,19,110,111,112,113,114} + py{39,310,311,312}-test-astropy{40,41,42,43,50,51,52,53,60,61,70} build_docs linkcheck codestyle From 22ccb17af1665632abf34fdbc631932f6b7bf864 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:06:44 +0000 Subject: [PATCH 27/34] BLD: Set numpy oldest supported version to 1.19 (#637) --- tox.ini | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index 1e1e0663..4320f6df 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = py{39,310,311,312}-test{,-all}{,-dev,-latest,-oldest}{,-cov} - py{39,310,311,312}-test-numpy{117,118,119,120,121,122,123,124,125,126,20,21} + py{39,310,311,312}-test-numpy{119,120,121,122,123,124,125,126,20,21} py{39,310,311,312}-test-scipy{16,17,18,19,110,111,112,113,114} py{39,310,311,312}-test-astropy{40,41,42,43,50,51,52,53,60,61,70} build_docs @@ -36,8 +36,6 @@ description = latest: with the latest supported version of key dependencies oldest: with the oldest supported version of key dependencies cov: and test coverage - numpy117: with numpy 1.17.* - numpy118: with numpy 1.18.* numpy119: with numpy 1.19.* numpy120: with numpy 1.20.* numpy121: with numpy 1.21.* @@ -72,8 +70,6 @@ description = # The following provides some specific pinnings for key packages deps = - numpy117: numpy==1.17.* - numpy118: numpy==1.18.* numpy119: numpy==1.19.* numpy120: numpy==1.20.* numpy121: numpy==1.21.* @@ -116,7 +112,7 @@ deps = latest: scipy==1.14.* oldest: astropy==4.0.* - oldest: numpy==1.17.* + oldest: numpy==1.19.* oldest: scipy==1.6.* # The following indicates which extras_require from setup.cfg will be installed From e0efb8962ca44fad481799f0ab042ea605cd890b Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:19:22 +0000 Subject: [PATCH 28/34] MAINT: Use importlib.resources (#635) --- skypy/galaxies/spectrum.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/skypy/galaxies/spectrum.py b/skypy/galaxies/spectrum.py index f5492761..ff60b8b0 100644 --- a/skypy/galaxies/spectrum.py +++ b/skypy/galaxies/spectrum.py @@ -4,8 +4,8 @@ from astropy import units from astropy.io import fits +from importlib import resources import numpy as np -from pkg_resources import resource_filename from skypy.utils.photometry import SpectrumTemplates @@ -107,15 +107,15 @@ class KCorrectTemplates(SpectrumTemplates): ''' def __init__(self, hdu=1): - filename = resource_filename('skypy', 'data/kcorrect/k_nmf_derived.default.fits') - with fits.open(filename) as hdul: - self.templates = hdul[hdu].data * units.Unit('erg s-1 cm-2 angstrom-1') - self.wavelength = hdul[11].data * units.Unit('angstrom') - self.mass = hdul[16].data - self.mremain = hdul[17].data - self.mets = hdul[18].data - self.mass300 = hdul[19].data - self.mass1000 = hdul[20].data + with resources.files('skypy') / 'data/kcorrect/k_nmf_derived.default.fits' as filename: + with fits.open(filename) as hdul: + self.templates = hdul[hdu].data * units.Unit('erg s-1 cm-2 angstrom-1') + self.wavelength = hdul[11].data * units.Unit('angstrom') + self.mass = hdul[16].data + self.mremain = hdul[17].data + self.mets = hdul[18].data + self.mass300 = hdul[19].data + self.mass1000 = hdul[20].data def stellar_mass(self, coefficients, magnitudes, filter): r'''Compute stellar mass from absolute magnitudes in a reference filter. From 5e53f774f60b6c444fd068f258246fcd36054121 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:23:50 +0000 Subject: [PATCH 29/34] BLD: Set numpy latest supported version to 2.2 (#634) --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 4320f6df..a59a5df8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = py{39,310,311,312}-test{,-all}{,-dev,-latest,-oldest}{,-cov} - py{39,310,311,312}-test-numpy{119,120,121,122,123,124,125,126,20,21} + py{39,310,311,312}-test-numpy{119,120,121,122,123,124,125,126,20,21,22} py{39,310,311,312}-test-scipy{16,17,18,19,110,111,112,113,114} py{39,310,311,312}-test-astropy{40,41,42,43,50,51,52,53,60,61,70} build_docs @@ -46,6 +46,7 @@ description = numpy125: with numpy 1.26.* numpy20: with numpy 2.0.* numpy21: with numpy 2.1.* + numpy22: with numpy 2.2.* scipy16: with scipy 1.6.* scipy17: with scipy 1.7.* scipy18: with scipy 1.8.* @@ -80,6 +81,7 @@ deps = numpy125: numpy==1.26.* numpy20: numpy==2.0.* numpy21: numpy==2.1.* + numpy22: numpy==2.2.* scipy16: scipy==1.6.* scipy17: scipy==1.7.* @@ -108,7 +110,7 @@ deps = dev: git+https://github.com/astropy/astropy.git#egg=astropy latest: astropy==7.0.* - latest: numpy==2.1.* + latest: numpy==2.2.* latest: scipy==1.14.* oldest: astropy==4.0.* From 560d950fb9aa0e8f5572bd8174ad25ee0caa47c1 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:43:44 +0000 Subject: [PATCH 30/34] MAINT: Don't use importlib.resources.files as a context manager (#639) --- skypy/galaxies/spectrum.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/skypy/galaxies/spectrum.py b/skypy/galaxies/spectrum.py index ff60b8b0..8cdb9e3c 100644 --- a/skypy/galaxies/spectrum.py +++ b/skypy/galaxies/spectrum.py @@ -107,15 +107,15 @@ class KCorrectTemplates(SpectrumTemplates): ''' def __init__(self, hdu=1): - with resources.files('skypy') / 'data/kcorrect/k_nmf_derived.default.fits' as filename: - with fits.open(filename) as hdul: - self.templates = hdul[hdu].data * units.Unit('erg s-1 cm-2 angstrom-1') - self.wavelength = hdul[11].data * units.Unit('angstrom') - self.mass = hdul[16].data - self.mremain = hdul[17].data - self.mets = hdul[18].data - self.mass300 = hdul[19].data - self.mass1000 = hdul[20].data + filename = resources.files('skypy') / 'data/kcorrect/k_nmf_derived.default.fits' + with fits.open(filename) as hdul: + self.templates = hdul[hdu].data * units.Unit('erg s-1 cm-2 angstrom-1') + self.wavelength = hdul[11].data * units.Unit('angstrom') + self.mass = hdul[16].data + self.mremain = hdul[17].data + self.mets = hdul[18].data + self.mass300 = hdul[19].data + self.mass1000 = hdul[20].data def stellar_mass(self, coefficients, magnitudes, filter): r'''Compute stellar mass from absolute magnitudes in a reference filter. From fdd370ea0a4a9eb4d532f69a4f8542fae1bfe576 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:55:08 +0000 Subject: [PATCH 31/34] BLD: Set python latest supported version to 3.13 (#638) --- .github/workflows/compatibility.yaml | 4 ++-- .github/workflows/tests.yaml | 12 ++++++------ tox.ini | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/compatibility.yaml b/.github/workflows/compatibility.yaml index 984ac748..6346d592 100644 --- a/.github/workflows/compatibility.yaml +++ b/.github/workflows/compatibility.yaml @@ -9,8 +9,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ['3.12'] - toxenv: [py312-test, py312-test-dev] + python: ['3.13'] + toxenv: [py313-test, py313-test-dev] release: [main, latest] steps: - name: Checkout Repository diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9657878d..6546eeee 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -23,8 +23,8 @@ jobs: - name: latest supported versions os: ubuntu-latest - python: '3.12' - toxenv: py312-test-all-latest-cov + python: '3.13' + toxenv: py313-test-all-latest-cov toxposargs: --cov-report=xml:${GITHUB_WORKSPACE}/coverage.xml - name: oldest supported versions @@ -34,13 +34,13 @@ jobs: - name: macOS latest supported os: macos-latest - python: '3.12' - toxenv: py312-test-latest + python: '3.13' + toxenv: py313-test-latest - name: Windows latest supported os: windows-latest - python: '3.12' - toxenv: py312-test-latest + python: '3.13' + toxenv: py313-test-latest steps: - name: Checkout Repository diff --git a/tox.ini b/tox.ini index a59a5df8..6e0bd7ac 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,9 @@ [tox] envlist = - py{39,310,311,312}-test{,-all}{,-dev,-latest,-oldest}{,-cov} - py{39,310,311,312}-test-numpy{119,120,121,122,123,124,125,126,20,21,22} - py{39,310,311,312}-test-scipy{16,17,18,19,110,111,112,113,114} - py{39,310,311,312}-test-astropy{40,41,42,43,50,51,52,53,60,61,70} + py{39,310,311,312,313}-test{,-all}{,-dev,-latest,-oldest}{,-cov} + py{39,310,311,312,313}-test-numpy{119,120,121,122,123,124,125,126,20,21,22} + py{39,310,311,312,313}-test-scipy{16,17,18,19,110,111,112,113,114} + py{39,310,311,312,313}-test-astropy{40,41,42,43,50,51,52,53,60,61,70} build_docs linkcheck codestyle From 89c8ac8aa0bece92c9bdc3a75e9465aa13010a79 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:01:26 +0000 Subject: [PATCH 32/34] BLD: Use python 3.13 with readthedocs (#640) --- .readthedocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 47d12ba3..18572bb6 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-20.04 tools: - python: '3.9' + python: '3.13' apt_packages: - graphviz From 597f001bc952451565003c048e47baba9e8b93d3 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Mon, 27 Jan 2025 15:31:53 +0000 Subject: [PATCH 33/34] BLD: Set scipy latest supported version to 1.15 (#641) --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 6e0bd7ac..46998fa2 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist = py{39,310,311,312,313}-test{,-all}{,-dev,-latest,-oldest}{,-cov} py{39,310,311,312,313}-test-numpy{119,120,121,122,123,124,125,126,20,21,22} - py{39,310,311,312,313}-test-scipy{16,17,18,19,110,111,112,113,114} + py{39,310,311,312,313}-test-scipy{16,17,18,19,110,111,112,113,114,115} py{39,310,311,312,313}-test-astropy{40,41,42,43,50,51,52,53,60,61,70} build_docs linkcheck @@ -56,6 +56,7 @@ description = scipy112: with scipy 1.12.* scipy113: with scipy 1.13.* scipy114: with scipy 1.14.* + scipy114: with scipy 1.15.* astropy40: with astropy 4.0.* astropy41: with astropy 4.1.* astropy42: with astropy 4.2.* @@ -92,6 +93,7 @@ deps = scipy112: scipy==1.12.* scipy113: scipy==1.13.* scipy114: scipy==1.14.* + scipy114: scipy==1.15.* astropy40: astropy==4.0.* astropy41: astropy==4.1.* @@ -111,7 +113,7 @@ deps = latest: astropy==7.0.* latest: numpy==2.2.* - latest: scipy==1.14.* + latest: scipy==1.15.* oldest: astropy==4.0.* oldest: numpy==1.19.* From 3e0322561cb9b2accfbd47c7c7cb30f68eadafef Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Mon, 27 Jan 2025 15:41:41 +0000 Subject: [PATCH 34/34] MAINT: Add required sphinx.configuration to readthedocs.conf (#642) --- .readthedocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.readthedocs.yml b/.readthedocs.yml index 18572bb6..4fa0e9b7 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -8,6 +8,7 @@ build: - graphviz sphinx: + configuration: docs/conf.py fail_on_warning: true python: