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
5 changes: 3 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": "9fff6e66fecd5ab2ed7fefbc0687791e83f46a8a",
"commit": "de26b5a88dcad688046a5a5edbe00b5af1793e13",
"checkout": null,
"context": {
"cookiecutter": {
Expand All @@ -26,6 +26,7 @@
"use_extended_ruff_linting": "y",
"matrix_room_id": "!RehafayCrAiXbzVpXI:openastronomy.org",
"extra_ci_jobs": "mypy,allowed-fail-tests",
"use_sunpy_pr_template": "n",
"_sphinx_theme": "sunpy",
"_parent_project": "",
"_install_requires": "",
Expand All @@ -35,7 +36,7 @@
".github/workflows/zizmor.yml"
],
"_template": "https://github.com/sunpy/package-template",
"_commit": "9fff6e66fecd5ab2ed7fefbc0687791e83f46a8a"
"_commit": "de26b5a88dcad688046a5a5edbe00b5af1793e13"
}
},
"directory": null
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ permissions: {}

jobs:
core:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c8bb6c6c962542921f993d47d26df38dccd50b1 # v3.0.2
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@22ddf09dfabb443adddfb9f861b7d41a787d6b1a # v3.0.3
permissions:
id-token: write
with:
Expand All @@ -58,7 +58,7 @@ jobs:

test:
needs: [core, sdist_verify]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c8bb6c6c962542921f993d47d26df38dccd50b1 # v3.0.2
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@22ddf09dfabb443adddfb9f861b7d41a787d6b1a # v3.0.3
permissions:
id-token: write
with:
Expand All @@ -75,7 +75,7 @@ jobs:

docs:
needs: [core]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c8bb6c6c962542921f993d47d26df38dccd50b1 # v3.0.2
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@22ddf09dfabb443adddfb9f861b7d41a787d6b1a # v3.0.3
with:
default_python: '3.13'
submodules: false
Expand All @@ -89,7 +89,7 @@ jobs:

mypy:
needs: [core]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c8bb6c6c962542921f993d47d26df38dccd50b1 # v3.0.2
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@22ddf09dfabb443adddfb9f861b7d41a787d6b1a # v3.0.3
with:
submodules: false
toxdeps: tox-pypi-filter
Expand All @@ -98,7 +98,7 @@ jobs:

allowed-fail-tests:
needs: [core]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c8bb6c6c962542921f993d47d26df38dccd50b1 # v3.0.2
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@22ddf09dfabb443adddfb9f861b7d41a787d6b1a # v3.0.3
permissions:
id-token: write
with:
Expand All @@ -119,7 +119,7 @@ jobs:
contains(github.event.pull_request.labels.*.name, 'Run publish')
)
needs: [test]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@8c8bb6c6c962542921f993d47d26df38dccd50b1 # v3.0.2
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@22ddf09dfabb443adddfb9f861b7d41a787d6b1a # v3.0.3
with:
python-version: '3.13'
test_extras: 'tests'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sub_package_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
**To run the CI on this pull request you will need to close it and reopen it.**

