Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sunpy/sunkit-pyvista
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.3.0
Choose a base ref
...
head repository: sunpy/sunkit-pyvista
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 961 additions and 372 deletions.
  1. +10 −0 .codecov.yaml
  2. +13 −0 .codespellrc
  3. +30 −0 .coveragerc
  4. +39 −0 .cruft.json
  5. +27 −0 .flake8
  6. +56 −27 .github/workflows/ci.yml
  7. +23 −0 .github/workflows/label_sync.yml
  8. +95 −0 .github/workflows/sub_package_update.yml
  9. +63 −31 .gitignore
  10. +16 −0 .isort.cfg
  11. +21 −31 .pre-commit-config.yaml
  12. +6 −2 .readthedocs.yaml
  13. +65 −0 .ruff.toml
  14. +4 −4 CHANGELOG.rst
  15. +7 −1 MANIFEST.in
  16. +9 −0 README.rst
  17. +2 −0 changelog/138.breaking.rst
  18. +1 −0 changelog/165.breaking.rst
  19. +108 −34 docs/conf.py
  20. +1 −1 docs/getting_started.rst
  21. +4 −3 docs/index.rst
  22. +35 −35 docs/make.bat
  23. +4 −0 docs/nitpick-exceptions.txt
  24. +2 −2 docs/{ → whatsnew}/changelog.rst
  25. +12 −0 docs/whatsnew/index.rst
  26. +3 −1 examples/3d_functionality.py
  27. +1 −0 examples/assume_spherical.py
  28. +5 −3 examples/field_lines.py
  29. +6 −4 examples/floating_sphere.py
  30. +2 −2 licenses/LICENSE.rst
  31. +3 −3 licenses/TEMPLATE_LICENSE.rst
  32. +93 −87 pyproject.toml
  33. +30 −2 pytest.ini
  34. +1 −4 sunkit_pyvista/__init__.py
  35. +7 −0 sunkit_pyvista/_dev/__init__.py
  36. +12 −0 sunkit_pyvista/_dev/scm_version.py
  37. +3 −6 sunkit_pyvista/conftest.py
  38. +6 −0 sunkit_pyvista/data/README.rst
  39. +25 −39 sunkit_pyvista/plotter.py
  40. +1 −0 sunkit_pyvista/sample.py
  41. +1 −0 sunkit_pyvista/tests/conftest.py
  42. BIN sunkit_pyvista/tests/image_cache/field_lines_figure.png
  43. +6 −4 sunkit_pyvista/tests/test_magex.py
  44. +5 −3 sunkit_pyvista/tests/test_plotting.py
  45. +27 −25 sunkit_pyvista/tests/test_pyvista.py
  46. +3 −1 sunkit_pyvista/utils.py
  47. +15 −0 sunkit_pyvista/version.py
  48. +53 −17 tox.ini
10 changes: 10 additions & 0 deletions .codecov.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
comment: off
coverage:
status:
project:
default:
threshold: 0.2%

codecov:
require_ci_to_pass: false
notify:
wait_for_ci: true
13 changes: 13 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[codespell]
skip = *.asdf,*.fits,*.fts,*.header,*.json,*.xsh,*cache*,*egg*,*extern*,.git,.idea,.tox,_build,*truncated,*.svg,.asv_env,.history
ignore-words-list =
alog,
nd,
nin,
observ,
ot,
te,
upto,
afile,
precessed,
precess
30 changes: 30 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[run]
omit =
sunkit_pyvista/conftest.py
sunkit_pyvista/*setup_package*
sunkit_pyvista/extern/*
sunkit_pyvista/version*
*/sunkit_pyvista/conftest.py
*/sunkit_pyvista/*setup_package*
*/sunkit_pyvista/extern/*
*/sunkit_pyvista/version*

