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
18 changes: 0 additions & 18 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
include README.rst
include CHANGES.rst
include setup.cfg
include LICENSE.rst
include pyproject.toml

recursive-include sunkit_instruments *.pyx *.c *.pxd
recursive-include docs *
recursive-include licenses *
recursive-include cextern *
recursive-include scripts *

prune build
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
11 changes: 7 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ stages:
- template: check-skip.yml@OpenAstronomy
- template: run-tox-env.yml@OpenAstronomy
parameters:
default_python: '3.8'
default_python: '3.9'
submodules: false
coverage: codecov
libraries:
apt:
- libhdf5-dev
envs:
- linux: py39
- linux: py311

- stage: SecondPhaseTests
displayName: Stage 2 Tests
Expand All @@ -53,7 +56,7 @@ stages:
jobs:
- template: run-tox-env.yml@OpenAstronomy
parameters:
default_python: '3.8'
default_python: '3.9'
submodules: false
coverage: codecov
libraries:
Expand All @@ -74,7 +77,7 @@ stages:
jobs:
- template: run-tox-env.yml@OpenAstronomy
parameters:
default_python: '3.8'
default_python: '3.9'
submodules: false
coverage: codecov
envs:
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
os.environ["HOME"] = "/home/docs/"
os.environ["LANG"] = "C"
os.environ["LC_ALL"] = "C"
os.environ["HIDE_PARFIVE_PROGESS"] = "True"
os.environ["PARFIVE_HIDE_PROGRESS"] = "True"

# -- Non stdlib imports --------------------------------------------------------
from sunkit_instruments import __version__ # NOQA
Expand Down
9 changes: 4 additions & 5 deletions examples/plot_suvi_thematic_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from matplotlib.patches import Patch
from parfive import Downloader

from astropy.io import fits

from sunkit_instruments.suvi._variables import SOLAR_CLASS_NAME, SOLAR_COLORS
from sunkit_instruments.utils import _download_data

###############################################################################
# We start with getting the data. This is done by downloading the data from ``data.ngdc.noaa.gov``.
Expand All @@ -29,16 +29,15 @@
# Using the url:
# https://data.ngdc.noaa.gov/platforms/solar-space-observing-satellites/goes/goes16/l2/data/suvi-l2-thmap/2022/01/01/dr_suvi-l2-thmap_g16_s20220101T000000Z_e20220101T000400Z_v1-0-2.fits

urls = [
url = [
"https://data.ngdc.noaa.gov/platforms/solar-space-observing-satellites/goes/goes16/l2/data/suvi-l2-thmap/2022/01/01/dr_suvi-l2-thmap_g16_s20220101T000000Z_e20220101T000400Z_v1-0-2.fits"
]
_download_data(urls)
filename = "dr_suvi-l2-thmap_g16_s20220101T000000Z_e20220101T000400Z_v1-0-2.fits"
(file,) = Downloader.simple_download(url)

################################################################################
# First let's read a SUVI L2 Thematic Map FITS file.

with fits.open(filename) as hdu:
with fits.open(file) as hdu:
thmap_data = hdu[0].data
time_stamp = hdu[0].header["DATE-OBS"][0:19]

Expand Down
5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ long_description_content_type = text/x-rst
author = The SunPy Community
author_email = sunpy@googlegroups.com
license = BSD 3-Clause
license_file = LICENSE.rst
license_files = LICENSE.rst
url = https://sunpy.org
edit_on_github = True
github_project = sunpy/sunkit_instruments
Expand All @@ -23,6 +23,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Scientific/Engineering :: Physics

[options]
Expand Down Expand Up @@ -71,8 +72,8 @@ filterwarnings =
# is being ignored
#
#
ignore:may indicate binary incompatibility:RuntimeWarning
ignore:distutils Version classes are deprecated. Use packaging.version instead:DeprecationWarning
ignore:numpy.ndarray size changed, may indicate binary incompatibility.
ignore:Unknown units for CHANNEL:sunpy.util.exceptions.SunpyUserWarning

[pycodestyle]
Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
import os
from itertools import chain

from setuptools.config import read_configuration
try:
# Recommended for setuptools 61.0.0+
# (though may disappear in the future)
from setuptools.config.setupcfg import read_configuration
except ImportError:
from setuptools.config import read_configuration

################################################################################
# Programmatically generate some extras combos.
Expand Down
22 changes: 0 additions & 22 deletions sunkit_instruments/utils.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
"""
This module provides general utility functions.
"""
import shutil
import tarfile
from pathlib import Path

import requests


def _download_data(urls: list):
"""
This only should be called in the example gallery.

THIS IS NOT A USER FACING FUNCTION TO DOWNLOAD DATA.
"""
for url in urls:
filename = url.split("/")[-1]
if not Path(filename).exists():
with requests.get(url, stream=True) as r:
with open(filename, "wb") as f:
shutil.copyfileobj(r.raw, f)
if ".tar.gz" in filename:
with tarfile.open(filename, "r") as tar:
tar.extractall(Path(filename).parent)
14 changes: 4 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{38,39,310}{,-devdeps,-online,-oldestdeps}
py{38,39,310,311}{,-devdeps,-online,-oldestdeps}
build_docs
codestyle
requires =
Expand All @@ -9,8 +9,6 @@ requires =
isolated_build = true

[testenv]
# Run the tests in a temporary directory to make sure that we don't import
# sunpy from the source tree
changedir = .tmp/{envname}
description =
run tests
Expand All @@ -21,23 +19,19 @@ setenv =
COLUMNS = 180
PYTEST_COMMAND = pytest -vvv -s -raR --durations=25 --pyargs sunkit_instruments --cov-report=xml --cov=sunkit_instruments --cov-config={toxinidir}/setup.cfg {toxinidir}/docs
SUNPY_SAMPLEDIR = {env:SUNPY_SAMPLEDIR:{toxinidir}/.tox/{envname}/sample_data/}
HIDE_PARFIVE_PROGESS = True
PARFIVE_HIDE_PROGRESS = True
passenv =
HOME
HTTP_PROXY
HTTPS_PROXY
NO_PROXY
CIRCLECI
deps =
# All our tests run in parallel which this plugin allows us to.
pytest-xdist
# The devdeps factor is intended to be used to install the latest developer version of key dependencies.
devdeps: git+https://github.com/sunpy/sunpy
# These are specific online extras we use to run the online tests.
oldestdeps: sunpy<4.1
online: pytest-rerunfailures
online: pytest-timeout
# Oldest deps we pin against.
oldestdeps: sunpy<4.1
pytest-xdist
extras =
dev
commands =
Expand Down