diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 183e15c..e99ac15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,9 +26,8 @@ jobs: submodules: false coverage: codecov toxdeps: tox-pypi-filter - posargs: -n auto envs: | - - linux: py311 + - linux: py312 test: needs: [core] @@ -37,17 +36,16 @@ jobs: submodules: false coverage: codecov toxdeps: tox-pypi-filter - posargs: -n auto envs: | - - macos: py310 - - windows: py39 - - linux: py39-oldestdeps + - macos: py311 + - windows: py310 + - linux: py310-oldestdeps docs: needs: [test] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main with: - default_python: '3.9' + default_python: '3.12' submodules: false pytest: false toxdeps: tox-pypi-filter @@ -66,24 +64,9 @@ jobs: submodules: false coverage: codecov toxdeps: tox-pypi-filter - posargs: -n auto --dist loadgroup envs: | - - linux: py311-online - - devdeps: - needs: [online] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main - with: - submodules: false - coverage: codecov - toxdeps: tox-pypi-filter - posargs: -n auto - libraries: | - apt: - # This can be removed when there are binaries for h5py on 3.11 - - libhdf5-dev - envs: | - - linux: py311-devdeps + - linux: py312-online + - linux: py312-devdeps publish: # Build wheels when pushing to any branch except main @@ -101,7 +84,7 @@ jobs: needs: [test] uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main with: - python-version: "3.11" + python-version: "3.12" test_extras: 'dev' test_command: 'pytest -p no:warnings --doctest-rst -m "not mpl_image_compare" --pyargs radiospectra' submodules: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f106d0..7c56f19 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable'] exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|__init__.py|docs/conf.py)$" - repo: https://github.com/psf/black - rev: 24.3.0 + rev: 24.4.2 hooks: - id: black exclude: ".*(.fits|.fts|.fit|.txt|.csv)$" @@ -16,7 +16,7 @@ repos: - id: isort exclude: ".*(.fits|.fts|.fit|.txt|.csv)$" - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-ast - id: check-case-conflict @@ -28,7 +28,6 @@ repos: exclude: ".*(.fits|.fts|.fit|.txt|.csv)$" - id: check-yaml - id: debug-statements - ci: autofix_prs: false autoupdate_schedule: "quarterly" diff --git a/.readthedocs.yml b/.readthedocs.yml index dc5115f..4f38fb2 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -2,7 +2,7 @@ version: 2 build: os: ubuntu-20.04 tools: - python: "3.9" + python: "3.12" apt_packages: - graphviz diff --git a/LICENSE.rst b/LICENSE.rst index c98bfd7..6518fe2 100644 --- a/LICENSE.rst +++ b/LICENSE.rst @@ -1,4 +1,4 @@ -Copyright (c) 2018-2022, The SunPy Developers +Copyright (c) 2018-2024, The SunPy Developers Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.rst b/README.rst index 573756c..75ea082 100644 --- a/README.rst +++ b/README.rst @@ -24,6 +24,7 @@ To see the latest changes in ``radiospectra`` see our `changelog `__. To install ``radiospectra`` once miniforge is installed run the following command: @@ -35,6 +36,7 @@ For detailed installation instructions, see the `installation guide `__ @@ -43,11 +45,13 @@ For more information or to ask questions about ``radiospectra`` or any other Sun Contributing ============ + If you would like to get involved, start by joining the `SunPy Chat`_ and check out our `Newcomers' guide `__. This will walk you through getting set up for contributing. Code of Conduct =============== + When you are interacting with the SunPy community you are asked to follow our `Code of Conduct `__. .. _SunPy Chat: https://openastronomy.element.io/#/room/#sunpy:openastronomy.org diff --git a/changelog/111.breaking.rst b/changelog/111.breaking.rst new file mode 100644 index 0000000..81aed51 --- /dev/null +++ b/changelog/111.breaking.rst @@ -0,0 +1 @@ +Dropped support for Python 3.9 diff --git a/docs/conf.py b/docs/conf.py index 6257917..c8e909c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,28 +10,11 @@ import os import sys import datetime -from pkg_resources import get_distribution from packaging.version import Version -# -- Check for dependencies ---------------------------------------------------- - -doc_requires = get_distribution("radiospectra").requires(extras=("docs",)) -missing_requirements = [] -for requirement in doc_requires: - try: - get_distribution(requirement) - except Exception as e: - missing_requirements.append(requirement.name) -if missing_requirements: - print( - f"The {' '.join(missing_requirements)} package(s) could not be found and " - "is needed to build the documentation, please install the 'docs' requirements." - ) - sys.exit(1) - # -- Read the Docs Specific Configuration -------------------------------------- -# This needs to be done before sunpy is imported +# This needs to be done before radiospectra is imported on_rtd = os.environ.get("READTHEDOCS", None) == "True" if on_rtd: os.environ["SUNPY_CONFIGDIR"] = "/home/docs/" @@ -167,8 +150,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. - -from sunpy_sphinx_theme.conf import * # NOQA +html_theme = "sunpy" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff --git a/radiospectra/net/sources/psp.py b/radiospectra/net/sources/psp.py index bce3090..38286e6 100644 --- a/radiospectra/net/sources/psp.py +++ b/radiospectra/net/sources/psp.py @@ -30,20 +30,19 @@ class RFSClient(GenericClient): 8 Results from the RFSClient: - Start Time End Time ... Provider Wavelength - ... kHz - ----------------------- ----------------------- ... -------- ----------------- - 2019-10-02 00:00:00.000 2019-10-02 23:59:59.999 ... SPDF 10.0 .. 1700.0 - 2019-10-03 00:00:00.000 2019-10-03 23:59:59.999 ... SPDF 10.0 .. 1700.0 - 2019-10-04 00:00:00.000 2019-10-04 23:59:59.999 ... SPDF 10.0 .. 1700.0 - 2019-10-05 00:00:00.000 2019-10-05 23:59:59.999 ... SPDF 10.0 .. 1700.0 - 2019-10-02 00:00:00.000 2019-10-02 23:59:59.999 ... SPDF 1300.0 .. 19200.0 - 2019-10-03 00:00:00.000 2019-10-03 23:59:59.999 ... SPDF 1300.0 .. 19200.0 - 2019-10-04 00:00:00.000 2019-10-04 23:59:59.999 ... SPDF 1300.0 .. 19200.0 - 2019-10-05 00:00:00.000 2019-10-05 23:59:59.999 ... SPDF 1300.0 .. 19200.0 + Start Time End Time Instrument Source Provider Wavelength + kHz + ----------------------- ----------------------- ---------- ------ -------- ----------------- + 2019-10-02 00:00:00.000 2019-10-02 23:59:59.999 RFS PSP SPDF 10.0 .. 1700.0 + 2019-10-03 00:00:00.000 2019-10-03 23:59:59.999 RFS PSP SPDF 10.0 .. 1700.0 + 2019-10-04 00:00:00.000 2019-10-04 23:59:59.999 RFS PSP SPDF 10.0 .. 1700.0 + 2019-10-05 00:00:00.000 2019-10-05 23:59:59.999 RFS PSP SPDF 10.0 .. 1700.0 + 2019-10-02 00:00:00.000 2019-10-02 23:59:59.999 RFS PSP SPDF 1300.0 .. 19200.0 + 2019-10-03 00:00:00.000 2019-10-03 23:59:59.999 RFS PSP SPDF 1300.0 .. 19200.0 + 2019-10-04 00:00:00.000 2019-10-04 23:59:59.999 RFS PSP SPDF 1300.0 .. 19200.0 + 2019-10-05 00:00:00.000 2019-10-05 23:59:59.999 RFS PSP SPDF 1300.0 .. 19200.0 - """ baseurl = ( diff --git a/radiospectra/spectrogram/sources/tests/test_callisto.py b/radiospectra/spectrogram/sources/tests/test_callisto.py index 7d634af..ee2c458 100644 --- a/radiospectra/spectrogram/sources/tests/test_callisto.py +++ b/radiospectra/spectrogram/sources/tests/test_callisto.py @@ -247,7 +247,8 @@ def test_callisto(parse_path_moc): assert spec.end_time.datetime == datetime(2011, 6, 7, 6, 39) assert spec.wavelength.min.to(u.MHz) == 20 * u.MHz assert spec.wavelength.max.to(u.MHz).round(1) == 91.8 * u.MHz - assert str(spec.observatory_location) == "(3801942.21260148, 528924.60367802, 5077174.56861812) m" + assert spec.observatory_location.value.tolist() == (3801942.212601484, 528924.6036780173, 5077174.568618115) + assert spec.observatory_location.unit == u.m @mock.patch("sunpy.util.io.is_file") @@ -490,4 +491,5 @@ def test_callisto_hour_rollover(hdul_moc, is_file_mock): assert spec.end_time.datetime == datetime(2011, 6, 8, 0, 1, 6, 0) assert spec.wavelength.min.to(u.MHz) == 20 * u.MHz assert spec.wavelength.max.to(u.MHz).round(1) == 91.8 * u.MHz - assert str(spec.observatory_location) == "(3801942.21260148, 528924.60367802, 5077174.56861812) m" + assert spec.observatory_location.value.tolist() == (3801942.212601484, 528924.6036780173, 5077174.568618115) + assert spec.observatory_location.unit == u.m diff --git a/setup.cfg b/setup.cfg index fe1d4d9..2a35b0f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,14 +21,14 @@ classifiers = Operating System :: OS Independent Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Topic :: Scientific/Engineering :: Physics [options] zip_safe = False -python_requires = >=3.9 +python_requires = >=3.10 packages = find: include_package_data = True setup_requires = diff --git a/tox.ini b/tox.ini index 806214a..243cb2f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] minversion = 4.0.0 envlist = - py{39,310,311}{,-oldestdeps,-devdeps,-online} + py{310,311,312}{,-oldestdeps,-devdeps,-online} build_docs codestyle requires = @@ -22,14 +22,14 @@ setenv = PYTEST_COMMAND = pytest -vvv -s -ra --pyargs radiospectra --cov-report=xml --cov=radiospectra --cov-config={toxinidir}/setup.cfg {toxinidir}/docs devdeps,build_docs,online: HOME = {envtmpdir} SUNPY_SAMPLEDIR = {env:SUNPY_SAMPLEDIR:{toxinidir}/.tox/{envname}/sample_data/} + devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple deps = devdeps: git+https://github.com/sunpy/sunpy - devdeps: matplotlib - devdeps: scipy - oldestdeps: sunpy<4.1 + devdeps: matplotlib>=0.0.dev0 + devdeps: scipy>=0.0.dev0 + oldestdeps: sunpy<5.1 online: pytest-rerunfailures online: pytest-timeout - pytest-xdist extras = all tests @@ -44,7 +44,7 @@ extras = all docs commands = - sphinx-build -j auto --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs} + sphinx-build --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"))' [testenv:codestyle]