Skip to content

Commit e64cca3

Browse files
authored
CI fix (#45)
1 parent b815f60 commit e64cca3

File tree

22 files changed

+1520
-1009
lines changed

22 files changed

+1520
-1009
lines changed

CHANGELOG.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
Sunkit_Instruments v0.2.0 (2021-02-13)
2+
======================================
3+
4+
Features
5+
--------
6+
7+
- Add :func:`sunkit_instruments.rhessi.imagecube2map` function to extract `sunpy.map.MapSequence` objects from a RHESSI 4D image cube. (`#35 <https://github.com/sunpy/sunkit-instruments/pull/35>`__)
8+
9+
110
Sunkit_Instruments 0.1.0 (2020-09-30)
211
=====================================
312

changelog/35.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/conf.py

Lines changed: 48 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# Configuration file for the Sphinx documentation builder.
43
#
@@ -10,31 +9,32 @@
109
# -- Project information -----------------------------------------------------
1110

1211
from sunkit_instruments import __version__
13-
project = 'sunkit_instruments'
14-
copyright = '2020, The SunPy Developers'
15-
author = 'The SunPy Developers'
12+
13+
project = "sunkit_instruments"
14+
copyright = "2020, The SunPy Developers"
15+
author = "The SunPy Developers"
1616

1717
# The full version, including alpha/beta/rc tags
1818
release = __version__
19-
is_development = '.dev' in __version__
19+
is_development = ".dev" in __version__
2020

2121
# -- General configuration ---------------------------------------------------
2222

2323
# Add any Sphinx extension module names here, as strings. They can be
2424
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2525
# ones.
2626
extensions = [
27-
'sphinx.ext.autodoc',
28-
'sphinx.ext.intersphinx',
29-
'sphinx.ext.todo',
30-
'sphinx.ext.coverage',
31-
'sphinx.ext.inheritance_diagram',
32-
'sphinx.ext.viewcode',
33-
'sphinx.ext.napoleon',
34-
'sphinx.ext.doctest',
35-
'sphinx.ext.mathjax',
36-
'sphinx_automodapi.automodapi',
37-
'sphinx_automodapi.smart_resolver',
27+
"sphinx.ext.autodoc",
28+
"sphinx.ext.intersphinx",
29+
"sphinx.ext.todo",
30+
"sphinx.ext.coverage",
31+
"sphinx.ext.inheritance_diagram",
32+
"sphinx.ext.viewcode",
33+
"sphinx.ext.napoleon",
34+
"sphinx.ext.doctest",
35+
"sphinx.ext.mathjax",
36+
"sphinx_automodapi.automodapi",
37+
"sphinx_automodapi.smart_resolver",
3838
]
3939

4040
# Add any paths that contain templates here, relative to this directory.
@@ -43,33 +43,42 @@
4343
# List of patterns, relative to source directory, that match files and
4444
# directories to ignore when looking for source files.
4545
# This pattern also affects html_static_path and html_extra_path.
46-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
46+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
4747

4848
# The suffix(es) of source filenames.
4949
# You can specify multiple suffix as a list of string:
50-
source_suffix = '.rst'
50+
source_suffix = ".rst"
5151

5252
# The master toctree document.
53-
master_doc = 'index'
53+
master_doc = "index"
5454

5555
# The reST default role (used for this markup: `text`) to use for all
5656
# documents. Set to the "smart" one.
57-
default_role = 'obj'
57+
default_role = "obj"
5858

5959
# -- Options for intersphinx extension ---------------------------------------
6060

6161
# Example configuration for intersphinx: refer to the Python standard library.
6262
intersphinx_mapping = {
63-
'python': ('https://docs.python.org/3/',
64-
(None, 'http://data.astropy.org/intersphinx/python3.inv')),
65-
'numpy': ('https://docs.scipy.org/doc/numpy/',
66-
(None, 'http://data.astropy.org/intersphinx/numpy.inv')),
67-
'scipy': ('https://docs.scipy.org/doc/scipy/reference/',
68-
(None, 'http://data.astropy.org/intersphinx/scipy.inv')),
69-
'matplotlib': ('https://matplotlib.org/',
70-
(None, 'http://data.astropy.org/intersphinx/matplotlib.inv')),
71-
'astropy': ('http://docs.astropy.org/en/stable/', None),
72-
'sunpy': ('https://docs.sunpy.org/en/stable/', None)}
63+
"python": (
64+
"https://docs.python.org/3/",
65+
(None, "http://data.astropy.org/intersphinx/python3.inv"),
66+
),
67+
"numpy": (
68+
"https://docs.scipy.org/doc/numpy/",
69+
(None, "http://data.astropy.org/intersphinx/numpy.inv"),
70+
),
71+
"scipy": (
72+
"https://docs.scipy.org/doc/scipy/reference/",
73+
(None, "http://data.astropy.org/intersphinx/scipy.inv"),
74+
),
75+
"matplotlib": (
76+
"https://matplotlib.org/",
77+
(None, "http://data.astropy.org/intersphinx/matplotlib.inv"),
78+
),
79+
"astropy": ("http://docs.astropy.org/en/stable/", None),
80+
"sunpy": ("https://docs.sunpy.org/en/stable/", None),
81+
}
7382