[report]
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about packages we have installed
except ImportError
# Don't complain if tests don't hit assertions
raise AssertionError
raise NotImplementedError
# Don't complain about script hooks
def main(.*):
# Ignore branches that don't pertain to this version of Python
pragma: py{ignore_python_version}
# Don't complain about IPython completion helper
def _ipython_key_completions_
# typing.TYPE_CHECKING is False at runtime
if TYPE_CHECKING:
# Ignore typing overloads
@overload
39 changes: 39 additions & 0 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"template": "https://github.com/sunpy/package-template",
"commit": "d0b7fbce3a1928f5ad9bc3f37cb4c38464eeba29",
"checkout": null,
"context": {
"cookiecutter": {
"package_name": "sunkit-pyvista",
"module_name": "sunkit_pyvista",
"short_description": "3D visualisation of solar physics data with pyvista",
"author_name": "The SunPy Community",
"author_email": "sunpy@googlegroups.com",
"project_url": "https://sunpy.org",
"github_repo": "sunpy/sunkit-pyvista",
"sourcecode_url": "https://github.com/sunpy/sunkit-pyvista",
"download_url": "https://pypi.org/project/sunkit-pyvista",
"documentation_url": "https://docs.sunpy.org/projects/sunkit-pyvista",
"changelog_url": "https://docs.sunpy.org/projects/sunkit-pyvista/en/stable/whatsnew/changelog.html",
"issue_tracker_url": "https://github.com/sunpy/sunkit-pyvista/issues",
"license": "BSD 3-Clause",
"minimum_python_version": "3.10",
"use_compiled_extensions": "n",
"enable_dynamic_dev_versions": "y",
"include_example_code": "n",
"include_cruft_update_github_workflow": "y",
"use_extended_ruff_linting": "n",
"_sphinx_theme": "sunpy",
"_parent_project": "",
"_install_requires": "",
"_copy_without_render": [
"docs/_templates",
"docs/_static",
".github/workflows/sub_package_update.yml"
],
"_template": "https://github.com/sunpy/package-template",
"_commit": "d0b7fbce3a1928f5ad9bc3f37cb4c38464eeba29"
}
},
"directory": null
}
27 changes: 27 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[flake8]
ignore =
# missing-whitespace-around-operator
E225
# missing-whitespace-around-arithmetic-operator
E226
# line-too-long
E501
# unused-import
F401
# undefined-local-with-import-star
F403
# redefined-while-unused
F811
# Line break occurred before a binary operator
W503,
# Line break occurred after a binary operator
W504
max-line-length = 110
exclude =
.git
__pycache__
docs/conf.py
build
sunkit-pyvista/__init__.py
rst-directives =
plot
83 changes: 56 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,103 @@
# Main CI Workflow
name: CI

on:
push:
branches:
- "main"
- "*.*"
- "!*backport*"
- 'main'
- '*.*'
- '!*backport*'
tags:
- "v*"
- "!*dev*"
- "!*pre*"
- "!*post*"
- 'v*'
- '!*dev*'
- '!*pre*'
- '!*post*'
pull_request:
# Allow manual runs through the web UI
workflow_dispatch:
schedule:
# ┌───────── minute (0 - 59)
# │ ┌───────── hour (0 - 23)
# │ │ ┌───────── day of the month (1 - 31)
# │ │ │ ┌───────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT)
- cron: '0 7 * * 3' # Every Wed at 07:00 UTC

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
core:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
display: true
submodules: false
coverage: codecov
display: true
toxdeps: tox-pypi-filter
envs: |
- linux: py312
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

