Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates from package template #174

Merged
merged 6 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/sunpy/package-template",
"commit": "cd21e0d710513a891ed03f29e8afd6e0b9217f04",
"commit": "c60ccf2ddc71d3cf126cea15132a15da307864f7",
"checkout": null,
"context": {
"cookiecutter": {
Expand All @@ -10,6 +10,12 @@
"author_name": "The SunPy Community",
"author_email": "[email protected]",
"project_url": "https://sunkit-spex.readthedocs.io",
"github_repo": "",
"sourcecode_url": "",
"download_url": "https://pypi.org/project/sunkit-spex",
"documentation_url": "",
"changelog_url": "",
"issue_tracker_url": "",
"license": "BSD 3-Clause",
"minimum_python_version": "3.10",
"use_compiled_extensions": "n",
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Main CI Workflow
name: CI

on:
Expand All @@ -21,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 @@ -45,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
Expand All @@ -60,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
Expand All @@ -78,7 +79,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 @@ -99,7 +100,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.4"
rev: "v0.8.3"
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 @@ -40,7 +40,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
7 changes: 7 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ will help you know where to look for certain things:
discussion/index
reference/index
whatsnew/index

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
109 changes: 56 additions & 53 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,16 @@ tests = [
docs = [
"sphinx",
"sphinx-automodapi",
"sphinx-changelog",
"sunpy-sphinx-theme",
"packaging",
"sphinx-changelog",
"sphinx-gallery",
]

[project.urls]
repository = "https://sunkit-spex.readthedocs.io"
Homepage = "https://sunkit-spex.readthedocs.io"
Download = "https://pypi.org/project/sunkit-spex"

[tool.setuptools]
zip-safe = false
Expand All @@ -65,61 +67,62 @@ exclude = ["sunkit_spex._dev*"]
[tool.setuptools_scm]
write_to = "sunkit_spex/_version.py"

[ tool.gilesbot ]

[ tool.gilesbot.pull_requests ]
enabled = true
[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-spex/blob/master/changelog/README.rst"
[tool.gilesbot.towncrier_changelog]
enabled = true
verify_pr_number = true
changelog_skip_label = "No Changelog Entry Needed"
help_url = "https://github.com/sunpy/sunkit-spex/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-spex/blob/master/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-spex/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-spex/blob/master/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-spex/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."
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_spex"
filename = "CHANGELOG.rst"
directory = "changelog/"
issue_format = "`#{issue} <https://github.com/sunpy/sunkit-spex/pull/{issue}>`__"
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
package = "sunkit_spex"
filename = "CHANGELOG.rst"
directory = "changelog/"
issue_format = "`#{issue} <https://github.com/sunpy/sunkit-spex/pull/{issue}>`__"
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
4 changes: 2 additions & 2 deletions sunkit_spex/legacy/emission.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

__all__ = [
"BrokenPowerLawElectronDistribution",
"collisional_loss",
"_get_integrand",
"_integrate_part",
"_split_and_integrate",
"bremsstrahlung_thin_target",
"bremsstrahlung_thick_target",
"bremsstrahlung_thin_target",
"collisional_loss",
]


Expand Down
2 changes: 1 addition & 1 deletion sunkit_spex/legacy/fitting/fitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2441,7 +2441,7 @@ def _calc_hessian(self, mod_without_x, fparams, step=0.01, _abs_step=None):
replacement_steps = np.mean(self._minimize_solution.final_simplex[0][:, zero_steps], axis=0) * step
except AttributeError:
replacement_steps = 0
steps[zero_steps] = replacement_steps if replacement_steps > 0 else step
steps[zero_steps] = replacement_steps if replacement_steps.size > 0 else step
else:
steps = _abs_step

Expand Down
2 changes: 1 addition & 1 deletion sunkit_spex/legacy/integrate.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from scipy.integrate._quadrature import _cached_roots_legendre

__all__ = ["gauss_legendre", "fixed_quad"]
__all__ = ["fixed_quad", "gauss_legendre"]


def _legendre_roots(a, b, n=5):
Expand Down
2 changes: 1 addition & 1 deletion sunkit_spex/legacy/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from sunpy.data import manager
from sunpy.io.special.genx import read_genx

__all__ = ["load_chianti_lines_lite", "load_chianti_continuum", "read_abundance_genx", "load_xray_abundances"]
__all__ = ["load_chianti_continuum", "load_chianti_lines_lite", "load_xray_abundances", "read_abundance_genx"]


@manager.require(
Expand Down
4 changes: 2 additions & 2 deletions sunkit_spex/legacy/thermal.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
from .io import load_chianti_continuum, load_chianti_lines_lite, load_xray_abundances

__all__ = [
"thermal_emission",
"continuum_emission",
"line_emission",
"setup_continuum_parameters",
"setup_line_parameters",
"setup_default_abundances",
"setup_line_parameters",
"thermal_emission",
]

doc_string_params = """
Expand Down
2 changes: 1 addition & 1 deletion sunkit_spex/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from astropy.modeling import Fittable1DModel, Parameter

__all__ = ["StraightLineModel", "GaussianModel"]
__all__ = ["GaussianModel", "StraightLineModel"]


class StraightLineModel(Fittable1DModel):
Expand Down
2 changes: 1 addition & 1 deletion sunkit_spex/models/physical/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from sunpy.data import manager
from sunpy.io.special.genx import read_genx

__all__ = ["load_chianti_lines_lite", "load_chianti_continuum", "read_abundance_genx", "load_xray_abundances"]
__all__ = ["load_chianti_continuum", "load_chianti_lines_lite", "load_xray_abundances", "read_abundance_genx"]


@manager.require(
Expand Down
4 changes: 2 additions & 2 deletions sunkit_spex/models/physical/thermal.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
)

__all__ = [
"thermal_emission",
"continuum_emission",
"line_emission",
"setup_continuum_parameters",
"setup_line_parameters",
"setup_default_abundances",
"setup_line_parameters",
"thermal_emission",
]

doc_string_params = """
Expand Down
2 changes: 1 addition & 1 deletion sunkit_spex/spectrum/spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from astropy.modeling.tabular import Tabular1D
from astropy.utils import lazyproperty

__all__ = ["gwcs_from_array", "SpectralAxis", "Spectrum"]
__all__ = ["SpectralAxis", "Spectrum", "gwcs_from_array"]


def gwcs_from_array(array):
Expand Down
Loading