Skip to content

Commit c4d1174

Browse files
authored
Merge pull request #58 from sunpy/changelog
2 parents 30b530f + cff8f6b commit c4d1174

File tree

12 files changed

+87
-60
lines changed

12 files changed

+87
-60
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,25 @@ repos:
6060
# W605 - Fix invalid escape sequence 'x'.
6161
# W690 - Fix various deprecated code (via lib2to3).
6262
- repo: https://gitlab.com/pycqa/flake8
63-
rev: 3.8.4
63+
rev: 3.9.2
6464
hooks:
6565
- id: flake8
6666
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']
67-
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md)$"
67+
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|drms/__init__.py)$"
6868
- repo: https://github.com/myint/autoflake
6969
rev: v1.4
7070
hooks:
7171
- id: autoflake
7272
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']
73-
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|__init__.py|docs/conf.py)$"
73+
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|__init__.py|docs/conf.py|drms/__init__.py)$"
7474
- repo: https://github.com/timothycrosley/isort
75-
rev: 5.7.0
75+
rev: 5.8.0
7676
hooks:
7777
- id: isort
7878
args: ['--sp','setup.cfg']
79-
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|docs/conf.py)$"
79+
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|docs/conf.py|drms/__init__.py)$"
8080
- repo: https://github.com/pre-commit/pre-commit-hooks
81-
rev: v3.4.0
81+
rev: v4.0.0
8282
hooks:
8383
- id: check-ast
8484
- id: check-case-conflict

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ version: 2
77
sphinx:
88
builder: html
99
configuration: docs/conf.py
10-
fail_on_warning: false
10+
fail_on_warning: true
1111

1212
python:
1313
install:

CHANGELOG.rst

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1-
Drms v0.6.1 (2021-01-23)
2-
========================
1+
0.6.2 (2021-05-15)
2+
==================
3+
4+
Trivial
5+
-------
6+
7+
- Tidy up of internal code that has no user facing changes.
8+
9+
10+
0.6.1 (2021-01-23)
11+
==================
312

413
Bug Fixes
514
---------
615

716
- Fixed issue with downloads not having the primekeys substituted with their correct values in downloaded filenames. (`#52 <https://github.com/sunpy/drms/pull/52>`__)
817

918

10-
drms v0.6.0 (2020-11-01)
11-
========================
19+
0.6.0 (2020-11-01)
20+
==================
1221

1322
Improved Documentation
1423
----------------------

MANIFEST.in

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
# Exclude specific files
22
# All files which are tracked by git and not explicitly excluded here are included by setuptools_scm
33
exclude .codecov.yaml
4+
exclude .mailmap
45
exclude .editorconfig
56
exclude .gitattributes
67
exclude .gitignore
8+
exclude .pep8speaks.yml
79
exclude .pre-commit-config.yaml
10+
exclude .test_package_pins.txt
11+
exclude .zenodo.json
812
exclude azure-pipelines.yml
913
exclude readthedocs.yml
14+
exclude rtd-environment.yml
15+
16+
# Prune folders
1017
prune paper
1118
prune changelog
1219

13-
# This subpckage is only used in development checkouts and should not be
14-
# included in built tarballs
20+
# This subpackage is only used in development checkouts and should not be included in built tarballs
1521
prune drms/_dev
16-
prune docs/_build
17-
prune build
18-
global-exclude *.pyc *.o

azure-pipelines.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ schedules:
55
displayName: At 00:00 on Sunday
66
branches:
77
include:
8-
- master
8+
- main
99
always: true
1010

11+
pr:
12+
autoCancel: true
13+
1114
resources:
1215
repositories:
1316
- repository: OpenAstronomy
@@ -30,9 +33,6 @@ trigger:
3033
- '*pre*'
3134
- '*post*'
3235

33-
pr:
34-
autoCancel: true
35-
3636
stages:
3737
- stage: FirstPhaseTests
3838
displayName: Core Tests
@@ -43,14 +43,11 @@ stages:
4343
submodules: false
4444
coverage: codecov
4545
toxdeps: tox-pypi-filter
46-
posargs: -n=1
47-
4846
envs:
4947
- linux: codestyle
5048
name: style_check
5149
pytest: false
5250
libraries: {}
53-
5451
- linux: py38
5552

5653
- stage: SecondPhaseTests
@@ -63,21 +60,12 @@ stages:
6360
submodules: false
6461
coverage: codecov
6562
toxdeps: tox-pypi-filter
66-
posargs: -n=1
67-
6863
libraries:
6964
apt:
7065
- graphviz
71-
7266
envs:
7367
- macos: py37
74-
7568
- windows: py39
76-
77-
- linux: build_docs
78-
posargs: " "
79-
pytest: false
80-
8169
- linux: py38-online
8270