7483
# -- Options for HTML output -------------------------------------------------
7584

@@ -79,7 +88,7 @@
7988
try:
8089
from sunpy_sphinx_theme.conf import *
8190
except ImportError:
82-
html_theme = 'default'
91+
html_theme = "default"
8392

8493

8594
# Add any paths that contain custom static files (such as style sheets) here,
@@ -91,12 +100,12 @@
91100
graphviz_output_format = "svg"
92101

93102
graphviz_dot_args = [
94-
'-Nfontsize=10',
95-
'-Nfontname=Helvetica Neue, Helvetica, Arial, sans-serif',
96-
'-Efontsize=10',
97-
'-Efontname=Helvetica Neue, Helvetica, Arial, sans-serif',
98-
'-Gfontsize=10',
99-
'-Gfontname=Helvetica Neue, Helvetica, Arial, sans-serif'
103+
"-Nfontsize=10",
104+
"-Nfontname=Helvetica Neue, Helvetica, Arial, sans-serif",
105+
"-Efontsize=10",
106+
"-Efontname=Helvetica Neue, Helvetica, Arial, sans-serif",
107+
"-Gfontsize=10",
108+
"-Gfontname=Helvetica Neue, Helvetica, Arial, sans-serif",
100109
]
101110

102111

@@ -106,9 +115,10 @@
106115
target_file = os.path.abspath("./whatsnew/latest_changelog.txt")
107116
try:
108117
from sunpy.util.towncrier import generate_changelog_for_docs
118+
109119
if is_development:
110120
generate_changelog_for_docs("../", target_file)
111121
except Exception as e:
112122
print(f"Failed to add changelog to docs with error {e}.")
113123
# Make sure the file exists or else sphinx will complain.
114-
open(target_file, 'a').close()
124+
open(target_file, "a").close()

setup.cfg

Lines changed: 49 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ classifiers =
2222
Programming Language :: Python :: 3
2323
Programming Language :: Python :: 3.7
2424
Programming Language :: Python :: 3.8
25+
Programming Language :: Python :: 3.9
2526
Topic :: Scientific/Engineering :: Physics
2627

2728
[options]
@@ -36,7 +37,8 @@ install_requires =
3637
matplotlib
3738
numpy
3839
pandas
39-
sunpy[net,timeseries] >= 2.0.0
40+
scipy
41+
sunpy[net,timeseries] >= 2.1.0rc3
4042

