Skip to content

Commit 75a4223

Browse files
committed
Merge branch 'main' into srm-model
Merge main
2 parents 0c3357c + 18e30ad commit 75a4223

35 files changed

+1041
-707
lines changed

.cruft.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "https://github.com/sunpy/package-template",
3-
"commit": "1bdd28c1e2d725d9ae9d9c0b6ad682d75687f45d",
3+
"commit": "164646d882aa2e972d305c54778aaaf35f707464",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -17,7 +17,7 @@
1717
"changelog_url": "",
1818
"issue_tracker_url": "",
1919
"license": "BSD 3-Clause",
20-
"minimum_python_version": "3.10",
20+
"minimum_python_version": "3.12",
2121
"use_compiled_extensions": "n",
2222
"enable_dynamic_dev_versions": "y",
2323
"include_example_code": "n",
@@ -32,7 +32,7 @@
3232
".github/workflows/sub_package_update.yml"
3333
],
3434
"_template": "https://github.com/sunpy/package-template",
35-
"_commit": "1bdd28c1e2d725d9ae9d9c0b6ad682d75687f45d"
35+
"_commit": "164646d882aa2e972d305c54778aaaf35f707464"
3636
}
3737
},
3838
"directory": null

.github/workflows/ci.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,55 +29,57 @@ concurrency:
2929

3030
jobs:
3131
core:
32-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
32+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2
3333
with:
3434
submodules: false
3535
coverage: codecov
3636
toxdeps: tox-pypi-filter
3737
envs: |
38-
- linux: py312
38+
- linux: py313
3939
secrets:
4040
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4141