8371
- stage: ThirdPhaseTests
@@ -90,13 +78,11 @@ stages:
9078
submodules: false
9179
coverage: codecov
9280
toxdeps: tox-pypi-filter
93-
posargs: -n=1
94-
9581
envs:
9682
- linux: py38-sunpy
9783

98-
# On branches which aren't master, and not Pull Requests, build the wheels but only upload them on tags
99-
- ${{ if and(ne(variables['Build.Reason'], 'PullRequest'), or(ne(variables['Build.SourceBranchName'], 'master'), eq(variables['Build.Reason'], 'Schedule'), eq(variables['Build.Reason'], 'Manual'))) }}:
84+
# On branches which aren't main, and not Pull Requests, build the wheels but only upload them on tags
85+
- ${{ if and(ne(variables['Build.Reason'], 'PullRequest'), or(ne(variables['Build.SourceBranchName'], 'main'), eq(variables['Build.Reason'], 'Schedule'), eq(variables['Build.Reason'], 'Manual'))) }}:
10086
- stage: Release
10187
dependsOn: SecondPhaseTests
10288
jobs:

docs/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
'sphinx.ext.napoleon',
3838
'sphinx.ext.todo',
3939
'sphinx.ext.viewcode',
40-
'sunpy.util.sphinx.changelog',
40+
'sphinx_changelog',
4141
]
4242
numpydoc_show_class_members = False
4343

@@ -112,7 +112,7 @@
112112
]
113113

114114
# -- Sphinx Gallery ------------------------------------------------------------
115-
from sphinx_gallery.sorting import ExampleTitleSortKey # NOQA
115+
from sphinx_gallery.sorting import ExampleTitleSortKey
116116

117117
sphinx_gallery_conf = {
118118
'backreferences_dir': os.path.join('generated', 'modules'),
@@ -123,7 +123,8 @@
123123
# Comes from the theme.
124124
'default_thumb_file': os.path.join(html_static_path[0], 'img', 'sunpy_icon_128x128.png'),
125125
'abort_on_example_error': False,
126-
'plot_gallery': 'True',
126+
'only_warn_on_example_error': True,
127+
'plot_gallery': True,
127128
'remove_config_comments': True,
128129
'doc_module': ('sunpy'),
129130
}

docs/whatsnew/changelog.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@
44
Full Changelog
55
**************
66

7-
.. include:: ../../CHANGELOG.rst
7+
.. changelog::
8+
:towncrier: ../../
9+
:towncrier-skip-if-empty:
10+
:changelog_file: ../../CHANGELOG.rst