4143
[options.extras_require]
4244
tests =
@@ -69,23 +71,60 @@ junit_family=xunit1
6971
filterwarnings =
7072
error
7173
error::sunpy.util.exceptions.SunpyDeprecationWarning
74+
# Do not fail on pytest config issues (i.e. missing plugins) but do show them
75+
always::pytest.PytestConfigWarning
7276
#
7377
# A list of warnings to ignore follows. If you add to this list, you MUST
7478
# add a comment or ideally a link to an issue that explains why the warning
7579
# is being ignored
7680
#
77-
# These warnings are raised on our CI due to something odd about numpy installation,
78-
# but don't impact the tests
79-
ignore:numpy.ufunc size changed:RuntimeWarning
80-
# See https://github.com/aio-libs/aiohttp/issues/4842
81-
ignore:"@coroutine" decorator is deprecated
81+
#
82+
# See https://github.com/pandas-dev/pandas/issues/26367; this can be
83+
# removed when our minimum pandas version is >=0.25
84+
ignore:can't resolve package from __spec__ or __package__:ImportWarning
85+
# See https://github.com/spacetelescope/asdf/issues/789
86+
ignore:direct construction of AsdfSchemaFile has been deprecated
87+
ignore:direct construction of AsdfSchemaItem has been deprecated
88+
ignore:direct construction of AsdfSchemaExampleItem has been deprecated
8289
# See https://github.com/Cadair/parfive/issues/41
83-
# Or other packages
8490
ignore:The loop argument is deprecated
91+
# This is due to dependencies building with a numpy version different from
92+
# the local installed numpy version, but should be fine
93+
# See https://github.com/numpy/numpy/issues/15748#issuecomment-598584838
94+
ignore:numpy.ufunc size changed:RuntimeWarning
95+
ignore:numpy.ndarray size changed:RuntimeWarning
8596
# See https://github.com/mvantellingen/python-zeep/issues/956
86-
ignore:defusedxml.lxml is no longer supported and will be removed in a future release.
87-
# Sunpy Timeseries Warning.
88-
ignore:Unknown units for.*
97+
ignore:defusedxml.lxml is no longer supported:DeprecationWarning
98+
# See https://github.com/aio-libs/aiohttp/issues/4842
99+
ignore:"@coroutine" decorator is deprecated
100+
# See https://github.com/spacetelescope/asdf/issues/789
101+
ignore:direct construction of AsdfSchemaFile has been deprecated
102+
ignore:direct construction of AsdfSchemaItem has been deprecated
103+
ignore:direct construction of AsdfSchemaExampleItem has been deprecated
104+
# See https://github.com/scikit-image/scikit-image/issues/4848
105+
ignore:Converting `np.inexact` or `np.floating` to a dtype is deprecated
106+
# See https://github.com/astropy/astropy/pull/10570
107+
ignore:leap-second auto-update failed
108+
# See https://github.com/astropy/extension-helpers/issues/23
109+
ignore:Distutils was imported before Setuptools
110+
# Figure tests use agg backend so show doesn't work but we use it in peek
111+
ignore:Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
112+
# Ignore doctest issues: docs/guide/tour.rst
113+
ignore:File may have been truncated*
114+
# Some tests use data that have dates in the future and ERFA does not like.
115+
ignore:ERFA function "d2dtf"*
116+
ignore:ERFA function "dtf2d"*
117+
# Currently helio makes unverified requests - this filter should be removed when
118+
# https://github.com/sunpy/sunpy/issues/4401 is fixed
119+
ignore:Unverified HTTPS request
120+
# https://github.com/astropy/astropy/issues/11272
121+
ignore:elementwise == comparison failed and returning scalar instead:FutureWarning:astropy.table
122+
# This isn't really an issue it's an annoyance, it's triggered by printing
123+
# an astropy table inside a test, which is generally only done when
124+
# CHANNEL UNITS ISSUE.
125+
ignore:Unknown units for CHANNEL.*:sunpy.util.exceptions.SunpyUserWarning:
126+
# debugging.
127+
ignore:the imp module is deprecated in favour of importlib:DeprecationWarning:ipykernel.iostream
89128

90129
[pycodestyle]
91130
max_line_length = 100

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
################################################################################
99
# Programmatically generate some extras combos.
1010
################################################################################
11-
extras = read_configuration("setup.cfg")['options']['extras_require']
11+
extras = read_configuration("setup.cfg")["options"]["extras_require"]
1212

1313
# Dev is everything
14-
extras['dev'] = list(chain(*extras.values()))
14+
extras["dev"] = list(chain(*extras.values()))
1515

1616
# All is everything but tests and docs
1717
exclude_keys = ("tests", "docs", "dev")
1818
ex_extras = dict(filter(lambda i: i[0] not in exclude_keys, extras.items()))
1919
# Concatenate all the values together for 'all'
20-
extras['all'] = list(chain.from_iterable(ex_extras.values()))
20+
extras["all"] = list(chain.from_iterable(ex_extras.values()))
2121

2222
setup(
2323
extras_require=extras,
24-
use_scm_version={'write_to': os.path.join('sunkit_instruments', '_version.py')}
24+
use_scm_version={"write_to": os.path.join("sunkit_instruments", "_version.py")},
2525
)

