diff --git a/.cruft.json b/.cruft.json index 72242081..be60e5d0 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/sunpy/package-template", - "commit": "cd21e0d710513a891ed03f29e8afd6e0b9217f04", + "commit": "3737aa309d2a695ada046c7868c5683213003f3d", "checkout": null, "context": { "cookiecutter": { @@ -10,6 +10,12 @@ "author_name": "The SunPy Community", "author_email": "sunpy@googlegrouups.com", "project_url": "https://sunpy.org", + "github_repo": "", + "sourcecode_url": "", + "download_url": "https://pypi.org/project/sunkit-image", + "documentation_url": "", + "changelog_url": "", + "issue_tracker_url": "", "license": "BSD 2-Clause", "minimum_python_version": "3.10", "use_compiled_extensions": "n", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72cf9c6c..4b517068 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ - +# Main CI Workflow name: CI on: @@ -22,7 +22,7 @@ concurrency: jobs: core: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 with: submodules: false coverage: codecov @@ -46,7 +46,7 @@ jobs: test: needs: [core, sdist_verify] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 with: submodules: false coverage: codecov @@ -61,7 +61,7 @@ jobs: docs: needs: [core] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 with: default_python: '3.12' submodules: false @@ -76,7 +76,7 @@ jobs: online: if: "!startsWith(github.event.ref, 'refs/tags/v')" needs: [test] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 with: default_python: '3.12' submodules: false @@ -135,7 +135,7 @@ jobs: contains(github.event.pull_request.labels.*.name, 'Run publish') ) needs: [test, docs] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1 with: python-version: '3.12' test_extras: 'tests' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1ebc2e19..5ebc59f1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.4" + rev: "v0.8.1" hooks: - id: ruff args: ["--fix"] diff --git a/.ruff.toml b/.ruff.toml index 1063ca4f..c8a03be9 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -38,7 +38,6 @@ extend-ignore = [ "UP038", # Use | in isinstance - not compatible with models and is slower # pytest (PT) "PT001", # Always use pytest.fixture() - "PT004", # Fixtures which don't return anything should have leading _ "PT023", # Always use () on pytest decorators # flake8-pie (PIE) "PIE808", # Disallow passing 0 as the first argument to range diff --git a/docs/changelog.rst b/docs/changelog.rst deleted file mode 100644 index 91707e3f..00000000 --- a/docs/changelog.rst +++ /dev/null @@ -1,10 +0,0 @@ -.. _changelog: - -*************** -Release History -*************** - -.. changelog:: - :towncrier: ../ - :towncrier-skip-if-empty: - :changelog_file: ../CHANGELOG.rst diff --git a/docs/conf.py b/docs/conf.py index a1e1ae4a..7fa414b5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -49,9 +49,6 @@ extensions = [ "matplotlib.sphinxext.plot_directive", - "sphinx_automodapi.automodapi", - "sphinx_automodapi.smart_resolver", - "sphinx_changelog", "sphinx_design", "sphinx_gallery.gen_gallery", "sphinx.ext.autodoc", @@ -59,10 +56,13 @@ "sphinx.ext.doctest", "sphinx.ext.inheritance_diagram", "sphinx.ext.intersphinx", - "sphinx.ext.mathjax", "sphinx.ext.napoleon", "sphinx.ext.todo", "sphinx.ext.viewcode", + "sphinx.ext.mathjax", + "sphinx_automodapi.automodapi", + "sphinx_automodapi.smart_resolver", + "sphinx_changelog", ] # Add any paths that contain templates here, relative to this directory. diff --git a/docs/index.rst b/docs/index.rst index 79ec6ad7..d0c4d312 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -21,7 +21,7 @@ sunkit-image :maxdepth: 1 generated/gallery/index - changelog + whatsnew/index Mission Statement ================= diff --git a/docs/whatsnew/changelog.rst b/docs/whatsnew/changelog.rst new file mode 100644 index 00000000..a3678c42 --- /dev/null +++ b/docs/whatsnew/changelog.rst @@ -0,0 +1,10 @@ +.. _changelog: + +************** +Full Changelog +************** + +.. changelog:: + :towncrier: ../../ + :towncrier-skip-if-empty: + :changelog_file: ../../CHANGELOG.rst diff --git a/docs/whatsnew/index.rst b/docs/whatsnew/index.rst new file mode 100644 index 00000000..c404117b --- /dev/null +++ b/docs/whatsnew/index.rst @@ -0,0 +1,12 @@ +.. _whatsnew: + +*************** +Release History +*************** + +This page documents the releases for sunkit-image + +.. toctree:: + :maxdepth: 1 + + changelog diff --git a/pyproject.toml b/pyproject.toml index d759cbc4..3d690e79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,13 +54,13 @@ tests = [ docs = [ "sphinx", "sphinx-automodapi", + "sphinx-changelog", "sunpy-sphinx-theme", "packaging", "sunkit_image[all]", "astroscrappy", "dask", "matplotlib", - "sphinx-changelog", "sphinx-design", "sphinx-gallery", "sunpy[data,net]>=6.0.0", @@ -88,63 +88,59 @@ namespaces = false [tool.setuptools_scm] write_to = "sunkit_image/_version.py" -[ tool.gilesbot ] - [ tool.gilesbot.circleci_artifacts ] - enabled = true - - [ tool.gilesbot.pull_requests ] - enabled = true - - [ tool.gilesbot.towncrier_changelog ] - enabled = true - verify_pr_number = true - changelog_skip_label = "No Changelog Entry Needed" - help_url = "https://github.com/sunpy/sunkit-image/blob/main/changelog/README.rst" - - changelog_missing_long = "There isn't a changelog file in this pull request. Please add a changelog file to the `changelog/` directory following the instructions in the changelog [README](https://github.com/sunpy/sunkit-image/blob/main/changelog/README.rst)." - - type_incorrect_long = "The changelog file you added is not one of the allowed types. Please use one of the types described in the changelog [README](https://github.com/sunpy/sunkit-image/blob/main/changelog/README.rst)" - - number_incorrect_long = "The number in the changelog file you added does not match the number of this pull request. Please rename the file." - +[tool.gilesbot] + [tool.gilesbot.pull_requests] + enabled = true + + [tool.gilesbot.towncrier_changelog] + enabled = true + verify_pr_number = true + changelog_skip_label = "No Changelog Entry Needed" + help_url = "https://github.com/sunpy/sunkit-image/blob/main/changelog/README.rst" + changelog_missing_long = "There isn't a changelog file in this pull request. Please add a changelog file to the `changelog/` directory following the instructions in the changelog [README](https://github.com//blob/main/changelog/README.rst)." + type_incorrect_long = "The changelog file you added is not one of the allowed types. Please use one of the types described in the changelog [README](https://github.com//blob/main/changelog/README.rst)" + number_incorrect_long = "The number in the changelog file you added does not match the number of this pull request. Please rename the file." + +# TODO: This should be in towncrier.toml but Giles currently only works looks in +# pyproject.toml we should move this back when it's fixed. [tool.towncrier] - package = "sunkit_image" - filename = "CHANGELOG.rst" - directory = "changelog/" + package = "sunkit_image" + filename = "CHANGELOG.rst" + directory = "changelog/" issue_format = "`#{issue} `__" - title_format = "{version} ({project_date})" - - [[tool.towncrier.type]] - directory = "breaking" - name = "Backwards Incompatible Changes" - showcontent = true - - [[tool.towncrier.type]] - directory = "api" - name = "API Changes" - showcontent = true - - [[tool.towncrier.type]] - directory = "removal" - name = "Deprecations and Removals" - showcontent = true - - [[tool.towncrier.type]] - directory = "feature" - name = "Features" - showcontent = true - - [[tool.towncrier.type]] - directory = "bugfix" - name = "Bug Fixes" - showcontent = true - - [[tool.towncrier.type]] - directory = "doc" - name = "Improved Documentation" - showcontent = true - - [[tool.towncrier.type]] - directory = "trivial" - name = "Trivial/Internal Changes" - showcontent = true + title_format = "{version} ({project_date})" + + [[tool.towncrier.type]] + directory = "breaking" + name = "Breaking Changes" + showcontent = true + + [[tool.towncrier.type]] + directory = "deprecation" + name = "Deprecations" + showcontent = true + + [[tool.towncrier.type]] + directory = "removal" + name = "Removals" + showcontent = true + + [[tool.towncrier.type]] + directory = "feature" + name = "New Features" + showcontent = true + + [[tool.towncrier.type]] + directory = "bugfix" + name = "Bug Fixes" + showcontent = true + + [[tool.towncrier.type]] + directory = "doc" + name = "Documentation" + showcontent = true + + [[tool.towncrier.type]] + directory = "trivial" + name = "Internal Changes" + showcontent = true diff --git a/sunkit_image/asda.py b/sunkit_image/asda.py index 32fab622..00ea2d72 100644 --- a/sunkit_image/asda.py +++ b/sunkit_image/asda.py @@ -12,14 +12,14 @@ from sunkit_image.utils import calculate_gamma, points_in_poly, reform2d, remove_duplicate __all__ = [ - "generate_velocity_field", "calculate_gamma_values", - "get_vortex_edges", - "get_vortex_properties", - "get_vortex_meshgrid", - "get_rotational_velocity", + "generate_velocity_field", "get_radial_velocity", + "get_rotational_velocity", "get_velocity_field", + "get_vortex_edges", + "get_vortex_meshgrid", + "get_vortex_properties", ] diff --git a/sunkit_image/coalignment.py b/sunkit_image/coalignment.py index 62b2611f..576e2720 100644 --- a/sunkit_image/coalignment.py +++ b/sunkit_image/coalignment.py @@ -18,10 +18,10 @@ from sunpy.util.exceptions import SunpyUserWarning __all__ = [ - "match_template_to_layer", "apply_shifts", - "mapsequence_coalign_by_match_template", "calculate_match_template_shift", + "mapsequence_coalign_by_match_template", + "match_template_to_layer", ] diff --git a/sunkit_image/conftest.py b/sunkit_image/conftest.py index 298d134d..e7af65a9 100644 --- a/sunkit_image/conftest.py +++ b/sunkit_image/conftest.py @@ -3,6 +3,7 @@ import tempfile import warnings import importlib.util +from pathlib import Path import numpy as np import pytest @@ -48,8 +49,8 @@ def _tmp_config_dir(request): tmpdir = tempfile.TemporaryDirectory() os.environ["SUNPY_CONFIGDIR"] = str(tmpdir.name) - astropy.config.paths.set_temp_config._temp_path = str(tmpdir.name) - astropy.config.paths.set_temp_cache._temp_path = str(tmpdir.name) + astropy.config.paths.set_temp_config._temp_path = Path(tmpdir.name) + astropy.config.paths.set_temp_cache._temp_path = Path(tmpdir.name) yield @@ -77,7 +78,7 @@ def tmp_dl_dir(request): """ with tempfile.TemporaryDirectory() as tmpdir: os.environ["SUNPY_DOWNLOADDIR"] = tmpdir - yield tmpdir + yield Path(tmpdir) del os.environ["SUNPY_DOWNLOADDIR"] diff --git a/sunkit_image/tests/helpers.py b/sunkit_image/tests/helpers.py index 21b928aa..b931e59f 100644 --- a/sunkit_image/tests/helpers.py +++ b/sunkit_image/tests/helpers.py @@ -10,7 +10,7 @@ import sunpy from sunpy.tests.helpers import skip_windows -__all__ = ["get_hash_library_name", "figure_test", "skip_windows"] +__all__ = ["figure_test", "get_hash_library_name", "skip_windows"] def get_hash_library_name(): diff --git a/sunkit_image/trace.py b/sunkit_image/trace.py index 210dfd27..c15be25c 100644 --- a/sunkit_image/trace.py +++ b/sunkit_image/trace.py @@ -9,8 +9,8 @@ from sunkit_image.utils.decorators import accept_array_or_map __all__ = [ - "occult2", "bandpass_filter", + "occult2", "smooth", ] diff --git a/sunkit_image/utils/noise.py b/sunkit_image/utils/noise.py index e817d395..28e2d937 100644 --- a/sunkit_image/utils/noise.py +++ b/sunkit_image/utils/noise.py @@ -7,7 +7,7 @@ from scipy.stats import gamma from skimage.util import view_as_windows -__all__ = ["noise_estimation", "noiselevel", "conv2d_matrix", "weak_texture_mask"] +__all__ = ["conv2d_matrix", "noise_estimation", "noiselevel", "weak_texture_mask"] def noise_estimation(img, patchsize=7, decim=0, confidence=1 - 1e-6, iterations=3): diff --git a/sunkit_image/utils/utils.py b/sunkit_image/utils/utils.py index 49d3ccec..b3126b0d 100644 --- a/sunkit_image/utils/utils.py +++ b/sunkit_image/utils/utils.py @@ -14,17 +14,17 @@ from sunpy.map import all_coordinates_from_map __all__ = [ + "apply_upsilon", "bin_edge_summary", + "blackout_pixels_above_radius", "calculate_gamma", "equally_spaced_bins", "find_pixel_radii", + "find_radial_bin_edges", "get_radial_intensity_summary", "points_in_poly", "reform2d", - "remove_duplicate", - "apply_upsilon", - "blackout_pixels_above_radius", - "find_radial_bin_edges" + "remove_duplicate" ]