From cc10b5b4fa4c3f9aaff7c13d1aa5b7be68452463 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 19 Aug 2026 16:57:42 +0000 Subject: [PATCH 1/3] Run cruft update from package template --- .cruft.json | 4 ++-- .isort.cfg | 16 ---------------- .pre-commit-config.yaml | 6 ------ .ruff.toml | 23 ++++++++++++++++++++++- 4 files changed, 24 insertions(+), 25 deletions(-) delete mode 100644 .isort.cfg diff --git a/.cruft.json b/.cruft.json index 994b79d1c..63a5e7a3d 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/.isort.cfg b/.isort.cfg deleted file mode 100644 index 507c4e705..000000000 --- a/.isort.cfg +++ /dev/null @@ -1,16 +0,0 @@ -[settings] -balanced_wrapping = true -skip = - docs/conf.py - ndcube/__init__.py -default_section = THIRDPARTY -include_trailing_comma = true -known_astropy = astropy, asdf -known_sunpy = sunpy -known_first_party = ndcube -length_sort = false -length_sort_sections = stdlib -line_length = 110 -multi_line_output = 3 -no_lines_before = LOCALFOLDER -sections = STDLIB, THIRDPARTY, ASTROPY, SUNPY, FIRSTPARTY, LOCALFOLDER diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 94e63d63a..bf0ca611b 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 ^ndcube/(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 ffaf55311..59b7e605c 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -14,6 +14,7 @@ select = [ "W", "UP", "PT", + "I", "BLE", "A", "C4", @@ -62,7 +63,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. @@ -76,6 +78,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 @@ -88,3 +91,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 = ["ndcube"] +no-lines-before = ["local-folder"] + +[lint.isort.sections] +"astropy" = ["astropy", "asdf", "gwcs", "reproject"] +"sunpy" = ["sunpy"] From 13d26909886d8924a02244ec93cc2e93ef7c9115 Mon Sep 17 00:00:00 2001 From: SunPyBot Date: Thu, 20 Aug 2026 06:53:24 +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 63a5e7a3d..345834cc2 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 bf0ca611b..e499e9bc5 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 40cb1be40c8fd0e6e27f15aed14f0cfc391b4e83 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:36:05 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- ndcube/conftest.py | 4 ++-- ndcube/extra_coords/extra_coords.py | 6 +++--- ndcube/extra_coords/table_coord.py | 8 ++++---- ndcube/extra_coords/tests/test_extra_coords.py | 2 +- ndcube/extra_coords/tests/test_lookup_table_coord.py | 4 ++-- ndcube/global_coords.py | 2 +- ndcube/meta.py | 2 +- ndcube/ndcollection.py | 2 +- ndcube/ndcube.py | 4 ++-- ndcube/tests/helpers.py | 2 +- ndcube/tests/test_ndcube_reproject_and_rebin.py | 2 +- ndcube/utils/sequence.py | 2 +- ndcube/wcs/wrappers/tests/conftest.py | 2 +- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ndcube/conftest.py b/ndcube/conftest.py index 24c86b0bb..6e591ebaf 100644 --- a/ndcube/conftest.py +++ b/ndcube/conftest.py @@ -6,8 +6,6 @@ import numpy as np import pytest -from gwcs import coordinate_frames as cf -from gwcs import wcs import astropy.nddata import astropy.units as u @@ -17,6 +15,8 @@ from astropy.nddata import StdDevUncertainty from astropy.time import Time, TimeDelta from astropy.wcs import WCS +from gwcs import coordinate_frames as cf +from gwcs import wcs from ndcube import ExtraCoords, GlobalCoords, NDCube, NDCubeSequence, NDMeta from ndcube.extra_coords.table_coord import ( diff --git a/ndcube/extra_coords/extra_coords.py b/ndcube/extra_coords/extra_coords.py index 85243597f..bcbf6724d 100644 --- a/ndcube/extra_coords/extra_coords.py +++ b/ndcube/extra_coords/extra_coords.py @@ -1,8 +1,8 @@ import abc -from typing import Any -from numbers import Integral -from functools import reduce, partial from collections.abc import Iterable +from functools import partial, reduce +from numbers import Integral +from typing import Any import numpy as np diff --git a/ndcube/extra_coords/table_coord.py b/ndcube/extra_coords/table_coord.py index e975393d4..0e18b2d3b 100644 --- a/ndcube/extra_coords/table_coord.py +++ b/ndcube/extra_coords/table_coord.py @@ -1,15 +1,15 @@ import abc import copy import uuid -from numbers import Integral -from functools import partial from collections import defaultdict +from functools import partial +from numbers import Integral -import gwcs -import gwcs.coordinate_frames as cf import numpy as np import astropy.units as u +import gwcs +import gwcs.coordinate_frames as cf from astropy.coordinates import SkyCoord from astropy.modeling import models from astropy.modeling.models import tabular_model diff --git a/ndcube/extra_coords/tests/test_extra_coords.py b/ndcube/extra_coords/tests/test_extra_coords.py index e48190ace..577e7e32c 100644 --- a/ndcube/extra_coords/tests/test_extra_coords.py +++ b/ndcube/extra_coords/tests/test_extra_coords.py @@ -1,10 +1,10 @@ from unittest.mock import MagicMock -import gwcs import numpy as np import pytest import astropy.units as u +import gwcs from astropy.coordinates import SkyCoord from astropy.time import Time, TimeDelta from astropy.wcs import WCS diff --git a/ndcube/extra_coords/tests/test_lookup_table_coord.py b/ndcube/extra_coords/tests/test_lookup_table_coord.py index 35ae13886..b4e86878f 100644 --- a/ndcube/extra_coords/tests/test_lookup_table_coord.py +++ b/ndcube/extra_coords/tests/test_lookup_table_coord.py @@ -1,9 +1,9 @@ -import gwcs -import gwcs.coordinate_frames as cf import numpy as np import pytest import astropy.units as u +import gwcs +import gwcs.coordinate_frames as cf from astropy.coordinates import SkyCoord from astropy.time import Time diff --git a/ndcube/global_coords.py b/ndcube/global_coords.py index 8c3c9f215..3514a1799 100644 --- a/ndcube/global_coords.py +++ b/ndcube/global_coords.py @@ -1,8 +1,8 @@ import abc import copy -from typing import Any from collections import OrderedDict, defaultdict from collections.abc import Mapping +from typing import Any import numpy as np diff --git a/ndcube/meta.py b/ndcube/meta.py index 5a10b113c..5a57d5817 100644 --- a/ndcube/meta.py +++ b/ndcube/meta.py @@ -1,7 +1,7 @@ import abc +import collections.abc import copy import numbers -import collections.abc from types import MappingProxyType import numpy as np diff --git a/ndcube/ndcollection.py b/ndcube/ndcollection.py index 68a06babd..7f84e7d31 100644 --- a/ndcube/ndcollection.py +++ b/ndcube/ndcollection.py @@ -1,7 +1,7 @@ +import collections.abc import copy import numbers import textwrap -import collections.abc import numpy as np diff --git a/ndcube/ndcube.py b/ndcube/ndcube.py index ee1b0909a..3fa83779a 100644 --- a/ndcube/ndcube.py +++ b/ndcube/ndcube.py @@ -3,10 +3,10 @@ import inspect import numbers import textwrap +from collections import namedtuple +from collections.abc import Iterable, Mapping from copy import deepcopy from typing import Any -from collections import namedtuple -from collections.abc import Mapping, Iterable import numpy as np diff --git a/ndcube/tests/helpers.py b/ndcube/tests/helpers.py index 0ad35a2a7..de39634f5 100644 --- a/ndcube/tests/helpers.py +++ b/ndcube/tests/helpers.py @@ -2,8 +2,8 @@ """ Helpers for testing ndcube. """ -from pathlib import Path from functools import wraps +from pathlib import Path import matplotlib as mpl import matplotlib.pyplot as plt diff --git a/ndcube/tests/test_ndcube_reproject_and_rebin.py b/ndcube/tests/test_ndcube_reproject_and_rebin.py index b91779e51..6dd82253c 100644 --- a/ndcube/tests/test_ndcube_reproject_and_rebin.py +++ b/ndcube/tests/test_ndcube_reproject_and_rebin.py @@ -1,5 +1,5 @@ -import re import copy +import re import numpy as np import pytest diff --git a/ndcube/utils/sequence.py b/ndcube/utils/sequence.py index 05af52585..5bec94421 100644 --- a/ndcube/utils/sequence.py +++ b/ndcube/utils/sequence.py @@ -3,8 +3,8 @@ Utilities for ndcube sequence. """ -from copy import deepcopy from collections import namedtuple +from copy import deepcopy import numpy as np diff --git a/ndcube/wcs/wrappers/tests/conftest.py b/ndcube/wcs/wrappers/tests/conftest.py index 329d9a1e3..ee98ec09f 100644 --- a/ndcube/wcs/wrappers/tests/conftest.py +++ b/ndcube/wcs/wrappers/tests/conftest.py @@ -1,7 +1,7 @@ import pytest -from astropy.wcs.wcsapi.conftest import Celestial2DLowLevelWCS as ApyCelestial2DLowLevelWCS from astropy.wcs.wcsapi.conftest import * # NOQA +from astropy.wcs.wcsapi.conftest import Celestial2DLowLevelWCS as ApyCelestial2DLowLevelWCS class Celestial2DLowLevelWCS(ApyCelestial2DLowLevelWCS):