From c04f661db9a5caba93186187dd01a52097ff0ec9 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 19 Aug 2026 16:57:45 +0000 Subject: [PATCH 1/3] Run cruft update from package template --- .cruft.json | 4 ++-- .pre-commit-config.yaml | 6 ------ .ruff.toml | 23 ++++++++++++++++++++++- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.cruft.json b/.cruft.json index 0c48f5c5..2d5e05f6 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/sunpy/package-template", - "commit": "2a6434a5c749ecde69d00b937a3fef27ecbad656", + "commit": "c7bfa729646a7e17ae0e7c50c331e5c489f98fe2", "checkout": null, "context": { "cookiecutter": { @@ -36,7 +36,7 @@ ".github/workflows/zizmor.yml" ], "_template": "https://github.com/sunpy/package-template", - "_commit": "2a6434a5c749ecde69d00b937a3fef27ecbad656" + "_commit": "c7bfa729646a7e17ae0e7c50c331e5c489f98fe2" } }, "directory": null diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 141a1027..75773deb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,12 +8,6 @@ repos: types: [python] # Define here once and then reference using YAML anchor exclude: &exclude_dirs ^sunraster/(data|extern)/ - - repo: https://github.com/PyCQA/isort - rev: 8.0.1 - hooks: - - id: isort - types: [python] - exclude: *exclude_dirs - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 hooks: diff --git a/.ruff.toml b/.ruff.toml index e48d2bfc..c613b6e0 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -14,6 +14,7 @@ select = [ "W", "UP", "PT", + "I", ] extend-ignore = [ # pycodestyle (E, W) @@ -40,7 +41,8 @@ extend-ignore = [ "INP001", # File is part of an implicit namespace package. ] "docs/conf.py" = [ - "E402" # Module imports not at top of file + "E402", # Module imports not at top of file + "I", # isort ] "docs/*.py" = [ "INP001", # File is part of an implicit namespace package. @@ -54,6 +56,7 @@ extend-ignore = [ "F401", # Unused import "F403", # from {name} import * used; unable to detect undefined names "F405", # {name} may be undefined, or defined from star imports + "I", # isort ] "test_*.py" = [ "E402", # Module level import not at top of cell @@ -61,3 +64,21 @@ extend-ignore = [ [lint.pydocstyle] convention = "numpy" + +[lint.isort] +default-section = "third-party" +section-order = [ + "future", + "standard-library", + "third-party", + "astropy", + "sunpy", + "first-party", + "local-folder", +] +known-first-party = ["sunraster"] +no-lines-before = ["local-folder"] + +[lint.isort.sections] +"astropy" = ["astropy", "asdf", "gwcs", "reproject"] +"sunpy" = ["sunpy"] From 9993022e79325c70aee31a2324f0ed8f9d7323cb Mon Sep 17 00:00:00 2001 From: SunPyBot Date: Thu, 20 Aug 2026 06:53:23 +0000 Subject: [PATCH 2/3] Run cruft update from package template --- .cruft.json | 4 ++-- .pre-commit-config.yaml | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.cruft.json b/.cruft.json index 2d5e05f6..148fc979 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/sunpy/package-template", - "commit": "c7bfa729646a7e17ae0e7c50c331e5c489f98fe2", + "commit": "632ed04aee0058dd88dc6b7972ca8f8061fbd6da", "checkout": null, "context": { "cookiecutter": { @@ -36,7 +36,7 @@ ".github/workflows/zizmor.yml" ], "_template": "https://github.com/sunpy/package-template", - "_commit": "c7bfa729646a7e17ae0e7c50c331e5c489f98fe2" + "_commit": "632ed04aee0058dd88dc6b7972ca8f8061fbd6da" } }, "directory": null diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 75773deb..9eeeb64e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,6 +41,12 @@ repos: args: [ "--write-changes" ] types_or: [python, rst] exclude: *exclude_dirs + - repo: https://github.com/sphinx-contrib/sphinx-lint + rev: v1.0.2 + hooks: + - id: sphinx-lint + types_or: [python, rst] + exclude: *exclude_dirs ci: autofix_prs: false autoupdate_schedule: "quarterly" From 62b6e89c5cef017ea5bcc2b1428087fa00eb3298 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 20 Aug 2026 07:25:11 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- sunraster/instr/spice.py | 5 ++--- sunraster/instr/tests/test_spice.py | 2 +- sunraster/spectrogram.py | 7 +++---- sunraster/spectrogram_sequence.py | 3 +-- sunraster/tests/test_spectrogram.py | 5 ++--- sunraster/tests/test_spectrogramsequence.py | 5 ++--- 6 files changed, 11 insertions(+), 16 deletions(-) diff --git a/sunraster/instr/spice.py b/sunraster/instr/spice.py index ea1a133e..509b8044 100644 --- a/sunraster/instr/spice.py +++ b/sunraster/instr/spice.py @@ -3,6 +3,8 @@ import textwrap import numpy as np +from ndcube import NDCollection +from ndcube.meta import NDMeta import astropy.units as u from astropy.coordinates import SkyCoord @@ -10,9 +12,6 @@ from astropy.time import Time from astropy.wcs import WCS -from ndcube import NDCollection -from ndcube.meta import NDMeta - from sunraster import RasterSequence, SpectrogramCube, SpectrogramSequence from sunraster.meta import SlitSpectrographMetaABC diff --git a/sunraster/instr/tests/test_spice.py b/sunraster/instr/tests/test_spice.py index 1436cfff..5c4cc1aa 100644 --- a/sunraster/instr/tests/test_spice.py +++ b/sunraster/instr/tests/test_spice.py @@ -1,12 +1,12 @@ import numpy as np import pytest +from ndcube import NDCollection import astropy.units as u from astropy.coordinates import SkyCoord from astropy.io import fits from astropy.time import Time -from ndcube import NDCollection from sunpy.coordinates import HeliographicStonyhurst from sunraster import RasterSequence, SpectrogramCube, SpectrogramSequence diff --git a/sunraster/spectrogram.py b/sunraster/spectrogram.py index 65704f23..2308131c 100644 --- a/sunraster/spectrogram.py +++ b/sunraster/spectrogram.py @@ -2,15 +2,14 @@ import textwrap from copy import deepcopy +import ndcube.utils.wcs as nuw import numpy as np +from ndcube import NDMeta +from ndcube.ndcube import NDCube import astropy.units as u from astropy.time import Time -import ndcube.utils.wcs as nuw -from ndcube import NDMeta -from ndcube.ndcube import NDCube - __all__ = ["SpectrogramABC","SpectrogramCube"] diff --git a/sunraster/spectrogram_sequence.py b/sunraster/spectrogram_sequence.py index 6a2b2cb5..9a657008 100644 --- a/sunraster/spectrogram_sequence.py +++ b/sunraster/spectrogram_sequence.py @@ -2,13 +2,12 @@ import textwrap import numpy as np +from ndcube import NDCubeSequence import astropy.units as u from astropy.coordinates import SkyCoord from astropy.time import Time -from ndcube import NDCubeSequence - from sunraster.spectrogram import ( SUPPORTED_LATITUDE_NAMES, SUPPORTED_LONGITUDE_NAMES, diff --git a/sunraster/tests/test_spectrogram.py b/sunraster/tests/test_spectrogram.py index 8eec2ff4..ef0c538e 100644 --- a/sunraster/tests/test_spectrogram.py +++ b/sunraster/tests/test_spectrogram.py @@ -1,13 +1,12 @@ import numpy as np import pytest +from ndcube.meta import NDMeta +from ndcube.tests.helpers import assert_cubes_equal import astropy.units as u from astropy.time import Time, TimeDelta from astropy.wcs import WCS -from ndcube.meta import NDMeta -from ndcube.tests.helpers import assert_cubes_equal - import sunraster.spectrogram from sunraster import SpectrogramCube diff --git a/sunraster/tests/test_spectrogramsequence.py b/sunraster/tests/test_spectrogramsequence.py index 1ecb764b..73d4825a 100644 --- a/sunraster/tests/test_spectrogramsequence.py +++ b/sunraster/tests/test_spectrogramsequence.py @@ -1,13 +1,12 @@ import numpy as np import pytest +from ndcube.meta import NDMeta +from ndcube.tests.helpers import assert_cubesequences_equal import astropy.units as u from astropy.time import Time, TimeDelta from astropy.wcs import WCS -from ndcube.meta import NDMeta -from ndcube.tests.helpers import assert_cubesequences_equal - from sunraster import RasterSequence, SpectrogramCube, SpectrogramSequence # Define an sample wcs objects.