Skip to content
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ examples/**/*.csv
# This is incase you run the figure tests
figure_test_images*
tags
sunkit_instruments/version.py
sunkit_instruments/_version.py

### Pycharm(?)
.idea
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ repos:
# W605 - Fix invalid escape sequence 'x'.
# W690 - Fix various deprecated code (via lib2to3).
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
rev: 3.8.4
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']
Expand All @@ -72,13 +72,13 @@ repos:
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|docs/conf.py)$"
- repo: https://github.com/timothycrosley/isort
rev: 5.5.2
rev: 5.6.4
hooks:
- id: isort
args: ['--sp','setup.cfg']
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|docs/conf.py)$"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v3.3.0
hooks:
- id: check-ast
- id: check-case-conflict
Expand Down
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ prune docs/_build
prune docs/api

global-exclude *.pyc *.o

# This subpackage is only used in development checkouts and should not be
# included in built tarballs
prune sunkit_instruments/_dev
145 changes: 95 additions & 50 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,53 +30,98 @@ trigger:
- '*pre*'
- '*post*'

jobs:
- template: run-tox-env.yml@OpenAstronomy
parameters:
submodules: false
coverage: codecov
toxdeps: tox-pypi-filter
posargs: -n=4
libraries:
apt:
- graphviz

envs:
- macos: py38
name: py38_test

- windows: py37
name: py37_test

- linux: py38-online
name: py38_test_online
posargs: -n=1

- linux: codestyle
name: python_codestyle
pytest: false

- linux: py37-oldestdeps
name: py37_test_oldestdeps

- linux: py38-devdeps

