From 49ae28d9d5e042fef897fde0e029a0c99d371156 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 17 Nov 2023 11:07:20 -0800 Subject: [PATCH] Changelog and bumps --- .github/workflows/ci.yml | 30 ++++------------ CHANGELOG.rst | 11 ++++++ README.rst | 4 +-- ...e_goes_temperature_and_emission_measure.py | 1 - examples/plot_suvi_thematic_map.py | 3 +- setup.cfg | 34 ++++--------------- sunkit_instruments/data/test/__init__.py | 4 +-- sunkit_instruments/fermi/fermi.py | 7 ++-- sunkit_instruments/fermi/tests/test_fermi.py | 3 +- .../goes_xrs/goes_chianti_tem.py | 3 +- sunkit_instruments/goes_xrs/goes_xrs.py | 4 +-- .../goes_xrs/tests/test_goes_xrs.py | 7 ++-- sunkit_instruments/iris/tests/test_iris.py | 1 - sunkit_instruments/lyra/lyra.py | 7 ++-- sunkit_instruments/lyra/tests/test_lyra.py | 5 ++- sunkit_instruments/rhessi/rhessi.py | 5 ++- .../rhessi/tests/test_rhessi.py | 3 +- sunkit_instruments/suvi/io.py | 3 +- sunkit_instruments/suvi/suvi.py | 5 ++- sunkit_instruments/suvi/tests/test_io.py | 1 - tox.ini | 17 +++++----- 21 files changed, 57 insertions(+), 101 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 651af2f0..ccc1931c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: with: submodules: false coverage: codecov - toxdeps: "'tox<4' tox-pypi-filter" + toxdeps: tox-pypi-filter posargs: -n auto envs: | - linux: py311 @@ -36,12 +36,12 @@ jobs: with: submodules: false coverage: codecov - toxdeps: "'tox<4' tox-pypi-filter" + toxdeps: tox-pypi-filter posargs: -n auto envs: | - macos: py310 - windows: py39 - - linux: py38-oldestdeps + - linux: py39-oldestdeps docs: needs: [test] @@ -50,8 +50,7 @@ jobs: default_python: '3.9' submodules: false pytest: false - toxdeps: "'tox<4' tox-pypi-filter" - cache-key: docs-${{ github.run_id }} + toxdeps: tox-pypi-filter libraries: | apt: - graphviz @@ -63,28 +62,12 @@ jobs: needs: [test] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main with: - default_python: '3.8' submodules: false coverage: codecov - toxdeps: "'tox<4' tox-pypi-filter" + toxdeps: tox-pypi-filter posargs: -n auto --dist loadgroup envs: | - - linux: py310-online - - cron: - if: | - github.event_name == 'workflow_dispatch' || ( - github.event_name == 'pull_request' && - contains(github.event.pull_request.labels.*.name, 'Run cron CI') - ) - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main - with: - default_python: '3.8' - submodules: false - coverage: codecov - toxdeps: "'tox<4' tox-pypi-filter" - posargs: -n auto - envs: | + - linux: py311-online - linux: py311-devdeps publish: @@ -103,6 +86,7 @@ jobs: needs: [test] uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main with: + python-version: "3.11" test_extras: 'dev' test_command: 'pytest -p no:warnings --doctest-rst -m "not mpl_image_compare" --pyargs sunkit_instruments' submodules: false diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3178f9b4..5a6b5851 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,14 @@ +0.5.0 (2023-11-17) +================== + +Maintenance release, no new features or bugfixes. + +Breaking Changes +---------------- + +- Increased minimum version of ``sunpy`` to 5.0.0 +- Increased minimum version of Python to 3.9 + 0.4.0 (2023-04-04) ================== diff --git a/README.rst b/README.rst index 0c2db2c7..b031f13c 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ -A SunPy-affiliated package for solar instrument-specific tools. ---------------------------------------------------------------- +A SunPy affiliated package for solar instrument-specific tools +-------------------------------------------------------------- .. image:: http://img.shields.io/badge/powered%20by-SunPy-orange.svg?style=flat :target: http://www.sunpy.org diff --git a/examples/calculate_goes_temperature_and_emission_measure.py b/examples/calculate_goes_temperature_and_emission_measure.py index c1558dda..85e4b3e2 100644 --- a/examples/calculate_goes_temperature_and_emission_measure.py +++ b/examples/calculate_goes_temperature_and_emission_measure.py @@ -10,7 +10,6 @@ """ import matplotlib.pyplot as plt - from sunpy import timeseries as ts from sunpy.data.sample import GOES_XRS_TIMESERIES diff --git a/examples/plot_suvi_thematic_map.py b/examples/plot_suvi_thematic_map.py index b9d47a99..ae97352a 100644 --- a/examples/plot_suvi_thematic_map.py +++ b/examples/plot_suvi_thematic_map.py @@ -12,12 +12,11 @@ """ import matplotlib.pyplot as plt +from astropy.io import fits from matplotlib.colors import ListedColormap from matplotlib.patches import Patch from parfive import Downloader -from astropy.io import fits - from sunkit_instruments.suvi._variables import SOLAR_CLASS_NAME, SOLAR_COLORS ############################################################################### diff --git a/setup.cfg b/setup.cfg index 9457c14e..4631bb70 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,7 +20,6 @@ classifiers = Operating System :: OS Independent Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 @@ -28,14 +27,14 @@ classifiers = [options] zip_safe = False -python_requires = >=3.8 +python_requires = >=3.9 packages = find: include_package_data = True setup_requires = setuptools_scm install_requires = scipy - sunpy[net,timeseries]>=4.0.0 + sunpy[net,timeseries]>=5.0.0 [options.extras_require] tests = @@ -46,8 +45,8 @@ docs = sphinx-changelog sphinx-gallery sunpy-sphinx-theme - # Not a direct dependency, but we need to pin this until sphinx-changelog is updated (see #6668) - towncrier<22.12.0 + # Remove next line when fixed in towncrier; see https://github.com/twisted/towncrier/issues/528 + importlib-resources<6 [options.packages.find] exclude = sunkit_instruments._dev @@ -82,33 +81,12 @@ filterwarnings = ignore:numpy.ndarray size changed:RuntimeWarning ignore:distutils Version classes are deprecated. Use packaging.version instead:DeprecationWarning ignore:Unknown units for CHANNEL:sunpy.util.exceptions.SunpyUserWarning + ignore:.*is deprecated and slated for removal in Python 3:DeprecationWarning -[pycodestyle] -max_line_length = 100 - -[flake8] -max-line-length = 100 -exclude = - .git, - __pycache__, - docs/conf.py, - build, -rst-directives = - plot [isort] -balanced_wrapping = True -skip=docs/conf.py -default_section = THIRDPARTY -include_trailing_comma = True -known_astropy = astropy, asdf, sunpy -known_first_party = sunkit_instruments -length_sort = False -length_sort_sections=stdlib line_length = 110 -multi_line_output = 3 -no_lines_before = LOCALFOLDER -sections = STDLIB, THIRDPARTY, ASTROPY, FIRSTPARTY, LOCALFOLDER +profile = black [coverage:run] omit = diff --git a/sunkit_instruments/data/test/__init__.py b/sunkit_instruments/data/test/__init__.py index d059f293..a6a43a8c 100644 --- a/sunkit_instruments/data/test/__init__.py +++ b/sunkit_instruments/data/test/__init__.py @@ -1,10 +1,10 @@ """ This package contains all of sunkit-instruments's test data. """ +import fnmatch +import glob import os import re -import glob -import fnmatch from astropy.utils.data import get_pkg_data_filename diff --git a/sunkit_instruments/fermi/fermi.py b/sunkit_instruments/fermi/fermi.py index 0d6addb6..a8cf4642 100644 --- a/sunkit_instruments/fermi/fermi.py +++ b/sunkit_instruments/fermi/fermi.py @@ -2,16 +2,15 @@ This module provides processing routines for Fermi Gamma-ray Space Telescope (FGST), formerly called the Gamma-ray Large Area Space Telescope (GLAST). """ -import os import copy -import urllib +import os import tempfile +import urllib from collections import OrderedDict +import astropy.units as u import matplotlib.pyplot as plt import numpy as np - -import astropy.units as u from astropy.coordinates import Latitude, Longitude from astropy.io import fits from astropy.time import TimeDelta diff --git a/sunkit_instruments/fermi/tests/test_fermi.py b/sunkit_instruments/fermi/tests/test_fermi.py index ca648fe3..74c388ae 100644 --- a/sunkit_instruments/fermi/tests/test_fermi.py +++ b/sunkit_instruments/fermi/tests/test_fermi.py @@ -1,7 +1,6 @@ +import astropy.units as u import pytest from numpy.testing import assert_almost_equal - -import astropy.units as u from sunpy.time import parse_time from sunkit_instruments import fermi diff --git a/sunkit_instruments/goes_xrs/goes_chianti_tem.py b/sunkit_instruments/goes_xrs/goes_chianti_tem.py index 03bb6de7..8a0178ae 100644 --- a/sunkit_instruments/goes_xrs/goes_chianti_tem.py +++ b/sunkit_instruments/goes_xrs/goes_chianti_tem.py @@ -1,10 +1,9 @@ import numpy as np import pandas as pd -from scipy import interpolate - from astropy import units as u from astropy.io import fits from astropy.time import Time +from scipy import interpolate from sunpy import timeseries as ts from sunpy.data import manager from sunpy.time import parse_time diff --git a/sunkit_instruments/goes_xrs/goes_xrs.py b/sunkit_instruments/goes_xrs/goes_xrs.py index 5f4e2fb9..2ea445f5 100644 --- a/sunkit_instruments/goes_xrs/goes_xrs.py +++ b/sunkit_instruments/goes_xrs/goes_xrs.py @@ -1,5 +1,4 @@ import numpy as np - from astropy import units as u from sunpy.time import parse_time @@ -36,8 +35,7 @@ def get_goes_event_list(timerange, goes_class_filter=None): A list of all the flares found for the given time range. """ # Importing hek here to avoid calling code that relies on optional dependencies. - import sunpy.net.attrs as attrs - from sunpy.net import hek + from sunpy.net import attrs, hek # use HEK module to search for GOES events client = hek.HEKClient() diff --git a/sunkit_instruments/goes_xrs/tests/test_goes_xrs.py b/sunkit_instruments/goes_xrs/tests/test_goes_xrs.py index 51e641e5..9b91dda9 100644 --- a/sunkit_instruments/goes_xrs/tests/test_goes_xrs.py +++ b/sunkit_instruments/goes_xrs/tests/test_goes_xrs.py @@ -1,11 +1,10 @@ +import astropy.units as u import numpy as np import pytest -from numpy.testing import assert_almost_equal, assert_array_equal -from scipy.io import readsav - -import astropy.units as u from astropy.time import Time from astropy.units.quantity import Quantity +from numpy.testing import assert_almost_equal, assert_array_equal +from scipy.io import readsav from sunpy import timeseries from sunpy.time import TimeRange, is_time_equal, parse_time from sunpy.util.exceptions import SunpyUserWarning diff --git a/sunkit_instruments/iris/tests/test_iris.py b/sunkit_instruments/iris/tests/test_iris.py index 965fdc0b..c5c66ae0 100644 --- a/sunkit_instruments/iris/tests/test_iris.py +++ b/sunkit_instruments/iris/tests/test_iris.py @@ -2,7 +2,6 @@ import numpy as np import pytest - import sunpy.map from sunkit_instruments import iris diff --git a/sunkit_instruments/lyra/lyra.py b/sunkit_instruments/lyra/lyra.py index 54b7de6b..c11f10af 100644 --- a/sunkit_instruments/lyra/lyra.py +++ b/sunkit_instruments/lyra/lyra.py @@ -2,16 +2,15 @@ This module provides processing routines for data captured with the LYRA (Lyman Alpha Radiometer) instrument on Proba-2. """ -import csv import copy -import sqlite3 +import csv import datetime -from warnings import warn +import sqlite3 from urllib.parse import urljoin +from warnings import warn import numpy as np import pandas - from astropy.time import Time from sunpy.data import cache from sunpy.time import parse_time diff --git a/sunkit_instruments/lyra/tests/test_lyra.py b/sunkit_instruments/lyra/tests/test_lyra.py index 77ccaffd..1413c401 100644 --- a/sunkit_instruments/lyra/tests/test_lyra.py +++ b/sunkit_instruments/lyra/tests/test_lyra.py @@ -1,11 +1,10 @@ -import os.path import datetime +import os.path +import astropy.units as u import numpy as np import pandas import pytest - -import astropy.units as u from astropy.time import TimeDelta from sunpy import timeseries from sunpy.time import is_time_equal, parse_time diff --git a/sunkit_instruments/rhessi/rhessi.py b/sunkit_instruments/rhessi/rhessi.py index 17fe7e47..d13e9eb0 100644 --- a/sunkit_instruments/rhessi/rhessi.py +++ b/sunkit_instruments/rhessi/rhessi.py @@ -3,12 +3,11 @@ data. """ -import re import csv - -import numpy as np +import re import astropy.units as u +import numpy as np import sunpy.io from astropy.time import Time, TimeDelta from sunpy.coordinates import sun diff --git a/sunkit_instruments/rhessi/tests/test_rhessi.py b/sunkit_instruments/rhessi/tests/test_rhessi.py index f22e8316..b6c4229d 100644 --- a/sunkit_instruments/rhessi/tests/test_rhessi.py +++ b/sunkit_instruments/rhessi/tests/test_rhessi.py @@ -1,11 +1,10 @@ import platform import textwrap -from unittest import mock from distutils.version import LooseVersion +from unittest import mock import numpy as np import pytest - import sunpy.io import sunpy.map from sunpy.time import is_time_equal, parse_time diff --git a/sunkit_instruments/suvi/io.py b/sunkit_instruments/suvi/io.py index 4995da42..43b82f0f 100644 --- a/sunkit_instruments/suvi/io.py +++ b/sunkit_instruments/suvi/io.py @@ -1,12 +1,11 @@ -import os import gzip import logging +import os import tempfile from pathlib import Path import h5py import numpy - import sunpy.map from astropy import units as u from astropy.io import fits diff --git a/sunkit_instruments/suvi/suvi.py b/sunkit_instruments/suvi/suvi.py index 805bba46..ab7f2348 100644 --- a/sunkit_instruments/suvi/suvi.py +++ b/sunkit_instruments/suvi/suvi.py @@ -1,11 +1,10 @@ from pathlib import Path import numpy as np -from scipy import interpolate -from scipy.ndimage import gaussian_filter - import sunpy.map from astropy import units as u +from scipy import interpolate +from scipy.ndimage import gaussian_filter from sunkit_instruments.suvi._variables import ( FILTER_SETUP, diff --git a/sunkit_instruments/suvi/tests/test_io.py b/sunkit_instruments/suvi/tests/test_io.py index 9cf567cb..f21aaa7a 100644 --- a/sunkit_instruments/suvi/tests/test_io.py +++ b/sunkit_instruments/suvi/tests/test_io.py @@ -1,6 +1,5 @@ import numpy as np import pytest - import sunpy.map from astropy.io import fits from sunpy.map.sources.suvi import SUVIMap diff --git a/tox.ini b/tox.ini index 459adfc4..3e36b768 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,9 @@ [tox] +minversion = 4.0 envlist = - py{38,39,310,311}{,-devdeps,-online,-oldestdeps} + py{39,310,311}{,-devdeps,-online,-oldestdeps} build_docs codestyle -requires = - setuptools >=56, !=61.0.0 - pip >= 19.3.1 - tox-pypi-filter >= 0.12 -isolated_build = true [testenv] pypi_filter = https://raw.githubusercontent.com/sunpy/sunpy/main/.test_package_pins.txt @@ -30,12 +26,13 @@ passenv = CIRCLECI deps = devdeps: git+https://github.com/sunpy/sunpy - oldestdeps: sunpy<4.1 + oldestdeps: sunpy<5.1 online: pytest-rerunfailures online: pytest-timeout pytest-xdist extras = - dev + all + tests commands = !online: {env:PYTEST_COMMAND} {posargs} online: {env:PYTEST_COMMAND} --reruns 3 --reruns-delay 30 --timeout=180 --remote-data=any {posargs} @@ -44,7 +41,9 @@ commands = usedevelop = true changedir = docs description = Invoke sphinx-build to build the HTML docs -extras = dev +extras = + all + docs commands = sphinx-build -j auto --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs} python -c 'import pathlib; print("Documentation available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "docs" / "_build" / "index.html"))'