Skip to content

TST: Update CI matrix #421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 25, 2019
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
35 changes: 15 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ addons:
env:
global:
# Set defaults to avoid repeating in most cases
- PYTHON_VERSION=3.6
- PYTHON_VERSION=3.7
- NUMPY_VERSION=stable
- ASTROPY_VERSION=stable
- MAIN_CMD='python setup.py'
- CONDA_DEPENDENCIES='pytz'
- CONDA_DEPENDENCIES='pytz qt pyqt six'
- PIP_DEPENDENCIES='pytest-astropy'
- SETUP_CMD='test -V'
- CONDA_CHANNELS='astropy'


stages:
# Do the initial tests and don't proceed if they fail
Expand All @@ -40,61 +38,58 @@ stages:
- name: Cron and master-only tests
if: type IN (push, cron)


matrix:

# Don't wait for allowed failures
fast_finish: true

include:

- stage: Initial tests
env: PYTHON_VERSION=3.5 SETUP_CMD='egg_info'
- stage: Initial tests
env: SETUP_CMD='egg_info'

# Run one of the docs build during the initial tests
- os: linux
stage: Initial tests
env: SETUP_CMD='build_docs -w'
CONDA_DEPENDENCIES='pytz matplotlib astroquery'
PIP_DEPENDENCIES='pytest-mpl pytest-astropy'
CONDA_DEPENDENCIES='pytz matplotlib six'
PIP_DEPENDENCIES='pytest-mpl pytest-astropy astroquery'

- os: linux
env: PYTHON_VERSION=3.6

# This replaces Appveyor
- os: windows
env: CONDA_DEPENDENCIES='pytz matplotlib six'
PIP_DEPENDENCIES='pyephem pytest-mpl pytest-astropy'

- os: linux
stage: Initial tests
env: SETUP_CMD='test --remote-data -V'
CONDA_DEPENDENCIES='pytz matplotlib'
CONDA_DEPENDENCIES='pytz matplotlib six'
PIP_DEPENDENCIES='pytest-mpl pytest-astropy'

# Try pre-release version of Numpy. This only runs if a pre-release
# is available on pypi.
- os: linux
stage: Cron and master-only tests
env: NUMPY_VERSION=prerelease

# Try developer version of Astropy
- os: linux
env: PYTHON_VERSION=3.6 ASTROPY_VERSION=dev
env: ASTROPY_VERSION=dev

# Do a PEP8 test with pycodestyle
- os: linux
env: MAIN_CMD='pycodestyle astroplan --count --max-line-length=100' SETUP_CMD=''
stage: Initial tests
env: MAIN_CMD='flake8 astroplan --count --max-line-length=100' SETUP_CMD=''

allow_failures:
# Allow them to fail now until the IERSs issues are fixed
- env: SETUP_CMD='test --remote-data -V'
CONDA_DEPENDENCIES='pytz matplotlib'
CONDA_DEPENDENCIES='pytz matplotlib six'
PIP_DEPENDENCIES='pytest-mpl pytest-astropy'

install:
- git clone git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda.sh

# This is needed to make matplotlib plot testing work
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
- if [[ $SETUP_CMD == test* && $TRAVIS_OS_NAME == 'linux' ]]; then
export DISPLAY=:99.0;
sh -e /etc/init.d/xvfb start;
export QT_API=pyqt;
Expand Down
4 changes: 0 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ Status shields
:target: https://travis-ci.org/astropy/astroplan
:alt: Travis Status

.. image:: https://ci.appveyor.com/api/projects/status/pff1o3vx446pav83/branch/master?svg=true
:target: https://ci.appveyor.com/project/Astropy/astroplan/branch/master
:alt: Appveyor Status

.. image:: https://img.shields.io/coveralls/astropy/astroplan.svg
:target: https://coveralls.io/r/astropy/astroplan
:alt: Code Coverage
Expand Down
40 changes: 0 additions & 40 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion astroplan/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# We do this to pick up the test header report even when using LTS astropy
try:
from astropy.tests.pytest_plugins import pytest_report_header
from astropy.tests.pytest_plugins import pytest_report_header # noqa
except ImportError:
pass

Expand Down
4 changes: 2 additions & 2 deletions astroplan/observer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from six import string_types

# Standard library
import datetime
Expand All @@ -9,7 +10,6 @@
# Third-party
from astropy.coordinates import (EarthLocation, SkyCoord, AltAz, get_sun,
get_moon, Angle, Longitude)
from astropy.extern.six import string_types
import astropy.units as u
from astropy.time import Time
import numpy as np
Expand All @@ -18,7 +18,7 @@
# Package
from .exceptions import TargetNeverUpWarning, TargetAlwaysUpWarning
from .moon import moon_illumination, moon_phase_angle
from .target import get_skycoord, SpecialObjectFlag, SunFlag, MoonFlag
from .target import get_skycoord, SunFlag, MoonFlag


__all__ = ["Observer", "MAGIC_TIME"]
Expand Down
2 changes: 1 addition & 1 deletion astroplan/plots/tests/test_sky.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest

try:
import matplotlib
import matplotlib # noqa
HAS_MATPLOTLIB = True
except ImportError:
HAS_MATPLOTLIB = False
Expand Down
10 changes: 5 additions & 5 deletions astroplan/scheduling.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
from astropy.table import Table

from .utils import time_grid_from_range, stride_array
from .constraints import AltitudeConstraint, AirmassConstraint
from .constraints import AltitudeConstraint
from .target import get_skycoord

