Skip to content

Commit d92703f

Browse files
Cadairsamaloney
andauthored
Updates from package template (#174)
* Update cruft with batchpr * Apply suggestions from code review * Fix pre-commit issues --------- Co-authored-by: Shane Maloney <shane.maloney@dias.ie>
1 parent 4c57adf commit d92703f

File tree

16 files changed

+91
-73
lines changed

16 files changed

+91
-73
lines changed

.cruft.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "https://github.com/sunpy/package-template",
3-
"commit": "cd21e0d710513a891ed03f29e8afd6e0b9217f04",
3+
"commit": "c60ccf2ddc71d3cf126cea15132a15da307864f7",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -10,6 +10,12 @@
1010
"author_name": "The SunPy Community",
1111
"author_email": "sunpy@googlegroups.com",
1212
"project_url": "https://sunkit-spex.readthedocs.io",
13+
"github_repo": "",
14+
"sourcecode_url": "",
15+
"download_url": "https://pypi.org/project/sunkit-spex",
16+
"documentation_url": "",
17+
"changelog_url": "",
18+
"issue_tracker_url": "",
1319
"license": "BSD 3-Clause",
1420
"minimum_python_version": "3.10",
1521
"use_compiled_extensions": "n",

.github/workflows/ci.yml

Lines changed: 6 additions & 5 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
@@ -45,7 +46,7 @@ jobs:
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,7 +61,7 @@ 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:
6566
default_python: '3.12'
6667
submodules: false
@@ -78,7 +79,7 @@ jobs:
7879
github.event_name == 'pull_request' &&
7980
contains(github.event.pull_request.labels.*.name, 'Run cron CI')
8081
)
81-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
82+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
8283
with:
8384
default_python: '3.12'
8485
submodules: false
@@ -99,7 +100,7 @@ jobs:
99100
contains(github.event.pull_request.labels.*.name, 'Run publish')
100101
)
101102
needs: [test, docs]
102-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main
103+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1
103104
with:
104105
python-version: '3.12'
105106
test_extras: 'tests'

.github/workflows/sub_package_update.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ jobs:
8686
delete-branch: true
8787
draft: ${{ steps.cruft_update.outputs.merge_conflicts == '1' }}
8888
title: "Updates from the package template"
89+
labels: |
90+
No Changelog Entry Needed
8991
body: |
9092
This is an autogenerated PR, which will applies the latest changes from the [SunPy Package Template](https://github.com/sunpy/package-template).
9193
If this pull request has been opened as a draft there are conflicts which need fixing.

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
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.7.4"
4+
rev: "v0.8.3"
55
hooks:
66
- id: ruff
77
args: ["--fix"]

.ruff.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ extend-ignore = [
4040
"UP038", # Use | in isinstance - not compatible with models and is slower
4141
# pytest (PT)
4242
"PT001", # Always use pytest.fixture()
43-
"PT004", # Fixtures which don't return anything should have leading _
4443
"PT023", # Always use () on pytest decorators
4544
# flake8-pie (PIE)
4645
"PIE808", # Disallow passing 0 as the first argument to range

docs/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,10 @@ will help you know where to look for certain things:
3333
discussion/index
3434
reference/index
3535
whatsnew/index
36+
37+
Indices and tables
38+
==================
39+
40+
* :ref:`genindex`
41+
* :ref:`modindex`
42+
* :ref:`search`

pyproject.toml

Lines changed: 56 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,16 @@ tests = [
4545
docs = [
4646
"sphinx",
4747
"sphinx-automodapi",
48+
"sphinx-changelog",
4849
"sunpy-sphinx-theme",
4950
"packaging",
5051
"sphinx-changelog",
5152
"sphinx-gallery",
5253
]
5354

5455
[project.urls]
55-
repository = "https://sunkit-spex.readthedocs.io"
56+
Homepage = "https://sunkit-spex.readthedocs.io"
57+
Download = "https://pypi.org/project/sunkit-spex"
5658

5759
[tool.setuptools]
5860
zip-safe = false
@@ -65,61 +67,62 @@ exclude = ["sunkit_spex._dev*"]
6567
[tool.setuptools_scm]
6668
write_to = "sunkit_spex/_version.py"
6769

68-
[ tool.gilesbot ]
69-
70-
[ tool.gilesbot.pull_requests ]
71-
enabled = true
70+
[tool.gilesbot]
71+
[tool.gilesbot.pull_requests]
72+
enabled = true
7273

73-
[ tool.gilesbot.towncrier_changelog ]
74-
enabled = true
75-
verify_pr_number = true
76-
changelog_skip_label = "No Changelog Entry Needed"
77-
help_url = "https://github.com/sunpy/sunkit-spex/blob/master/changelog/README.rst"
74+
[tool.gilesbot.towncrier_changelog]
75+
enabled = true
76+
verify_pr_number = true
77+
changelog_skip_label = "No Changelog Entry Needed"
78+
help_url = "https://github.com/sunpy/sunkit-spex/blob/main/changelog/README.rst"
7879

79-
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-spex/blob/master/changelog/README.rst."
80+
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-spex/blob/main/changelog/README.rst)."
8081

81-
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-spex/blob/master/changelog/README.rst)"
82+
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-spex/blob/main/changelog/README.rst)"
8283