4242
sdist_verify:
4343
runs-on: ubuntu-latest
4444
steps:
45-
- uses: actions/checkout@v4
46-
- uses: actions/setup-python@v5
45+
- uses: actions/checkout@v5
46+
- uses: actions/setup-python@v6
4747
with:
48-
python-version: '3.12'
48+
python-version: '3.13'
4949
- run: python -m pip install -U --user build
5050
- run: python -m build . --sdist
5151
- run: python -m pip install -U --user twine
5252
- run: python -m twine check dist/*
5353

5454
test:
5555
needs: [core, sdist_verify]
56-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
56+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2
5757
with:
5858
submodules: false
5959
coverage: codecov
6060
toxdeps: tox-pypi-filter
6161
posargs:
6262
envs: |
63-
- windows: py311
64-
- macos: py310
65-
- linux: py310-oldestdeps
66-
- linux: py311-devdeps
63+
- linux: py314
64+
- windows: py312
65+
- macos: py312
66+
- linux: py312-oldestdeps
67+
- linux: py314-devdeps
6768
secrets:
6869
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6970

7071
docs:
7172
needs: [core]
72-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
73+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2
7374
with:
74-
default_python: '3.12'
75+
default_python: '3.13'
7576
submodules: false
7677
pytest: false
7778
toxdeps: tox-pypi-filter
7879
libraries: |
7980
apt:
8081
- graphviz
82+
- pandoc
8183
envs: |
8284
- linux: build_docs
8385
@@ -91,9 +93,9 @@ jobs:
9193
contains(github.event.pull_request.labels.*.name, 'Run publish')
9294
)
9395
needs: [test, docs]
94-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1
96+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v2
9597
with:
96-
python-version: '3.12'
98+
python-version: '3.13'
9799
test_extras: 'tests'
98100
test_command: 'pytest -p no:warnings --doctest-rst --pyargs sunkit_spex'
99101
submodules: false

.github/workflows/sub_package_update.yml

Lines changed: 73 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# This template is taken from the cruft example code, for further information please see:
22
# https://cruft.github.io/cruft/#automating-updates-with-github-actions
33
name: Automatic Update from package template
4-
permissions:
5-
contents: write
6-
pull-requests: write
74

85
on:
96
# Allow manual runs through the web UI
@@ -19,14 +16,17 @@ on:
1916
jobs:
2017
update:
2118
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
pull-requests: write
2222
strategy:
2323
fail-fast: true
2424
steps:
25-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@v6
2626

27-
- uses: actions/setup-python@v5
27+
- uses: actions/setup-python@v6
2828
with:
29-
python-version: "3.11"
29+
python-version: "3.14"
3030

3131
- name: Install Cruft
3232
run: python -m pip install git+https://github.com/Cadair/cruft@patch-p1
@@ -93,3 +93,70 @@ jobs:
9393
If this pull request has been opened as a draft there are conflicts which need fixing.
9494
9595
**To run the CI on this pull request you will need to close it and reopen it.**
96+
97+
report-fail:
98+
if: failure()
99+
needs: [update]
100+
runs-on: ubuntu-latest
101+
permissions:
102+
issues: write
103+
steps:
104+
- name: Open an issue if workflow fails
105+
uses: actions/github-script@v7
106+
with:
107+
github-token: ${{ github.token }}
108+
# This script is adapted from https://github.com/scientific-python/issue-from-pytest-log-action
109+
# Under MIT license (c) Scientific Python Developers
110+
script: |
111+
const fs = require('fs');
112+
113+
// Edit these if needed for your repo
114+
const variables = {
115+
owner: context.repo.owner,
116+
name: context.repo.repo,
117+
label: "Infrastructure",
118+
creator: "app/github-actions",
119+
title: "SunPy Package Template auto-update failed."
120+
};
121+
122+
const logs = 'The package update workflow failed.'
123+
const workflow_url = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`;
124+
const issue_body = `[Workflow Run URL](${workflow_url})\n${logs}`;
125+
126+
const query_string = `repo:${variables.owner}/${variables.name} author:${variables.creator} label:${variables.label} is:open in:title ${variables.title}`;
127+
128+
// Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures
129+
const query = `query {
130+
search(query: "${query_string}", type:ISSUE, first: 1) {
131+
edges {
132+
node {
133+
... on Issue {
134+
body
135+
id
136+
number
137+
}
138+
}
139+
}
140+
}
141+
}`;
142+
143+
const result = await github.graphql(query);
144+
145+
// If no issue is open, create a new issue,
146+
// else update the body of the existing issue.
147+
if (result.search.edges.length === 0) {
148+
github.rest.issues.create({
149+
owner: variables.owner,
150+
repo: variables.name,
151+
body: issue_body,
152+
title: variables.title,
153+
labels: [variables.label],
154+
});
155+
} else {
156+
github.rest.issues.update({
157+
owner: variables.owner,
158+
repo: variables.name,
159+
issue_number: result.search.edges[0].node.number,
160+
body: issue_body
161+
});
162+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ docs/generated/
8383
examples/rhessi/
8484
examples/sunxspexRhessiSpectralFitting.pickle
8585
examples/nustar/
86+
examples/stix/
8687
test.pickle
8788

8889
# PyBuilder

.mailmap

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Daniel F. Ryan <ryand5@tcd.ie> Dan Ryan <ryand5@tcd.ie>
2+
Daniel F. Ryan <ryand5@tcd.ie> DanRyanIrish <ryand5@tcd.ie>
3+
Kristopher Cooper <k.cooper.2@research.gla.ac.uk> Kris Cooper <43237137+KriSun95@users.noreply.github.com>
4+
Kristopher Cooper <k.cooper.2@research.gla.ac.uk> KriSun95 <43237137+KriSun95@users.noreply.github.com>
5+
Laura Hayes <hayesla@tcd.ie> hayesla <hayesla@tcd.ie>
6+
Laura Hayes <hayesla@tcd.ie> Laura Hayes <lahayes@gs671-lhayesmbp.ndc.nasa.gov>
7+
Natalia Bajnokova <n.bajnokova.1@research.gla.ac.uk> Natalia Bajnokova <61255393+natsat0919@users.noreply.github.com>
8+
Samuel Bennett <bennett.sm89@gmail.com> CyclingNinja <bennett.sm89@gmail.com>
9+
Samuel Bennett <bennett.sm89@gmail.com> Samuel Bennett <CyclingNinja@users.noreply.github.com>
10+
Shane A. Maloney <shane.maloney@dias.ie> Shane Maloney <maloneys@tcd.ie>
11+
Shane A. Maloney <shane.maloney@dias.ie> Shane Maloney <shane.maloney@dias.ie
12+
Shane A. Maloney <shane.maloney@dias.ie> Shane Maloney <shane.maloney@tcd.ie>
13+
Stuart J. Mumford <stuart@cadair.com> Stuart Mumford <stuart@cadair.com>
14+
William Setterberg <william.s.setterberg@gmail.com> William Setterberg <sette095@umn.edu>

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
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.11.12"
4+
rev: "v0.14.10"
55
hooks:
66
- id: ruff
77
args: ["--fix"]
88
- id: ruff-format
99
- repo: https://github.com/PyCQA/isort
10-
rev: 6.0.1
10+
rev: 7.0.0
1111
hooks:
1212
- id: isort
1313
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|sunkit_spex/extern)$"
1414
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: v5.0.0
15+
rev: v6.0.0
1616
hooks:
1717
- id: check-ast
1818
- id: check-case-conflict

.rtd-environment.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: sunkit-spex
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.10
5+
- python=3.13
66
- pip
77
- graphviz!=2.42.*,!=2.43.*
8-
- sqlite<3.49.0

.ruff.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ select = [
3636
extend-ignore = [
3737
# pycodestyle (E, W)
3838
"E501", # ignore line length will use a formatter instead
39-
# pyupgrade (UP)
40-
"UP038", # Use | in isinstance - not compatible with models and is slower
4139
# pytest (PT)
4240
"PT001", # Always use pytest.fixture()
4341
"PT023", # Always use () on pytest decorators

.zenodo.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"description": "Python package for solar spectroscopy",
3+
"license": "BSD-2-Clause",
4+
"title": "sunkit-spex",
5+
"upload_type": "software",
6+
"creators": [
7+
{
8+
"name": "Laura Hayes",
9+
"orcid": "0000-0002-6835-2390",
10+
"affiliation": "Dublin Institute for Advanced Studies"
11+
},
12+
{
13+
"name": "Daniel F. Ryan",
14+
"orcid": "0000-0001-8661-3825",
15+
"affiliation": "University College London, Mullard Space Science Laboratory (UCL/MSSL)"
16+
},
17+
{
18+
"name": "Shane Maloney",
19+
"orcid": "0000-0002-4715-1805",
20+
"affiliation": "Dublin Institute for Advanced Studies"
21+
},
22+
{
23+
"name": "Stuart J. Mumford",
24+
"orcid": "0000-0003-4217-4642",
25+
"affiliation": "Aperio Software Ltd."
26+
},
27+
{
28+
"name": "Albert Y. Shih",
29+
"orcid": "0000-0001-6874-2594",
30+
"affiliation": "NASA Goddard Space Flight Center"
31+
},
32+
{
33+
"name": "Kristopher Cooper",
34+
"orcid": "",
35+
"affiliation": ""
36+
},
37+
{
38+
"name": "Natalia Bajnokova",
39+
"orcid": "0000-0003-1652-6835",
40+
"affiliation": "University of Glasgow"
41+
},
42+
{
43+
"name": "William Setterberg",
44+
"orcid": "0000-0003-2165-8314",
45+
"affiliation": "University of Minnesota"
46+
},
47+
{
48+
"name": "Jake Mitchell",
49+
"orcid": "0000-0002-5493-1420",
50+
"affiliation": "Leibniz Institute for Astrophysics Potsdam (AIP)",
51+
},
52+
{
53+
"name": "Bin Chen",
54+
"orcid": "",
55+
"affiliation": ""
56+
},
57+
{
58+
"name": "Samuel Bennett",
59+
"orcid": "0000-0001-6420-4422",
60+
"affiliation": "Aperio Software Ltd."
61+
}
62+
]
63+
}

changelog/206.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add the possibility to perform albedo correction within the legacy code. The alebdo matrix is generated with :func:`sunkit_spex.legacy.fitting.albedo.get_albedo_matrix` and the albedo correction is performed in :class:`sunkit_spex.legacy.fitting.fitter.Fitter`.

0 commit comments

Comments
 (0)