sdist_verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python -m pip install -U --user build
- run: python -m build . --sdist
- run: python -m pip install -U --user twine
- run: python -m twine check dist/*

test:
needs: [core]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
needs: [core, sdist_verify]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
display: true
submodules: false
coverage: codecov
display: true
toxdeps: tox-pypi-filter
envs: |
- macos: py311
- windows: py310
- linux: py312-devdeps
- windows: py311
- macos: py310
- linux: py310-oldestdeps
- linux: py311-devdeps
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

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"
pytest: false
display: true
default_python: '3.12'
submodules: false
pytest: false
toxdeps: tox-pypi-filter
libraries: |
apt:
- graphviz
envs: |
- linux: build_docs
publish:
# Build wheels when pushing to any branch except main
# publish.yml will only publish if tagged ^v.*
# Build wheels on PRs only when labelled. Releases will only be published if tagged ^v.*
# see https://github-actions-workflows.openastronomy.org/en/latest/publish.html#upload-to-pypi
if: |
github.event_name != 'pull_request' ||
(
github.event_name != 'pull_request' && (
github.ref_name != 'main' ||
github.event_name == 'workflow_dispatch'
)
) || (
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'Run publish')
)
needs: [core]
needs: [test, docs]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1
with:
python-version: "3.12"
python-version: '3.12'
test_extras: 'tests'
test_command: 'pytest -p no:warnings --doctest-rst --pyargs sunkit_pyvista'
submodules: false
secrets:
pypi_token: ${{ secrets.pypi_token }}
23 changes: 23 additions & 0 deletions .github/workflows/label_sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Label Sync
on:
workflow_dispatch:
schedule:
# ┌───────── minute (0 - 59)
# │ ┌───────── hour (0 - 23)
# │ │ ┌───────── day of the month (1 - 31)
# │ │ │ ┌───────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT)
- cron: '0 0 * * *' # run every day at midnight UTC

# Give permissions to write issue labels
permissions:
issues: write

jobs:
label_sync:
runs-on: ubuntu-latest
name: Label Sync
steps:
- uses: srealmoreno/label-sync-action@850ba5cef2b25e56c6c420c4feed0319294682fd
with:
config-file: https://raw.githubusercontent.com/sunpy/.github/main/labels.yml
95 changes: 95 additions & 0 deletions .github/workflows/sub_package_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# This template is taken from the cruft example code, for further information please see:
# https://cruft.github.io/cruft/#automating-updates-with-github-actions
name: Automatic Update from package template
permissions:
contents: write
pull-requests: write

on:
# Allow manual runs through the web UI
workflow_dispatch:
schedule:
# ┌───────── minute (0 - 59)
# │ ┌───────── hour (0 - 23)
# │ │ ┌───────── day of the month (1 - 31)
# │ │ │ ┌───────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT)
- cron: '0 7 * * 1' # Every Monday at 7am UTC

jobs:
update:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install Cruft
run: python -m pip install git+https://github.com/Cadair/cruft@patch-p1

- name: Check if update is available
continue-on-error: false
id: check
run: |
CHANGES=0
if [ -f .cruft.json ]; then
if ! cruft check; then
CHANGES=1
fi
else
echo "No .cruft.json file"
fi
echo "has_changes=$CHANGES" >> "$GITHUB_OUTPUT"
- name: Run update if available
id: cruft_update
if: steps.check.outputs.has_changes == '1'
run: |
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
cruft_output=$(cruft update --skip-apply-ask --refresh-private-variables)
echo $cruft_output
git restore --staged .
if [[ "$cruft_output" == *"Failed to cleanly apply the update, there may be merge conflicts."* ]]; then
echo merge_conflicts=1 >> $GITHUB_OUTPUT
else
echo merge_conflicts=0 >> $GITHUB_OUTPUT
fi
- name: Check if only .cruft.json is modified
id: cruft_json
if: steps.check.outputs.has_changes == '1'
run: |
git status --porcelain=1
if [[ "$(git status --porcelain=1)" == " M .cruft.json" ]]; then
echo "Only .cruft.json is modified. Exiting workflow early."
echo "has_changes=0" >> "$GITHUB_OUTPUT"
else
echo "has_changes=1" >> "$GITHUB_OUTPUT"
fi
- name: Create pull request
if: steps.cruft_json.outputs.has_changes == '1'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: "."
commit-message: "Automatic package template update"
branch: "cruft/update"
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.
**To run the CI on this pull request you will need to close it and reopen it.**
Loading