Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair committed Feb 3, 2024
2 parents 7b8ea74 + 1593365 commit 677738f
Show file tree
Hide file tree
Showing 180 changed files with 4,670 additions and 2,077 deletions.
9 changes: 9 additions & 0 deletions .circleci/codecov_upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -e
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
./codecov "$@"
33 changes: 19 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ skip-check: &skip-check
command: bash .circleci/early_exit.sh

merge-check: &merge-check
name: Check if we need to merge upstream master
name: Check if we need to merge upstream main
command: |
if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then
git fetch origin --tags
Expand All @@ -24,15 +24,15 @@ apt-run: &apt-install
name: Install apt packages
command: |
sudo apt update
sudo apt install -y graphviz build-essential libopenjp2-7 python3-dev
sudo apt install -y libopenjp2-7
jobs:
figure:
parameters:
jobname:
type: string
docker:
- image: circleci/python:3.8
- image: cimg/python:3.10
environment:
TOXENV=<< parameters.jobname >>
steps:
Expand All @@ -42,19 +42,22 @@ jobs:
- run: *merge-check
- run: *apt-install
- run: pip install --user -U tox tox-pypi-filter
- run: tox
- run: curl -s https://codecov.io/bash | bash
- run: tox -v
- run:
name: Running codecov
command: bash -e .circleci/codecov_upload.sh -f ".tmp/${TOXENV}/coverage.xml"
- store_artifacts:
path: .tmp/<< parameters.jobname >>/figure_test_images
- run:
name: "Image comparison page is available at: "
command: echo "${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/.tmp/${TOXENV}/figure_test_images/fig_comparison.html"

