Skip to content

Commit 22981f1

Browse files
authored
Merge pull request #260 from migueldvb/tests
Add support for astropy stable
2 parents 68437dc + 40e9752 commit 22981f1

File tree

5 files changed

+15
-23
lines changed

5 files changed

+15
-23
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
stage: Tests with various Astropy/Numpy versions
5151
env: PYTHON_VERSION=3.7
5252
NUMPY_VERSION=1.18
53-
ASTROPY_VERSION=3
53+
ASTROPY_VERSION=4
5454

5555
# Test docs and PEP8
5656
- os: linux

docs/sbpy/spectroscopy/sources.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ Observe the source through a fictitious 10-μm filter:
2828

2929
>>> from synphot import SpectralElement, Box1D
3030
>>> N = SpectralElement(Box1D, x_0=10.5 * u.um, width=1 * u.um)
31-
>>> print(B.observe(N, unit='MJy'))
32-
783576416.2276517 MJy
31+
>>> print(B.observe(N, unit='MJy')) # doctest: +FLOAT_CMP
32+
783577717.2783749 MJy
3333

3434
Observe the source through a low-resolution spectrometer:
3535

sbpy/activity/dust.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import numpy as np
2222
import astropy.units as u
23+
from astropy.utils.misc import InheritDocstrings
2324

2425
from .. import bib
2526
from ..calib import Sun
@@ -163,11 +164,17 @@ def phase_HalleyMarcus(phase):
163164
return Phi
164165

165166

166-
class DustComaQuantityMeta(type(u.SpecificTypeQuantity), abc.ABCMeta):
167-
pass
167+
# checks if the installed astropy version is up-to-date
168+
if isinstance(u.SpecificTypeQuantity, InheritDocstrings):
169+
# astropy < 4.0
170+
class DustComaQuantityMeta(InheritDocstrings, abc.ABCMeta):
171+
pass
172+
else:
173+
# astropy >= 4.0
174+
DustComaQuantityMeta = abc.ABCMeta
168175

169176

170-
class DustComaQuantity(u.SpecificTypeQuantity, abc.ABC,
177+
class DustComaQuantity(u.SpecificTypeQuantity,
171178
metaclass=DustComaQuantityMeta):
172179
"""Abstract base class for dust coma photometric models: Afrho, Efrho.
173180
"""

sbpy/photometry/hapke.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ github_project = NASA-Planetary-Science/sbpy
3636
[options]
3737
install_requires =
3838
numpy>=1.13.0
39-
astropy>=3.0,<4.0
39+
astropy>=3.0
4040
astropy-helpers
4141
matplotlib
4242
ads
43-
synphot<0.2
43+
synphot
4444
astroquery>=0.4.1.dev0
4545

4646
[options.extras_require]

0 commit comments

Comments
 (0)