drms/__init__.py

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,29 @@
22
drms
33
====
44
5-
Access HMI, AIA and MDI data with Python
5+
The drms library provides an easy-to-use interface for accessing HMI, AIA and MDI data with Python.
6+
It uses the publicly accessible JSOC DRMS server by default, but can also be used with local NetDRMS sites.
7+
More information, including a detailed tutorial, is available in the Documentation.
8+
9+
* Homepage: https://github.com/sunpy/drms
10+
* Documentation: https://docs.sunpy.org/projects/drms/en/stable/
611
"""
712

813
import os
14+
import sys
15+
16+
# Enforce Python version check during package import.
17+
# Must be done before any drms imports
18+
__minimum_python_version__ = "3.7"
19+
20+
class UnsupportedPythonError(Exception):
21+
"""Running on an unsupported version of Python."""
922

10-
from .client import * # NOQA
11-
from .config import * # NOQA
12-
from .exceptions import * # NOQA
13-
from .json import * # NOQA
14-
from .utils import * # NOQA
15-
from .version import version as __version__ # NOQA
23+
24+
if sys.version_info < tuple(int(val) for val in __minimum_python_version__.split('.')):
25+
# This has to be .format to keep backwards compatibly.
26+
raise UnsupportedPythonError(
27+
"sunpy does not support Python < {}".format(__minimum_python_version__))
1628

1729

1830
def _get_bibtex():
@@ -31,5 +43,12 @@ def _get_bibtex():
3143
ref = textwrap.dedent('\n'.join(lines))
3244
return ref
3345

34-
3546
__citation__ = __bibtex__ = _get_bibtex()
47+
48+
from .version import version as __version__
49+
# DRMS imports to collapse the namespace
50+
from .client import *
51+
from .config import *
52+
from .exceptions import *
53+
from .json import *
54+
from .utils import *

paper/paper.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Each data collection in JSOC (for example, AIA images of the solar corona in 171
4848

4949
![Left: Total unsigned flux and mean current helicity of HMI Active Region Patch (HARP) Number 4315 during its disk passage; the dashed orange line marks the central meridian crossing of the active region. Right: Continuum intensity map and magnetic field map at the time of the central meridian crossing.](sharp.pdf)
5050

51-
The left two panels of Figure 1 show a small selection of the available metadata which characterize a particular solar active region. From the steep gradient in the total unsigned magnetic flux and the increasing area of active pixels, it is directly evident, without inspecting any image data, that this is a strong emerging active region. The right two panels show a selection of image data corresponding to the time indicated by the dashed orange line in the left two panels. Figure 1 was created from metadata and image data obtained from the JSOC DRMS server using the `drms` package. A Python [script](https://github.com/sunpy/drms/blob/master/examples/create_joss_figure.py) that creates this figure is available in the [examples](https://github.com/sunpy/drms/tree/master/examples) directory of the `drms` source code.
51+
The left two panels of Figure 1 show a small selection of the available metadata which characterize a particular solar active region. From the steep gradient in the total unsigned magnetic flux and the increasing area of active pixels, it is directly evident, without inspecting any image data, that this is a strong emerging active region. The right two panels show a selection of image data corresponding to the time indicated by the dashed orange line in the left two panels. Figure 1 was created from metadata and image data obtained from the JSOC DRMS server using the `drms` package. A Python [script](https://github.com/sunpy/drms/blob/main/examples/create_joss_figure.py) that creates this figure is available in the [examples](https://github.com/sunpy/drms/tree/main/examples) directory of the `drms` source code.
5252

5353

5454
# Acknowledgements

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@ build-backend = 'setuptools.build_meta'
1515
enabled = true
1616
verify_pr_number = true
1717
changelog_skip_label = "No Changelog Entry Needed"
18-
help_url = "https://github.com/sunpy/drms/blob/master/changelog/README.rst"
19-
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/drms/blob/master/changelog/README.rst)."
20-
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/drms/blob/master/changelog/README.rst)"
18+
help_url = "https://github.com/sunpy/drms/blob/main/changelog/README.rst"
19+
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/drms/blob/main/changelog/README.rst)."
20+
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/drms/blob/main/changelog/README.rst)"
2121
number_incorrect_long = "The number in the changelog file you added does not match the number of this pull request. Please rename the file."
2222

2323
[tool.towncrier]
2424
package = "drms"
2525
filename = "CHANGELOG.rst"
2626
directory = "changelog/"
2727
issue_format = "`#{issue} <https://github.com/sunpy/drms/pull/{issue}>`__"
28+
title_format = "{version} ({project_date})"
2829

2930
[[tool.towncrier.type]]
3031
directory = "breaking"

setup.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[metadata]
22
name = drms
33
provides = drms
4-
description = "Access HMI, AIA and MDI data with Python"
4+
description = "Access HMI, AIA and MDI data with Python from the public JSOC DRMS server"
55
long_description = file: README.rst
66
long_description_content_type = text/x-rst
77
author = The SunPy Community
@@ -23,6 +23,7 @@ classifiers =
2323
Programming Language :: Python :: 3
2424
Programming Language :: Python :: 3.7
2525
Programming Language :: Python :: 3.8
26+
Programming Language :: Python :: 3.9
2627
Topic :: Scientific/Engineering :: Astronomy
2728
Topic :: Scientific/Engineering :: Physics
2829

@@ -47,9 +48,8 @@ docs =
4748
sphinx
4849
sphinx-automodapi
4950
sphinx-gallery
50-
sunpy # We need the changelog directive.
51+
sphinx-changelog
5152
sunpy-sphinx-theme
52-
towncrier
5353

5454
[options.packages.find]
5555
exclude = drms._dev

tox.ini

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ requires =
1010
tox-pypi-filter >= 0.12
1111

1212
[testenv]
13-
pypi_filter = https://raw.githubusercontent.com/sunpy/sunpy/master/.test_package_pins.txt
13+
pypi_filter = https://raw.githubusercontent.com/sunpy/sunpy/main/.test_package_pins.txt
1414
# Run the tests in a temporary directory to make sure that we don't import
1515
# drms from the source tree
1616
changedir = .tmp/{envname}
@@ -25,6 +25,7 @@ changedir = .tmp/{envname}
2525
description =
2626
run tests
2727
online: that require remote data
28+
sunpy: run the sunpy jsoc tests to ensure we dont break them
2829
setenv =
2930
MPLBACKEND = agg
3031
COLUMNS = 180
@@ -39,10 +40,14 @@ deps =
3940
# These are specific online extras we use to run the online tests.
4041
online: pytest-rerunfailures
4142
online: pytest-timeout
42-
# We want to run the sunpy jsoc tests
43-
sunpy: sunpy[all]
44-
# All our tests run in parallel which this plugin allows us to.
45-
pytest-xdist
43+
sunpy: git+https://github.com/sunpy/sunpy
44+
# These are specific extras we use to run the sunpy tests.
45+
sunpy: beautifulsoup4
46+
sunpy: pytest-mock
47+
sunpy: python-dateutil
48+
sunpy: scipy
49+
sunpy: tqdm
50+
sunpy: zeep
4651
# The following indicates which extras_require from setup.cfg will be installed
4752
# dev is special in that it installs everything
4853
extras =

0 commit comments

Comments
 (0)