report-fail:
if: failure()
if: ${{ failure() && github.event_name == 'schedule' }}
needs: [update]
runs-on: ubuntu-latest
permissions:
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
repos:
# This should be before any formatting hooks like isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.16.1"
rev: "v0.16.5"
hooks:
- id: ruff-check
args: ["--fix"]
types: [python]
# Define here once and then reference using YAML anchor
exclude: &exclude_dirs ^dkist/(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", "-D", "-", "-D", ".codespell-dict.txt"]
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"
21 changes: 21 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ select = [
"W",
"UP",
"PT",
"I",
"BLE",
# "A",
"C4",
Expand Down Expand Up @@ -76,6 +77,7 @@ extend-ignore = [
"A001",
"BLE001",
"T201",
"I", # isort
]
"docs/*.py" = [
"INP001", # File is part of an implicit namespace package.
Expand All @@ -89,6 +91,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 Down Expand Up @@ -123,3 +126,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 = ["dkist"]
no-lines-before = ["local-folder"]

[lint.isort.sections]
"astropy" = ["astropy", "asdf", "gwcs", "reproject"]
"sunpy" = ["sunpy"]
4 changes: 1 addition & 3 deletions dkist/dataset/dataset.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
from textwrap import dedent

import numpy as np
from ndcube.ndcube import NDCube, NDCubeLinkedDescriptor

import gwcs
from astropy.wcs.wcsapi.wrappers import SlicedLowLevelWCS

from ndcube.ndcube import NDCube, NDCubeLinkedDescriptor

from dkist.io.dask.striped_array import FileManager
from dkist.io.file_manager import DKISTFileManager
from dkist.utils.decorators import deprecated

from .utils import dataset_info_str

__all__ = ["Dataset"]
Expand Down
3 changes: 1 addition & 2 deletions dkist/dataset/inversion.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import types
import textwrap
import types
from collections.abc import Iterable

import matplotlib.figure
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.gridspec import GridSpec

from ndcube import NDCollection

from dkist.utils.exceptions import DKISTUserWarning
Expand Down
4 changes: 2 additions & 2 deletions dkist/dataset/loader.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import re
import warnings
from pathlib import Path
from functools import cache, singledispatch
from collections import defaultdict
from functools import cache, singledispatch
from pathlib import Path

from packaging.version import Version
from parfive import Results
Expand Down
2 changes: 1 addition & 1 deletion dkist/dataset/tests/test_inversion.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import collections.abc
from itertools import product, permutations
from itertools import permutations, product

import matplotlib.pyplot as plt
import numpy as np
Expand Down
4 changes: 2 additions & 2 deletions dkist/dataset/tests/test_load_dataset.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import contextlib
import numbers
import re
import shutil
import numbers
import contextlib

import pytest
from parfive import Results
Expand Down
2 changes: 1 addition & 1 deletion dkist/dataset/tests/test_tiled_dataset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import re
import copy
import re
from importlib import resources

import matplotlib.pyplot as plt
Expand Down
7 changes: 3 additions & 4 deletions dkist/dataset/tiled_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
not contiguous in the spatial dimensions (due to overlaps and offsets).
"""

import os
import copy
import os
import types
import warnings
from typing import Any, Self, Literal
from collections.abc import Collection, Iterable
from textwrap import dedent
from collections.abc import Iterable, Collection
from typing import Any, Literal, Self

import matplotlib.figure
import matplotlib.pyplot as plt
Expand All @@ -25,7 +25,6 @@

from dkist.io.file_manager import DKISTFileManager
from dkist.utils.exceptions import DKISTDeprecationWarning, DKISTUserWarning

from .dataset import Dataset
from .utils import dataset_info_str

Expand Down
3 changes: 2 additions & 1 deletion dkist/io/asdf/converters/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import astropy.units as u
from asdf_astropy.converters.transform.core import TransformConverterBase, parameter_to_value

import astropy.units as u


class VaryingCelestialConverter(TransformConverterBase):
tags = [
Expand Down
15 changes: 11 additions & 4 deletions dkist/io/asdf/entry_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@
from asdf.extension import ManifestExtension
from asdf.resource import DirectoryResourceMapping

from dkist.io.asdf.converters import (AsymmetricMappingConverter, CoupledCompoundConverter,
DatasetConverter, FileManagerConverter,
InversionConverter, ProfilesConverter, RavelConverter,
TiledDatasetConverter, VaryingCelestialConverter)
from dkist.io.asdf.converters import (
AsymmetricMappingConverter,
CoupledCompoundConverter,
DatasetConverter,
FileManagerConverter,
InversionConverter,
ProfilesConverter,
RavelConverter,
TiledDatasetConverter,
VaryingCelestialConverter,
)


def get_resource_mappings():
Expand Down
14 changes: 10 additions & 4 deletions dkist/io/asdf/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
from astropy.coordinates.matrix_utilities import rotation_matrix
from astropy.modeling import CompoundModel

from dkist.wcs.models import (CoupledCompoundModel, InverseVaryingCelestialTransform,
InverseVaryingCelestialTransform2D, Ravel, Unravel,
VaryingCelestialTransform, VaryingCelestialTransform2D,
varying_celestial_transform_from_tables)
from dkist.wcs.models import (
CoupledCompoundModel,
InverseVaryingCelestialTransform,
InverseVaryingCelestialTransform2D,
Ravel,
Unravel,
VaryingCelestialTransform,
VaryingCelestialTransform2D,
varying_celestial_transform_from_tables,
)


def test_roundtrip_vct():
Expand Down
2 changes: 1 addition & 1 deletion dkist/io/asdf/tests/test_schema_infra.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pathlib
import itertools
import pathlib

import pytest

Expand Down
6 changes: 3 additions & 3 deletions dkist/io/dask/striped_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
view into the original ``StripedExternalArray`` object through the
``StripedExternalArrayView`` class.
"""
import os
import abc
from typing import Any, Protocol
import os
from collections.abc import Iterable
from pathlib import Path
from textwrap import dedent
from collections.abc import Iterable
from typing import Any, Protocol

import dask.array
import numpy as np
Expand Down
4 changes: 2 additions & 2 deletions dkist/io/file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
This file contains the DKIST specific FileManager code.
"""

import os
import json
import os
import urllib
from typing import Any
from pathlib import Path
from textwrap import dedent
from typing import Any

from parfive import Downloader, Results

Expand Down
2 changes: 1 addition & 1 deletion dkist/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
- Overrides warnings.showwarnings so that subclasses of given warning classes are displayed using the logger.
* Sets up a ``log`` instance which uses the Astropy StreamHandler class to log to stdout and colourise the output.
"""
import logging
import os
import sys
import logging
import warnings

from astropy.logger import StreamHandler as AstropyStreamHandler
Expand Down
4 changes: 2 additions & 2 deletions dkist/net/attrs_values.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"Functions for working with the net submodule"
import json
import urllib
import datetime as dt
import importlib.resources
import json
import urllib
from pathlib import Path

import platformdirs
Expand Down
Loading
Loading