Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/sunpy/package-template",
"commit": "2a6434a5c749ecde69d00b937a3fef27ecbad656",
"commit": "632ed04aee0058dd88dc6b7972ca8f8061fbd6da",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down Expand Up @@ -36,7 +36,7 @@
".github/workflows/zizmor.yml"
],
"_template": "https://github.com/sunpy/package-template",
"_commit": "2a6434a5c749ecde69d00b937a3fef27ecbad656"
"_commit": "632ed04aee0058dd88dc6b7972ca8f8061fbd6da"
}
},
"directory": null
Expand Down
16 changes: 0 additions & 16 deletions .isort.cfg

This file was deleted.

12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -47,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"
23 changes: 22 additions & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ select = [
"W",
"UP",
"PT",
"I",
"BLE",
"A",
"C4",
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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"]
4 changes: 2 additions & 2 deletions ndcube/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 (
Expand Down
6 changes: 3 additions & 3 deletions ndcube/extra_coords/extra_coords.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
8 changes: 4 additions & 4 deletions ndcube/extra_coords/table_coord.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion ndcube/extra_coords/tests/test_extra_coords.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions ndcube/extra_coords/tests/test_lookup_table_coord.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion ndcube/global_coords.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion ndcube/meta.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import abc
import collections.abc
import copy
import numbers
import collections.abc
from types import MappingProxyType

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion ndcube/ndcollection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import collections.abc
import copy
import numbers
import textwrap
import collections.abc

import numpy as np

Expand Down
4 changes: 2 additions & 2 deletions ndcube/ndcube.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ndcube/tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ndcube/tests/test_ndcube_reproject_and_rebin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import re
import copy
import re

import numpy as np
import pytest
Expand Down
2 changes: 1 addition & 1 deletion ndcube/utils/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Utilities for ndcube sequence.
"""

from copy import deepcopy
from collections import namedtuple
from copy import deepcopy

import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion ndcube/wcs/wrappers/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
Loading