sunkit_instruments/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ class UnsupportedPythonError(Exception):
2121
"""
2222

2323

24-
if sys.version_info < tuple(int(val) for val in __minimum_python_version__.split('.')):
24+
if sys.version_info < tuple(int(val) for val in __minimum_python_version__.split(".")):
2525
# This has to be .format to keep backwards compatibly.
2626
raise UnsupportedPythonError(
27-
"sunkit_instruments does not support Python < {}".format(__minimum_python_version__))
27+
"sunkit_instruments does not support Python < {}".format(
28+
__minimum_python_version__
29+
)
30+
)
2831

2932
__all__ = []
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
This package contains utilities that are only used when developing drms in a
33
copy of the source repository.
4+
45
These files are not installed, and should not be assumed to exist at
56
runtime.
67
"""

sunkit_instruments/_dev/scm_version.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
try:
66
from setuptools_scm import get_version
77

8-
version = get_version(root=os.path.join('..', '..'), relative_to=__file__)
8+
version = get_version(root=os.path.join("..", ".."), relative_to=__file__)
99
except ImportError:
10-
raise ImportError('setuptools_scm not installed')
10+
raise ImportError("setuptools_scm not installed")
1111
except Exception as e:
12-
raise ValueError(f'setuptools_scm broken with {e}')
12+
raise ValueError(f"setuptools_scm broken with {e}")

sunkit_instruments/conftest.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import pytest
32

43

@@ -14,22 +13,22 @@ def sunpy_cache(mocker, tmp_path):
1413
from sunpy.data.data_manager.cache import Cache
1514
from sunpy.data.data_manager.downloader import ParfiveDownloader
1615
from sunpy.data.data_manager.storage import InMemStorage
17-
cache = Cache(
18-
ParfiveDownloader(),
19-
InMemStorage(),
20-
tmp_path,
21-
None
22-
)
16+
17+
cache = Cache(ParfiveDownloader(), InMemStorage(), tmp_path, None)
2318

2419
def add(self, url, path):
25-
self._storage.store({
26-
'url': url,
27-
'file_path': path,
28-
'file_hash': 'none', # hash doesn't matter
29-
})
20+
self._storage.store(
21+
{
22+
"url": url,
23+
"file_path": path,
24+
"file_hash": "none", # hash doesn't matter
25+
}
26+
)
27+
3028
cache.add = MethodType(add, cache)
3129

3230
def func(mocked):
3331
mocker.patch(mocked, cache)
3432
return cache
33+
3534
yield func

sunkit_instruments/data/test/__init__.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
import sunkit_instruments
1212

13-
__all__ = ['rootdir', 'file_list', 'get_test_filepath', 'test_data_filenames']
13+
__all__ = ["rootdir", "file_list", "get_test_filepath", "test_data_filenames"]
1414

1515
rootdir = os.path.join(os.path.dirname(sunkit_instruments.__file__), "data", "test")
16-
file_list = glob.glob(os.path.join(rootdir, '*.[!p]*'))
16+
file_list = glob.glob(os.path.join(rootdir, "*.[!p]*"))
1717

1818

1919
def get_test_filepath(filename, **kwargs):
@@ -35,7 +35,9 @@ def get_test_filepath(filename, **kwargs):
3535
This is a wrapper around `astropy.utils.data.get_pkg_data_filename` which
3636
sets the ``package`` kwarg to be 'sunkit_instruments.data.test`.
3737
"""
38-
return get_pkg_data_filename(filename, package="sunkit_instruments.data.test", **kwargs)
38+
return get_pkg_data_filename(
39+
filename, package="sunkit_instruments.data.test", **kwargs
40+
)
3941

4042

4143
def test_data_filenames():
@@ -50,13 +52,13 @@ def test_data_filenames():
5052
The name of all test files in ``data/test`` directory.
5153
"""
5254
test_data_filenames_list = []
53-
excludes = ['*.pyc', '*'+os.path.sep+'__*__', '*.py']
54-
excludes = r'|'.join([fnmatch.translate(x) for x in excludes]) or r'$.'
55+
excludes = ["*.pyc", "*" + os.path.sep + "__*__", "*.py"]
56+
excludes = r"|".join([fnmatch.translate(x) for x in excludes]) or r"$."
5557

5658
for root, dirs, files in os.walk(rootdir):
5759
files = [os.path.join(root, f) for f in files]
5860
files = [f for f in files if not re.match(excludes, f)]
59-
files = [file.replace(rootdir + os.path.sep, '') for file in files]
61+
files = [file.replace(rootdir + os.path.sep, "") for file in files]
6062
test_data_filenames_list.extend(files)
6163

6264
return test_data_filenames_list

0 commit comments

Comments
 (0)