# On branches which aren't master, and not Pull Requests, build the wheels but only upload them on tags
- ${{ if and(ne(variables['Build.Reason'], 'PullRequest'), not(contains(variables['Build.SourceBranch'], 'master'))) }}:
- template: publish.yml@OpenAstronomy
parameters:
# Only Upload to PyPI on tags
${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
pypi_connection_name : 'PyPI'
test_extras: 'dev'
test_command: 'pytest -p no:warnings --doctest-rst -m "not figure" --pyargs sunkit_instruments'
submodules: false

targets:
- wheels_universal
- sdist
dependsOn:
- py37_test
- py38_test
- py38_test_online
- py37_test_oldestdeps
pr:
autoCancel: true

stages:
- stage: FirstPhaseTests
displayName: Core Tests
jobs:
- template: run-tox-env.yml@OpenAstronomy
parameters:
default_python: '3.8'
submodules: false
coverage: codecov
toxdeps: tox-pypi-filter
posargs: -n=4

envs:
- linux: codestyle
name: style_check
pytest: false
libraries: {}

- linux: py38

- stage: SecondPhaseTests
displayName: Stage 2 Tests
dependsOn: FirstPhaseTests
jobs:
- template: run-tox-env.yml@OpenAstronomy
parameters:
default_python: '3.8'
submodules: false
coverage: codecov
toxdeps: tox-pypi-filter
posargs: -n=4

libraries:
apt:
- graphviz

envs:
- macos: py37

- windows: py39

- linux: build_docs
posargs: " "
pytest: false

- linux: py38-online

- linux: py37-oldestdeps


- ${{ if or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Build.Reason'], 'Manual')) }}:
- stage: CronTests
displayName: Cron Tests
dependsOn: [] # Don't wait on other stages
jobs:
- template: run-tox-env.yml@OpenAstronomy
parameters:
default_python: '3.8'
submodules: false
coverage: codecov
toxdeps: tox-pypi-filter
posargs: -n=4

libraries:
yum:
- openssl-devel
- freetype-devel
- libpng-devel
- hdf5-devel

envs:
- linux32: py38-32bit
manylinux_image: manylinux2010_i686

- linux: py38-devdeps

# On branches which aren't master, and not Pull Requests, build the wheels but only upload them on tags
- ${{ if and(ne(variables['Build.Reason'], 'PullRequest'), or(ne(variables['Build.SourceBranchName'], 'master'), eq(variables['Build.Reason'], 'Schedule'), eq(variables['Build.Reason'], 'Manual'))) }}:
- stage: Release
dependsOn: SecondPhaseTests
jobs:
- template: publish.yml@OpenAstronomy
parameters:
# Only Upload to PyPI on tags
${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
pypi_connection_name : 'PyPI'
test_extras: 'dev'
test_command: 'pytest -p no:warnings --doctest-rst --pyargs sunkit_instruments'
submodules: false
targets:
- wheels_universal
- sdist
2 changes: 1 addition & 1 deletion docs/code_ref/goes_xrs.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.. automodapi:: sunkit_instruments.fermi
.. automodapi:: sunkit_instruments.goes_xrs
4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ build-backend = 'setuptools.build_meta'

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

[ tool.gilesbot.milestones ]
enabled = true
missing_message_long = "This pull request does not have a milestone assigned to it. Only maintainers can change this, so you don't need to worry about it. :smile:"

[tool.towncrier]
package = "sunkit_instruments"
filename = "CHANGELOG.rst"
Expand Down
48 changes: 24 additions & 24 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ url = https://sunpy.org
edit_on_github = True
github_project = sunpy/sunkit_instruments
platform = any
keywords = solar physics, solar, science, sun, wcs, coordinates
keywords = solar physics, solar, science, telescope, instrumentation
classifiers =
Intended Audience :: Science/Research
License :: OSI Approved :: BSD License
Expand All @@ -32,11 +32,11 @@ include_package_data = True
setup_requires =
setuptools_scm
install_requires =
astropy
matplotlib
numpy
pandas
sunpy[net] >= 2.0.0
matplotlib
astropy
sunpy[net,timeseries] >= 2.0.0

[options.extras_require]
tests =
Expand All @@ -47,22 +47,22 @@ tests =
docs =
sphinx
sphinx-automodapi
towncrier
sunpy-sphinx-theme
towncrier

[options.packages.find]
exclude = sunkit_instruments._dev

[tool:pytest]
minversion = 3.0
testpaths = "sunkit_instruments" "docs"
norecursedirs = ".tox" "build" "docs[\/]_build" "docs[\/]generated" "*.egg-info" "examples" ".jupyter" ".history" "tools"
norecursedirs = ".tox" "build" "docs[\/]_build" "docs[\/]generated" "*.egg-info" "examples" ".history" "sunkit_instruments/_dev"
doctest_plus = enabled
doctest_optionflags = NORMALIZE_WHITESPACE FLOAT_CMP ELLIPSIS
addopts = -rsa -vvv --doctest-rst --doctest-ignore-import-errors
markers =
remote_data: marks this test function as needing remote data.
online: marks this test function as needing online connectivity.
figure: marks this test function as using hash-based Matplotlib figure verification. This mark is not meant to be directly applied, but is instead automatically applied when a test function uses the @sunpy.tests.helpers.figure_test decorator.
flaky
array_compare
array_compare: compare arrays
remote_data_strict = True
# Pin junit behaviour; we might want to update this to xunit2 at some point
junit_family=xunit1
Expand Down Expand Up @@ -116,24 +116,24 @@ sections = STDLIB, THIRDPARTY, ASTROPY, FIRSTPARTY, LOCALFOLDER

[coverage:run]
omit =
sunkit_instruments/conftest.py
sunkit_instruments/cython_version*
sunkit_instruments/*setup*
sunkit_instruments/extern/*
sunkit_instruments/*/tests/*
sunkit_instruments/version*
sunkit_instruments/__init__*
sunkit_instruments/data/sample.py
sunkit_instruments/data/_sample.py
*/sunkit_instruments/__init__*
*/sunkit_instruments/*/tests/*
*/sunkit_instruments/*setup*
*/sunkit_instruments/conftest.py
*/sunkit_instruments/cython_version*
*/sunkit_instruments/*setup*
*/sunkit_instruments/data/_sample.py
*/sunkit_instruments/data/sample.py
*/sunkit_instruments/extern/*
*/sunkit_instruments/*/tests/*
*/sunkit_instruments/version*
*/sunkit_instruments/__init__*
*/sunkit_instruments/data/sample.py
*/sunkit_instruments/data/_sample.py
sunkit_instruments/__init__*
sunkit_instruments/*/tests/*
sunkit_instruments/*setup*
sunkit_instruments/conftest.py
sunkit_instruments/cython_version*
sunkit_instruments/data/_sample.py
sunkit_instruments/data/sample.py
sunkit_instruments/extern/*
sunkit_instruments/version*

[coverage:report]
exclude_lines =
Expand Down
23 changes: 4 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,6 @@

from setuptools.config import read_configuration

################################################################################
# Actual setup.py content
################################################################################

VERSION_TEMPLATE = """
# Note that we need to fall back to the hard-coded version if either
# setuptools_scm can't be imported or setuptools_scm can't determine the
# version, so we catch the generic 'Exception'.
try:
from setuptools_scm import get_version
__version__ = get_version(root='..', relative_to=__file__)
except Exception:
__version__ = '{version}'
""".lstrip()

################################################################################
# Programmatically generate some extras combos.
################################################################################
Expand All @@ -34,7 +19,7 @@
# Concatenate all the values together for 'all'
extras['all'] = list(chain.from_iterable(ex_extras.values()))

setup(extras_require=extras,
use_scm_version={'write_to': os.path.join('sunkit_instruments', 'version.py'),
'write_to_template': VERSION_TEMPLATE},
)
setup(
extras_require=extras,
use_scm_version={'write_to': os.path.join('sunkit_instruments', '_version.py')}
)
8 changes: 2 additions & 6 deletions sunkit_instruments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,11 @@
"""
import sys

from .version import version as __version__ # NOQA

# Enforce Python version check during package import.
__minimum_python_version__ = "3.7"

try:
from .version import __version__
except ImportError:
print("version.py not found, please reinstall sunkit_instruments.")
__version__ = "unknown"


class UnsupportedPythonError(Exception):
"""
Expand Down
6 changes: 6 additions & 0 deletions sunkit_instruments/_dev/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""
This package contains utilities that are only used when developing drms in a
copy of the source repository.
These files are not installed, and should not be assumed to exist at
runtime.
"""
12 changes: 12 additions & 0 deletions sunkit_instruments/_dev/scm_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Try to use setuptools_scm to get the current version; this is only used
# in development installations from the git repository.
import os.path

try:
from setuptools_scm import get_version

version = get_version(root=os.path.join('..', '..'), relative_to=__file__)
except ImportError:
raise ImportError('setuptools_scm not installed')
except Exception as e:
raise ValueError(f'setuptools_scm broken with {e}')
2 changes: 1 addition & 1 deletion sunkit_instruments/lyra/tests/test_lyra.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_split_series_using_lytaf():
assert len(split) == 4
assert is_time_equal(split[0]['subtimes'][0], parse_time((2010, 6, 13, 2, 0)))
assert is_time_equal(split[0]['subtimes'][-1], parse_time((2010, 6, 13, 2, 7, 2)))
assert is_time_equal(split[3]['subtimes'][0], parse_time((2010, 6, 13, 2, 59, 42)))
assert is_time_equal(split[3]['subtimes'][0], parse_time((2010, 6, 13, 2, 59, 41)))
assert is_time_equal(split[3]['subtimes'][-1], parse_time((2010, 6, 13, 2, 59, 58)))

# Test case when no LYTAF events found in time series.
Expand Down
Loading