83-
number_incorrect_long = "The number in the changelog file you added does not match the number of this pull request. Please rename the file."
84+
number_incorrect_long = "The number in the changelog file you added does not match the number of this pull request. Please rename the file."
8485

86+
# TODO: This should be in towncrier.toml but Giles currently only works looks in
87+
# pyproject.toml we should move this back when it's fixed.
8588
[tool.towncrier]
86-
package = "sunkit_spex"
87-
filename = "CHANGELOG.rst"
88-
directory = "changelog/"
89-
issue_format = "`#{issue} <https://github.com/sunpy/sunkit-spex/pull/{issue}>`__"
90-
title_format = "{version} ({project_date})"
91-
92-
[[tool.towncrier.type]]
93-
directory = "breaking"
94-
name = "Breaking Changes"
95-
showcontent = true
96-
97-
[[tool.towncrier.type]]
98-
directory = "deprecation"
99-
name = "Deprecations"
100-
showcontent = true
101-
102-
[[tool.towncrier.type]]
103-
directory = "removal"
104-
name = "Removals"
105-
showcontent = true
106-
107-
[[tool.towncrier.type]]
108-
directory = "feature"
109-
name = "New Features"
110-
showcontent = true
111-
112-
[[tool.towncrier.type]]
113-
directory = "bugfix"
114-
name = "Bug Fixes"
115-
showcontent = true
116-
117-
[[tool.towncrier.type]]
118-
directory = "doc"
119-
name = "Documentation"
120-
showcontent = true
121-
122-
[[tool.towncrier.type]]
123-
directory = "trivial"
124-
name = "Internal Changes"
125-
showcontent = true
89+
package = "sunkit_spex"
90+
filename = "CHANGELOG.rst"
91+
directory = "changelog/"
92+
issue_format = "`#{issue} <https://github.com/sunpy/sunkit-spex/pull/{issue}>`__"
93+
title_format = "{version} ({project_date})"
94+
95+
[[tool.towncrier.type]]
96+
directory = "breaking"
97+
name = "Breaking Changes"
98+
showcontent = true
99+
100+
[[tool.towncrier.type]]
101+
directory = "deprecation"
102+
name = "Deprecations"
103+
showcontent = true
104+
105+
[[tool.towncrier.type]]
106+
directory = "removal"
107+
name = "Removals"
108+
showcontent = true
109+
110+
[[tool.towncrier.type]]
111+
directory = "feature"
112+
name = "New Features"
113+
showcontent = true
114+
115+
[[tool.towncrier.type]]
116+
directory = "bugfix"
117+
name = "Bug Fixes"
118+
showcontent = true
119+
120+
[[tool.towncrier.type]]
121+
directory = "doc"
122+
name = "Documentation"
123+
showcontent = true
124+
125+
[[tool.towncrier.type]]
126+
directory = "trivial"
127+
name = "Internal Changes"
128+
showcontent = true

sunkit_spex/legacy/emission.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424

2525
__all__ = [
2626
"BrokenPowerLawElectronDistribution",
27-
"collisional_loss",
2827
"_get_integrand",
2928
"_integrate_part",
3029
"_split_and_integrate",
31-
"bremsstrahlung_thin_target",
3230
"bremsstrahlung_thick_target",
31+
"bremsstrahlung_thin_target",
32+
"collisional_loss",
3333
]
3434

3535

sunkit_spex/legacy/fitting/fitter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2441,7 +2441,7 @@ def _calc_hessian(self, mod_without_x, fparams, step=0.01, _abs_step=None):
24412441
replacement_steps = np.mean(self._minimize_solution.final_simplex[0][:, zero_steps], axis=0) * step
24422442
except AttributeError:
24432443
replacement_steps = 0
2444-
steps[zero_steps] = replacement_steps if replacement_steps > 0 else step
2444+
steps[zero_steps] = replacement_steps if replacement_steps.size > 0 else step
24452445
else:
24462446
steps = _abs_step
24472447

sunkit_spex/legacy/integrate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22
from scipy.integrate._quadrature import _cached_roots_legendre
33

4-
__all__ = ["gauss_legendre", "fixed_quad"]
4+
__all__ = ["fixed_quad", "gauss_legendre"]
55

66

77
def _legendre_roots(a, b, n=5):

0 commit comments

Comments
 (0)