deploy-reference-images:
parameters:
jobname:
type: string
docker:
- image: circleci/python:3.8
- image: cimg/python:3.10
environment:
TOXENV: << parameters.jobname >>
GIT_SSH_COMMAND: ssh -i ~/.ssh/id_rsa_b1c8b094a8ec67162b0f18a949a6b1db
Expand All @@ -72,8 +75,9 @@ jobs:
- run: git config --global user.email "ndcube@circleci" && git config --global user.name "ndcube Circle CI"
- run: git clone [email protected]:sunpy/sunpy-figure-tests.git --depth 1 -b ndcube-${CIRCLE_BRANCH} ~/sunpy-figure-tests/
# Generate Reference images
- run: pip install --user -U tox codecov tox-pypi-filter
- run: tox -- --mpl-generate-path=/home/circleci/sunpy-figure-tests/figures/$TOXENV | tee toxlog
- run: pip install --user -U tox tox-pypi-filter
- run: rm -rf /home/circleci/sunpy-figure-tests/figures/$TOXENV/*
- run: tox -v -- --mpl-generate-path=/home/circleci/sunpy-figure-tests/figures/$TOXENV | tee toxlog
- run: |
hashlib=$(grep "^figure_hashes.*\.json$" toxlog)
cp ./ndcube/visualization/tests/$hashlib /home/circleci/sunpy-figure-tests/figures/$TOXENV/
Expand All @@ -87,25 +91,26 @@ jobs:
workflows:
version: 2

figure-tests:
jobs:
- figure:
name: << matrix.jobname >>
matrix:
parameters:
jobname:
- "py38-figure"
- "py39-figure-devdeps"
- "py310-figure"
- "py310-figure-devdeps"

- deploy-reference-images:
name: baseline-<< matrix.jobname >>
matrix:
parameters:
jobname:
- "py38-figure"
- "py39-figure-devdeps"
- "py310-figure"
- "py310-figure-devdeps"
requires:
- "py38-figure"
- "py39-figure-devdeps"
- << matrix.jobname >>
filters:
branches:
only:
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: CI
on:
push:
branches:
- '*'
- 'main'
- '*.*'
- '!*backport*'
tags:
- 'v*'
Expand All @@ -27,19 +28,20 @@ jobs:
coverage: codecov
toxdeps: tox-pypi-filter
envs: |
- linux: py310
- linux: py311
test:
needs: [core]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
default_python: '3.9'
submodules: false
coverage: codecov
toxdeps: tox-pypi-filter
envs: |
- macos: py38
- macos: py310
- windows: py39
- linux: py38-oldestdeps
- linux: py39-oldestdeps
- linux: build_docs
posargs: ''
pytest: false
Expand All @@ -49,15 +51,19 @@ jobs:
- graphviz
cron:
if: github.event_name == 'workflow_dispatch'
if: |
github.event_name == 'workflow_dispatch' || (
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'Run cron CI')
)
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
default_python: '3.8'
default_python: '3.9'
submodules: false
coverage: codecov
toxdeps: tox-pypi-filter
envs: |
- linux: py39-devdeps
- linux: py311-devdeps
- linux: py39-conda
libraries: ''
Expand All @@ -71,6 +77,7 @@ jobs:
needs: [test]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1
with:
python-version: '3.9'
test_extras: 'dev'
test_command: 'pytest -p no:warnings --doctest-rst -m "not mpl_image_compare" --pyargs ndcube'
submodules: false
Expand All @@ -88,3 +95,4 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
homeserver: ${{ secrets.matrix_homeserver }}
roomid: '!TWSJXVpyflnZOzmSQz:matrix.org'
ignore_pattern: '.*Load tox.*'
4 changes: 2 additions & 2 deletions .github/workflows/scheduled_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ on:
# │ │ ┌───────── day of the month (1 - 31)
# │ │ │ ┌───────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT)
- cron: '0 7 * * *' # Every day at 07:00 UTC
- cron: '0 7 * * 1' # Every day at 07:00 UTC

jobs:
dispatch_workflows:
runs-on: ubuntu-latest
steps:
- run: gh workflow run ci.yml --repo sunpy/ndcube --ref main
- run: gh workflow run ci.yml --repo sunpy/ndcube --ref 2.0
- run: gh workflow run ci.yml --repo sunpy/ndcube --ref 2.1
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ ndcube/_compiler.c
ndcube/_version.py
docs/_build
docs/generated
docs/api/
docs/api
examples/**/*.asdf
examples/**/*.csv
figure_test_images*
Expand Down
6 changes: 6 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ Aoife Maria Ryan <[email protected]> aoife <[email protected]>
Baptiste Pellorce <[email protected]> Baptiste PELLORCE <[email protected]>
Baptiste Pellorce <[email protected]> Baptiste Pellorce <37335327+BaptistePellorceAstro@users.noreply.github.com>
Yash Sharma <[email protected]> Yash <[email protected]>
Laura Hayes <[email protected]> hayesla <[email protected]>
Marcus Hughes <[email protected]> jmbhughes <[email protected]>
Ricky O'Steen <[email protected]> Ricky O'Steen <[email protected]>
Kris Stern <[email protected]> Kris Stern <[email protected]>
Matthew J. West <[email protected]> Dr Matthieu Wes <[email protected]>
Will Barnes <[email protected]> Will Barnes <[email protected]>
95 changes: 26 additions & 69 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,77 +1,23 @@
repos:
# The warnings/errors we check for here are:
# E101 - mix of tabs and spaces
# E11 - Fix indentation.
# E111 - 4 spaces per indentation level
# E112 - 4 spaces per indentation level
# E113 - 4 spaces per indentation level
# E121 - Fix indentation to be a multiple of four.
# E122 - Add absent indentation for hanging indentation.
# E123 - Align closing bracket to match opening bracket.
# E124 - Align closing bracket to match visual indentation.
# E125 - Indent to distinguish line from next logical line.
# E126 - Fix over-indented hanging indentation.
# E127 - Fix visual indentation.
# E128 - Fix visual indentation.
# E129 - Fix visual indentation.
# E131 - Fix hanging indent for unaligned continuation line.
# E133 - Fix missing indentation for closing bracket.
# E20 - Remove extraneous whitespace.
# E211 - Remove extraneous whitespace.
# E231 - Add missing whitespace.
# E241 - Fix extraneous whitespace around keywords.
# E242 - Remove extraneous whitespace around operator.
# E251 - Remove whitespace around parameter '=' sign.
# E252 - Missing whitespace around parameter equals.
# E26 - Fix spacing after comment hash for inline comments.
# E265 - Fix spacing after comment hash for block comments.
# E266 - Fix too many leading '#' for block comments.
# E27 - Fix extraneous whitespace around keywords.
# E301 - Add missing blank line.
# E302 - Add missing 2 blank lines.
# E303 - Remove extra blank lines.
# E304 - Remove blank line following function decorator.
# E305 - expected 2 blank lines after class or function definition
# E305 - Expected 2 blank lines after end of function or class.
# E306 - expected 1 blank line before a nested definition
# E306 - Expected 1 blank line before a nested definition.
# E401 - Put imports on separate lines.
# E402 - Fix module level import not at top of file
# E502 - Remove extraneous escape of newline.
# E701 - Put colon-separated compound statement on separate lines.
# E711 - Fix comparison with None.
# E712 - Fix comparison with boolean.
# E713 - Use 'not in' for test for membership.
# E714 - Use 'is not' test for object identity.
# E722 - Fix bare except.
# E731 - Use a def when use do not assign a lambda expression.
# The warnings/errors we check for here are:
# E901 - SyntaxError or IndentationError
# E902 - IOError
# F822 - undefined name in __all__
# F823 - local variable name referenced before assignment
# W291 - Remove trailing whitespace.
# W292 - Add a single newline at the end of the file.
# W293 - Remove trailing whitespace on blank line.
# W391 - Remove trailing blank lines.
# W601 - Use "in" rather than "has_key()".
# W602 - Fix deprecated form of raising exception.
# W603 - Use "!=" instead of "<>"
# W604 - Use "repr()" instead of backticks.
# W605 - Fix invalid escape sequence 'x'.
# W690 - Fix various deprecated code (via lib2to3).
# Others are taken care of by autopep8
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 7.0.0
hooks:
- id: flake8
args:
[
"--count",
"--select",
"E101,E11,E111,E112,E113,E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E133,E20,E211,E231,E241,E242,E251,E252,E26,E265,E266,E27,E301,E302,E303,E304,E305,E306,E401,E402,E502,E701,E711,E712,E713,E714,E722,E731,E901,E902,F822,F823,W191,W291,W292,W293,W391,W601,W602,W603,W604,W605,W690",
"E901,E902,F822,F823",
]
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|__init__.py)$"
- repo: https://github.com/myint/autoflake
rev: v1.4
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|.rst|.md)$"
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.1
hooks:
- id: autoflake
args:
Expand All @@ -80,27 +26,38 @@ repos:
"--remove-all-unused-imports",
"--remove-unused-variable",
]
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|__init__.py|sunpy/extern|docs/conf.py)$"
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|.rst|.md|__init__.py)$"
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort
args: ["--sp", "setup.cfg"]
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|cm/__init__.py|sunpy/extern|docs/conf.py)$"
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|.rst|.md)$"
- repo: https://github.com/hhatto/autopep8
rev: v2.0.4
hooks:
- id: autopep8
args: ["--in-place","--max-line-length", "200"]
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|.rst|.md)$"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.5.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: trailing-whitespace
exclude: ".*(.fits|.fts|.fit|.txt)$"
exclude: ".*(.fits|.fts|.fit|.header|.txt)$"
- id: check-yaml
- id: debug-statements
- id: check-added-large-files
args: ['--enforce-all','--maxkb=1054']
- id: end-of-file-fixer
exclude: ".*(.fits|.fts|.fit|.txt|tca.*)$"
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*)$"
- id: mixed-line-ending
exclude: ".*(.fits|.fts|.fit|.txt|tca.*)$"

exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*)$"
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args: ['--config setup.cfg']
ci:
autofix_prs: false
18 changes: 13 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

build:
os: ubuntu-22.04
tools:
python: "mambaforge-4.10"
jobs:
pre_install:
- git update-index --assume-unchanged .rtd-environment.yml docs/conf.py

conda:
environment: .rtd-environment.yml

sphinx:
builder: html
configuration: docs/conf.py
Expand All @@ -13,5 +20,6 @@ python:
install:
- method: pip
extra_requirements:
- dev
- all
- docs
path: .
7 changes: 7 additions & 0 deletions .rtd-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: rtd_ndcube
channels:
- conda-forge
dependencies:
- python=3.11
- pip
- graphviz!=2.42.*,!=2.43.*
4 changes: 2 additions & 2 deletions .sunpy-template.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
default_context:
package_name: ndcube
module_name: ndcube
short_description: A package for multi-dimensional contiguious and non-contiguious coordinate aware arrays.
short_description: A package for multi-dimensional contiguous and non-contiguous coordinate aware arrays.
author_name: The SunPy Community
author_email: [email protected]
license: BSD 2-Clause
project_url: http://docs.sunpy.org/projects/ndcube/
github_repo: sunpy/ndcube
minimum_python_version: 3.7
minimum_python_version: 3.9
use_compiled_extensions: n
include_example_code: n
_provide_setuppy_fallback: y
Loading

0 comments on commit 677738f

Please sign in to comment.