Skip to content

Commit

Permalink
Merge branch 'main' of github.com:sunpy/sunkit-magex into sunpy_version
Browse files Browse the repository at this point in the history
  • Loading branch information
nabobalis committed Dec 30, 2024
2 parents c743680 + 10ecdce commit d57aef3
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 28 deletions.
11 changes: 9 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": "75f84c4adf1753af67967930c3335bc73bca9bf5",
"commit": "f14be4e69db1678316566c128153764c0e77aed2",
"checkout": null,
"context": {
"cookiecutter": {
Expand All @@ -10,6 +10,12 @@
"author_name": "The SunPy Community",
"author_email": "[email protected]",
"project_url": "https://sunpy.org",
"github_repo": "sunpy/sunkit-magex",
"sourcecode_url": "https://github.com/sunpy/sunkit-magex",
"download_url": "https://pypi.org/project/sunkit-magex",
"documentation_url": "https://docs.sunpy.org/projects/sunkit-magex",
"changelog_url": "https://docs.sunpy.org/projects/sunkit-magex/en/stable/whatsnew/changelog.html",
"issue_tracker_url": "https://github.com/sunpy/sunkit-magex/issues",
"license": "GNU GPL v3+",
"minimum_python_version": "3.10",
"use_compiled_extensions": "n",
Expand All @@ -25,7 +31,8 @@
"docs/_static",
".github/workflows/sub_package_update.yml"
],
"_template": "https://github.com/sunpy/package-template"
"_template": "https://github.com/sunpy/package-template",
"_commit": "f14be4e69db1678316566c128153764c0e77aed2"
}
},
"directory": null
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

# Main CI Workflow
name: CI

on:
Expand All @@ -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
Expand All @@ -47,7 +47,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
Expand All @@ -62,7 +62,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
Expand All @@ -80,7 +80,7 @@ jobs:
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'Run cron CI')
)
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
Expand All @@ -101,7 +101,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'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/sub_package_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ jobs:
delete-branch: true
draft: ${{ steps.cruft_update.outputs.merge_conflicts == '1' }}
title: "Updates from the package template"
labels: |
No Changelog Entry Needed
body: |
This is an autogenerated PR, which will applies the latest changes from the [SunPy Package Template](https://github.com/sunpy/package-template).
If this pull request has been opened as a draft there are conflicts which need fixing.
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
# This should be before any formatting hooks like isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.7.2"
rev: "v0.8.4"
hooks:
- id: ruff
args: ["--fix"]
Expand Down
1 change: 0 additions & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,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
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"sphinx.ext.mathjax",
"sphinx_automodapi.automodapi",
"sphinx_automodapi.smart_resolver",
'sphinx_gallery.gen_gallery',
'sphinx_changelog',
"sphinx_changelog",
"sphinx_gallery.gen_gallery",
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ This is the documentation for sunkit-magex.
performance
numerical_methods_pfss/index.rst
synoptic_fits
changelog
whatsnew/index
6 changes: 3 additions & 3 deletions docs/changelog.rst → docs/whatsnew/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.. _sunkit-magex-changelog:
.. _changelog:

**************
Full Changelog
**************

.. changelog::
:towncrier: ../
:towncrier: ../../
:towncrier-skip-if-empty:
:changelog_file: ../CHANGELOG.rst
:changelog_file: ../../CHANGELOG.rst
12 changes: 12 additions & 0 deletions docs/whatsnew/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _whatsnew:

***************
Release History
***************

This page documents the releases for sunkit-magex

.. toctree::
:maxdepth: 1

changelog
22 changes: 20 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ tests = [
docs = [
"sphinx",
"sphinx-automodapi",
"sphinx-changelog",
"sunpy-sphinx-theme",
"packaging",
"reproject",
"sphinx-gallery",
"sunpy[net]>=6.0.1,!=6.0.0",
"sunpy-sphinx-theme",
"sunkit-magex[all]",
"sphinx-changelog",
]
performance = [
"numba",
Expand Down Expand Up @@ -75,13 +77,29 @@ exclude = ["sunkit_magex._dev*"]
[tool.setuptools_scm]
write_to = "sunkit_magex/_version.py"

[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-magex/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-magex/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-magex/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_magex"
filename = "CHANGELOG.rst"
directory = "changelog/"
issue_format = "`#{issue} <https://github.com/sunkit_magex/sunkit_magex/pull/{issue}>`__"
issue_format = "`#{issue} <https://github.com/sunpy/sunkit-magex/pull/{issue}>`__"
title_format = "{version} ({project_date})"

[[tool.towncrier.type]]
Expand Down
20 changes: 10 additions & 10 deletions sunkit_magex/pfss/interpolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def __init__(self, points, values):
values = np.asarray(values)

if len(points) > values.ndim:
raise ValueError("There are %d point arrays, but values has %d "
"dimensions" % (len(points), values.ndim))
raise ValueError(f"There are {len(points)} point arrays, but "
"values has {values.ndim} dimensions")

if hasattr(values, 'dtype') and hasattr(values, 'astype'):
if not np.issubdtype(values.dtype, np.inexact):
Expand All @@ -52,14 +52,14 @@ def __init__(self, points, values):

for i, p in enumerate(points):
if not np.all(np.diff(p) > 0.):
raise ValueError("The points in dimension %d must be strictly "
"ascending" % i)
raise ValueError(f"The points in dimension {i} must be strictly "
"ascending")
if not np.asarray(p).ndim == 1:
raise ValueError("The points in dimension %d must be "
"1-dimensional" % i)
raise ValueError(f"The points in dimension {i} must be "
"1-dimensional")
if not values.shape[i] == len(p):
raise ValueError("There are %d points and %d values in "
"dimension %d" % (len(p), values.shape[i], i))
raise ValueError(f"There are {len(p)} points and {values.shape[i]} "
"values in dimension {i}")
self.grid = tuple([np.asarray(p) for p in points])
self.values = values

Expand All @@ -75,8 +75,8 @@ def __call__(self, xi):
xi = _ndim_coords_from_arrays(xi, ndim=ndim)
if xi.shape[-1] != len(self.grid):
raise ValueError("The requested sample points xi have dimension "
"%d, but this RegularGridInterpolator has "
"dimension %d" % (xi.shape[1], ndim))
f"{xi.shape[1]}, but this RegularGridInterpolator has "
f"dimension {ndim}")

xi_shape = xi.shape
xi = xi.reshape(-1, xi_shape[-1])
Expand Down

0 comments on commit d57aef3

Please sign in to comment.