__all__ = ['ObservingBlock', 'TransitionBlock', 'Schedule', 'Slot', 'Scheduler',
'SequentialScheduler', 'PriorityScheduler', 'Transitioner', 'Scorer']
__all__ = ['ObservingBlock', 'TransitionBlock', 'Schedule', 'Slot',
'Scheduler', 'SequentialScheduler', 'PriorityScheduler',
'Transitioner', 'Scorer']


class ObservingBlock(object):
Expand Down Expand Up @@ -569,7 +570,7 @@ def _make_schedule(self, blocks):
objects with populated ``start_time`` and ``end_time`` or ``duration`` attributes.
"""
raise NotImplementedError
return schedule
# return schedule

@classmethod
@u.quantity_input(duration=u.second)
Expand Down Expand Up @@ -997,7 +998,6 @@ def __call__(self, oldblock, newblock, start_time, observer):
from .constraints import _get_altaz
from .target import get_skycoord
if oldblock.target != newblock.target:
from .target import get_skycoord
targets = get_skycoord([oldblock.target, newblock.target])
aaz = _get_altaz(start_time, observer, targets)['altaz']
sep = aaz[0].separation(aaz[1])
Expand Down
3 changes: 1 addition & 2 deletions astroplan/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

# Third-party
import astropy.units as u
from astropy.coordinates import (SkyCoord, ICRS, UnitSphericalRepresentation,
SphericalRepresentation)
from astropy.coordinates import SkyCoord, ICRS, UnitSphericalRepresentation

__all__ = ["Target", "FixedTarget", "NonFixedTarget"]

Expand Down
4 changes: 2 additions & 2 deletions astroplan/tests/test_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def test_at_night_basic():

def test_observability_table():
subaru = Observer.at_site("Subaru")
time_ranges = [Time(['2001-02-03 04:05:06', '2001-02-04 04:05:06']), # 1 day
Time(['2007-08-09 10:11:12', '2007-08-09 11:11:12'])] # 1 hr
# time_ranges = [Time(['2001-02-03 04:05:06', '2001-02-04 04:05:06']), # 1 day
# Time(['2007-08-09 10:11:12', '2007-08-09 11:11:12'])] # 1 hr
targets = [vega, rigel, polaris]

time_range = Time(['2001-02-03 04:05:06', '2001-02-04 04:05:06'])
Expand Down
7 changes: 3 additions & 4 deletions astroplan/tests/test_observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def test_parallactic_angle():


def print_pyephem_parallactic_angle():
lat = 19.826218*u.deg
# lat = 19.826218*u.deg
lon = -155.471999*u.deg
time = Time('2015-01-01 00:00:00')
LST = time.sidereal_time('mean', longitude=lon)
Expand Down Expand Up @@ -779,7 +779,6 @@ def test_solar_transit_convenience_methods():
pressure = 0 * u.bar
location = EarthLocation.from_geodetic(lon, lat, elevation)
time = Time('2000-01-01 12:00:00')
from astropy.coordinates import get_sun
obs = Observer(location=location, pressure=pressure)

# Compute next/previous noon/midnight using generic calc_transit methods
Expand Down Expand Up @@ -1234,7 +1233,7 @@ def test_tonight():

post_civil_sunset = Time('2016-08-08 05:00:00')
during_twilight = obs.tonight(time=post_civil_sunset, horizon=horizon)
during_twilight_wo_horizon = obs.tonight(time=post_civil_sunset)
during_twilight_wo_horizon = obs.tonight(time=post_civil_sunset) # noqa

# Get correct astro sunset if checking after civil sunset
assert (abs(astro_sunset.datetime - during_twilight[0].datetime) <
Expand Down Expand Up @@ -1279,7 +1278,7 @@ def test_moon_rise_set():
lat = '42:00:00'
lon = '-70:00:00'
elevation = 0.0 * u.m
pressure = 0 * u.bar
# pressure = 0 * u.bar
location = EarthLocation.from_geodetic(lon, lat, elevation)

obs = Observer(location=location)
Expand Down
2 changes: 1 addition & 1 deletion astroplan/tests/test_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_get_skycoord():

coo = get_skycoord(m31)
assert coo.is_equivalent_frame(ICRS())
with pytest.raises(TypeError) as exc_info:
with pytest.raises(TypeError):
len(coo)

coo = get_skycoord([m31])
Expand Down
2 changes: 1 addition & 1 deletion astroplan/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_stride_array():

def test_stride_floats():
arr_float = np.asarray(arr10, float)
stride10by3 = stride_array(arr_float, 3)
stride_array(arr_float, 3) # stride 10 by 3


def test_time_grid_from_range():
Expand Down
6 changes: 4 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ github_project = astropy/astroplan
[entry_points]

[flake8]
exclude = _astropy_init.py,extern
exclude = _astropy_init.py,extern,__init__.py
max-line-length = 100

[pycodestyle]
exclude = _astropy_init.py,extern
exclude = _astropy_init.py,extern,__init__.py
max-line-length = 100
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
version=VERSION,
description=DESCRIPTION,
scripts=scripts,
install_requires=['numpy>=1.10', 'astropy>=1.3', 'pytz'],
install_requires=['numpy>=1.10', 'astropy>=1.3', 'pytz', 'six'],
extras_require=dict(
plotting=['matplotlib>=1.4'],
docs=['sphinx_rtd_theme'],
Expand Down