Skip to content

Commit d3627ab

Browse files
committed
Merge branch 'main' of https://github.com/sunpy/ndcube into irregular_rebin
2 parents b7e5a0e + df88a3f commit d3627ab

File tree

83 files changed

+2621
-775
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2621
-775
lines changed

.circleci/config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
jobname:
3333
type: string
3434
docker:
35-
- image: cimg/python:3.10
35+
- image: cimg/python:3.12
3636
environment:
3737
TOXENV=<< parameters.jobname >>
3838
steps:
@@ -57,7 +57,7 @@ jobs:
5757
jobname:
5858
type: string
5959
docker:
60-
- image: cimg/python:3.10
60+
- image: cimg/python:3.12
6161
environment:
6262
TOXENV: << parameters.jobname >>
6363
GIT_SSH_COMMAND: ssh -i ~/.ssh/id_rsa_b1c8b094a8ec67162b0f18a949a6b1db
@@ -99,16 +99,16 @@ workflows:
9999
matrix:
100100
parameters:
101101
jobname:
102-
- "py310-figure"
103-
- "py310-figure-devdeps"
102+
- "py312-figure"
103+
- "py312-figure-devdeps"
104104

105105
- deploy-reference-images:
106106
name: baseline-<< matrix.jobname >>
107107
matrix:
108108
parameters:
109109
jobname:
110-
- "py310-figure"
111-
- "py310-figure-devdeps"
110+
- "py312-figure"
111+
- "py312-figure-devdeps"
112112
requires:
113113
- << matrix.jobname >>
114114
filters:

.cruft.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "https://github.com/sunpy/package-template",
3-
"commit": "00b247401fc4660d63583bb44117a84ecd36ae01",
3+
"commit": "c66950b04d0a535002d122c9d5bc0f23534b530c",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -10,13 +10,20 @@
1010
"author_name": "The SunPy Community",
1111
"author_email": "sunpy@googlegroups.com",
1212
"project_url": "https://docs.sunpy.org/projects/ndcube",
13+
"github_repo": "sunpy/ndcube",
14+
"sourcecode_url": "https://github.com/sunpy/ndcube",
15+
"download_url": "https://pypi.org/project/ndcube",
16+
"documentation_url": "https://docs.sunpy.org/projects/ndcube",
17+
"changelog_url": "https://docs.sunpy.org/projects/ndcube/en/stable/whatsnew/changelog.html",
18+
"issue_tracker_url": "https://github.com/sunpy/ndcube/issues",
1319
"license": "BSD 2-Clause",
1420
"minimum_python_version": "3.10",
1521
"use_compiled_extensions": "n",
1622
"enable_dynamic_dev_versions": "y",
1723
"include_example_code": "n",
1824
"include_cruft_update_github_workflow": "y",
19-
"_sphinx_theme": "alabaster",
25+
"use_extended_ruff_linting": "y",
26+
"_sphinx_theme": "sunpy",
2027
"_parent_project": "",
2128
"_install_requires": "",
2229
"_copy_without_render": [

.github/workflows/ci.yml

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Main CI Workflow
12
name: CI
23

34
on:
@@ -21,7 +22,7 @@ concurrency:
2122

2223
jobs:
2324
core:
24-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
25+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
2526
with:
2627
submodules: false
2728
coverage: codecov
@@ -37,15 +38,15 @@ jobs:
3738
- uses: actions/checkout@v4
3839
- uses: actions/setup-python@v5
3940
with:
40-
python-version: '3.10'
41+
python-version: '3.12'
4142
- run: python -m pip install -U --user build
4243
- run: python -m build . --sdist
4344
- run: python -m pip install -U --user twine
4445
- run: python -m twine check dist/*
4546

4647
test:
4748
needs: [core, sdist_verify]
48-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
49+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
4950
with:
5051
submodules: false
5152
coverage: codecov
@@ -60,9 +61,9 @@ jobs:
6061

6162
docs:
6263
needs: [core]
63-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
64+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
6465
with:
65-
default_python: '3.10'
66+
default_python: '3.12'
6667
submodules: false
6768
pytest: false
6869
toxdeps: tox-pypi-filter
@@ -84,9 +85,9 @@ jobs:
8485
github.event_name == 'pull_request' &&
8586
contains(github.event.pull_request.labels.*.name, 'Run cron CI')
8687
)
87-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
88+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
8889
with:
89-
default_python: '3.10'
90+
default_python: '3.12'
9091
submodules: false
9192
coverage: codecov
9293
toxdeps: tox-pypi-filter
@@ -95,23 +96,28 @@ jobs:
9596
secrets:
9697
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
9798

98-
publish_pure:
99-
if: |
100-
github.event_name != 'pull_request' && (
101-
github.ref_name != 'main' ||
102-
github.event_name == 'workflow_dispatch' )
103-
needs: [test, docs]
104-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1
105-
with:
106-
python-version: '3.10'
107-
test_extras: 'tests'
108-
test_command: 'pytest -p no:warnings --doctest-rst --pyargs ndcube'
109-
submodules: false
110-
secrets:
111-
pypi_token: ${{ secrets.pypi_token }}
99+
publish:
100+
# Build wheels on PRs only when labelled. Releases will only be published if tagged ^v.*
101+
# see https://github-actions-workflows.openastronomy.org/en/latest/publish.html#upload-to-pypi
102+
if: |
103+
github.event_name != 'pull_request' ||
104+
(
105+
github.event_name == 'pull_request' &&
106+
contains(github.event.pull_request.labels.*.name, 'Run publish')
107+
)
108+
needs: [test, docs]
109+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1
110+
with:
111+
python-version: '3.12'
112+
test_extras: 'all,tests'
113+
test_command: 'pytest -p no:warnings --doctest-rst --pyargs ndcube'
114+
submodules: false
115+
secrets:
116+
pypi_token: ${{ secrets.pypi_token }}
117+
112118
notify:
113119
if: always() && github.event_name == 'workflow_dispatch'
114-
needs: [publish_pure, cron]
120+
needs: [publish, cron]
115121
runs-on: ubuntu-latest
116122
steps:
117123
- uses: Cadair/matrix-notify-action@main

.github/workflows/label_sync.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Label Sync
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
# ┌───────── minute (0 - 59)
6+
# │ ┌───────── hour (0 - 23)
7+
# │ │ ┌───────── day of the month (1 - 31)
8+
# │ │ │ ┌───────── month (1 - 12 or JAN-DEC)
9+
# │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT)
10+
- cron: '0 0 * * *' # run every day at midnight UTC
11+
12+
# Give permissions to write issue labels
13+
permissions:
14+
issues: write
15+
16+
jobs:
17+
label_sync:
18+
runs-on: ubuntu-latest
19+
name: Label Sync
20+
steps:
21+
- uses: srealmoreno/label-sync-action@850ba5cef2b25e56c6c420c4feed0319294682fd
22+
with:
23+
config-file: https://raw.githubusercontent.com/sunpy/.github/main/labels.yml

.github/workflows/sub_package_update.yml

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ jobs:
2121
runs-on: ubuntu-latest
2222
strategy:
2323
fail-fast: true
24-
matrix:
25-
include:
26-
- add-paths: .
27-
body: apply the changes to this repo.
28-
branch: cruft/update
29-
commit-message: "Automatic package template update"
30-
title: Updates from the package template
31-
3224
steps:
3325
- uses: actions/checkout@v4
3426

@@ -55,25 +47,47 @@ jobs:
5547
echo "has_changes=$CHANGES" >> "$GITHUB_OUTPUT"
5648
5749
- name: Run update if available
50+
id: cruft_update
5851
if: steps.check.outputs.has_changes == '1'
5952
run: |
6053
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
6154
git config --global user.name "${{ github.actor }}"
6255
63-
cruft update --skip-apply-ask --refresh-private-variables
56+
cruft_output=$(cruft update --skip-apply-ask --refresh-private-variables)
57+
echo $cruft_output
6458
git restore --staged .
6559
66-
- name: Create pull request
60+
if [[ "$cruft_output" == *"Failed to cleanly apply the update, there may be merge conflicts."* ]]; then
61+
echo merge_conflicts=1 >> $GITHUB_OUTPUT
62+
else
63+
echo merge_conflicts=0 >> $GITHUB_OUTPUT
64+
fi
65+
66+
- name: Check if only .cruft.json is modified
67+
id: cruft_json
6768
if: steps.check.outputs.has_changes == '1'
68-
uses: peter-evans/create-pull-request@v6
69+
run: |
70+
git status --porcelain=1
71+
if [[ "$(git status --porcelain=1)" == " M .cruft.json" ]]; then
72+
echo "Only .cruft.json is modified. Exiting workflow early."
73+
echo "has_changes=0" >> "$GITHUB_OUTPUT"
74+
else
75+
echo "has_changes=1" >> "$GITHUB_OUTPUT"
76+
fi
77+
78+
- name: Create pull request
79+
if: steps.cruft_json.outputs.has_changes == '1'
80+
uses: peter-evans/create-pull-request@v7
6981
with:
7082
token: ${{ secrets.GITHUB_TOKEN }}
71-
add-paths: ${{ matrix.add-paths }}
72-
commit-message: ${{ matrix.commit-message }}
73-
branch: ${{ matrix.branch }}
83+
add-paths: "."
84+
commit-message: "Automatic package template update"
85+
branch: "cruft/update"
7486
delete-branch: true
75-
branch-suffix: timestamp
76-
title: ${{ matrix.title }}
87+
draft: ${{ steps.cruft_update.outputs.merge_conflicts == '1' }}
88+
title: "Updates from the package template"
7789
body: |
78-
This is an autogenerated PR, which will ${{ matrix.body }}.
79-
[Cruft](https://cruft.github.io/cruft/) has detected updates from the Package Template
90+
This is an autogenerated PR, which will applies the latest changes from the [SunPy Package Template](https://github.com/sunpy/package-template).
91+
If this pull request has been opened as a draft there are conflicts which need fixing.
92+
93+
**To run the CI on this pull request you will need to close it and reopen it.**

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repos:
22
# This should be before any formatting hooks like isort
33
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: "v0.4.7"
4+
rev: "v0.8.2"
55
hooks:
66
- id: ruff
77
args: ["--fix"]
@@ -11,7 +11,7 @@ repos:
1111
- id: isort
1212
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|ndcube/extern)$"
1313
- repo: https://github.com/pre-commit/pre-commit-hooks
14-
rev: v4.6.0
14+
rev: v5.0.0
1515
hooks:
1616
- id: check-ast
1717
- id: check-case-conflict

.readthedocs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
version: 2
22

33
build:
4-
os: ubuntu-22.04
4+
os: ubuntu-lts-latest
55
tools:
6-
python: "mambaforge-4.10"
6+
python: "mambaforge-latest"
77
jobs:
88
post_checkout:
99
- git fetch --unshallow || true

.rtd-environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ name: ndcube
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.11
5+
- python=3.12
66
- pip
77
- graphviz!=2.42.*,!=2.43.*

0 commit comments

Comments
 (0)