There are a few test failures with astropy dev, they show up in a few unrelated PRs here, but I think it's better to deal with them (potentially upstream?) in a separate issue:
=================================== FAILURES ===================================
_______________ [doctest] astroplan.target.FixedTarget.__repr__ ________________
137
138 Examples
139 --------
140 Show string representation of a `~astroplan.FixedTarget` for Vega:
141
142 >>> from astroplan import FixedTarget
143 >>> from astropy.coordinates import SkyCoord
144 >>> vega_coord = SkyCoord(ra='279.23473479d', dec='38.78368896d')
145 >>> vega = FixedTarget(coord=vega_coord, name="Vega")
146 >>> print(vega) # doctest: +FLOAT_CMP
Expected:
<FixedTarget "Vega" at SkyCoord (ICRS): (ra, dec) in deg (279.23473479, 38.78368894)>
Got:
<FixedTarget "Vega" at SkyCoord (ICRS): (ra, dec) in deg ( 279.23473479, 38.78368896)>
astroplan/target.py:146: DocTestFailure
_____________________ test_rise_set_transit_nearest_vector _____________________
def test_rise_set_transit_nearest_vector():
vega = SkyCoord(279.23473479*u.deg, 38.78368896*u.deg)
mira = SkyCoord(34.83663376*u.deg, -2.97763767*u.deg)
sirius = SkyCoord(101.28715533*u.deg, -16.71611586*u.deg)
sc_list = [vega, mira, sirius]
location = EarthLocation(10*u.deg, 45*u.deg, 0*u.m)
time = Time('1995-06-21 00:00:00')
obs = Observer(location=location)
> rise_vector = obs.target_rise_time(time, sc_list)
astroplan/tests/test_observer.py:160:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/utils/decorators.py:884: in target_rise_time
func = make_function_with_signature(func, name=name, **wrapped_args)
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/units/decorators.py:130: in wrapper
return wrapped_function(*func_args, **func_kwargs)
astroplan/observer.py:908: in target_rise_time
horizon=horizon))
astroplan/observer.py:830: in _determine_which_event
next_event = function(*args('next'))
astroplan/observer.py:716: in _calc_riseset
altitudes = [aa.alt for aa in altaz]
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/utils/misc.py:929: in __getitem__
return self._apply('__getitem__', item)
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/sky_coordinate.py:273: in _apply
self._sky_coord_frame = self_frame._apply(method, *args, **kwargs)
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/baseframe.py:1158: in _apply
value = getattr(self, attr)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <astropy.coordinates.baseframe.TimeFrameAttribute object at 0x7f1a6dcb6990>
instance = <[ValueError("attribute obstime should be scalar or have shape (3, 150), but is has shape (450,) and could not be broadcast.") raised in repr()] SafeRepr object at 0x7f1a6a4d5878>
frame_cls = <class 'astropy.coordinates.builtin_frames.altaz.AltAz'>
def __get__(self, instance, frame_cls=None):
if instance is None:
out = self.default
else:
out = getattr(instance, '_' + self.name, self.default)
if out is None:
out = getattr(instance, self.secondary_attribute, self.default)
out, converted = self.convert_input(out)
if instance is not None:
instance_shape = getattr(instance, 'shape', None)
if instance_shape is not None and (getattr(out, 'size', 1) > 1 and
out.shape != instance_shape):
# If the shapes do not match, try broadcasting.
try:
if isinstance(out, ShapedLikeNDArray):
out = out._apply(np_broadcast_to, shape=instance_shape,
subok=True)
else:
out = np_broadcast_to(out, instance_shape, subok=True)
except ValueError:
# raise more informative exception.
raise ValueError(
"attribute {0} should be scalar or have shape {1}, "
"but is has shape {2} and could not be broadcast."
> .format(self.name, instance_shape, out.shape))
E ValueError: attribute obstime should be scalar or have shape (3, 150), but is has shape (450,) and could not be broadcast.
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/baseframe.py:234: ValueError
______________________ test_vega_sirius_rise_set_seattle _______________________
def test_vega_sirius_rise_set_seattle():
"""
Check that time of rise/set of Vega for an observer in Seattle is
consistent with PyEphem results (for no atmosphere/pressure=0)
"""
lat = '47d36m34.92s'
lon = '122d19m59.16s'
elevation = 0.0 * u.m
pressure = 0 * u.bar
location = EarthLocation.from_geodetic(lon, lat, elevation)
time = Time('1990-01-01 12:00:00')
vega = SkyCoord(279.23473479*u.degree, 38.78368896*u.degree)
sirius = SkyCoord(101.28715533*u.degree, -16.71611586*u.degree)
obs = Observer(location=location, pressure=pressure)
astroplan_vega_rise = obs.target_rise_time(time, vega,
which='next').datetime
astroplan_sirius_rise = obs.target_rise_time(time, sirius,
which='next').datetime
astroplan_vector_rise = obs.target_rise_time(time, [vega, sirius],
> which='next').datetime
astroplan/tests/test_observer.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/utils/decorators.py:884: in target_rise_time
func = make_function_with_signature(func, name=name, **wrapped_args)
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/units/decorators.py:130: in wrapper
return wrapped_function(*func_args, **func_kwargs)
astroplan/observer.py:908: in target_rise_time
horizon=horizon))
astroplan/observer.py:830: in _determine_which_event
next_event = function(*args('next'))
astroplan/observer.py:716: in _calc_riseset
altitudes = [aa.alt for aa in altaz]
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/utils/misc.py:929: in __getitem__
return self._apply('__getitem__', item)
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/sky_coordinate.py:273: in _apply
self._sky_coord_frame = self_frame._apply(method, *args, **kwargs)
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/baseframe.py:1158: in _apply
value = getattr(self, attr)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <astropy.coordinates.baseframe.TimeFrameAttribute object at 0x7f1a6dcb6990>
instance = <[ValueError("attribute obstime should be scalar or have shape (2, 150), but is has shape (300,) and could not be broadcast.") raised in repr()] SafeRepr object at 0x7f1a6885f8c0>
frame_cls = <class 'astropy.coordinates.builtin_frames.altaz.AltAz'>
def __get__(self, instance, frame_cls=None):
if instance is None:
out = self.default
else:
out = getattr(instance, '_' + self.name, self.default)
if out is None:
out = getattr(instance, self.secondary_attribute, self.default)
out, converted = self.convert_input(out)
if instance is not None:
instance_shape = getattr(instance, 'shape', None)
if instance_shape is not None and (getattr(out, 'size', 1) > 1 and
out.shape != instance_shape):
# If the shapes do not match, try broadcasting.
try:
if isinstance(out, ShapedLikeNDArray):
out = out._apply(np_broadcast_to, shape=instance_shape,
subok=True)
else:
out = np_broadcast_to(out, instance_shape, subok=True)
except ValueError:
# raise more informative exception.
raise ValueError(
"attribute {0} should be scalar or have shape {1}, "
"but is has shape {2} and could not be broadcast."
> .format(self.name, instance_shape, out.shape))
E ValueError: attribute obstime should be scalar or have shape (2, 150), but is has shape (300,) and could not be broadcast.
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/baseframe.py:234: ValueError
________________________ test_mixed_rise_and_dont_rise _________________________
recwarn = <_pytest.recwarn.WarningsRecorder object at 0x7f1a677cea90>
def test_mixed_rise_and_dont_rise(recwarn):
vega = SkyCoord(279.23473479*u.deg, 38.78368896*u.deg)
polaris = SkyCoord(37.95456067*u.deg, 89.26410897*u.deg)
sirius = SkyCoord(101.28715533*u.deg, -16.71611586*u.deg)
targets = [vega, polaris, sirius]
location = EarthLocation(10*u.deg, 45*u.deg, 0*u.m)
time = Time('1995-06-21 00:00:00')
obs = Observer(location=location)
> rise_times = obs.target_rise_time(time, targets, which='next')
astroplan/tests/test_observer.py:1029:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/utils/decorators.py:884: in target_rise_time
func = make_function_with_signature(func, name=name, **wrapped_args)
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/units/decorators.py:130: in wrapper
return wrapped_function(*func_args, **func_kwargs)
astroplan/observer.py:908: in target_rise_time
horizon=horizon))
astroplan/observer.py:830: in _determine_which_event
next_event = function(*args('next'))
astroplan/observer.py:716: in _calc_riseset
altitudes = [aa.alt for aa in altaz]
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/utils/misc.py:929: in __getitem__
return self._apply('__getitem__', item)
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/sky_coordinate.py:273: in _apply
self._sky_coord_frame = self_frame._apply(method, *args, **kwargs)
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/baseframe.py:1158: in _apply
value = getattr(self, attr)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <astropy.coordinates.baseframe.TimeFrameAttribute object at 0x7f1a6dcb6990>
instance = <[ValueError("attribute obstime should be scalar or have shape (3, 150), but is has shape (450,) and could not be broadcast.") raised in repr()] SafeRepr object at 0x7f1a693a5c20>
frame_cls = <class 'astropy.coordinates.builtin_frames.altaz.AltAz'>
def __get__(self, instance, frame_cls=None):
if instance is None:
out = self.default
else:
out = getattr(instance, '_' + self.name, self.default)
if out is None:
out = getattr(instance, self.secondary_attribute, self.default)
out, converted = self.convert_input(out)
if instance is not None:
instance_shape = getattr(instance, 'shape', None)
if instance_shape is not None and (getattr(out, 'size', 1) > 1 and
out.shape != instance_shape):
# If the shapes do not match, try broadcasting.
try:
if isinstance(out, ShapedLikeNDArray):
out = out._apply(np_broadcast_to, shape=instance_shape,
subok=True)
else:
out = np_broadcast_to(out, instance_shape, subok=True)
except ValueError:
# raise more informative exception.
raise ValueError(
"attribute {0} should be scalar or have shape {1}, "
"but is has shape {2} and could not be broadcast."
> .format(self.name, instance_shape, out.shape))
E ValueError: attribute obstime should be scalar or have shape (3, 150), but is has shape (450,) and could not be broadcast.
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/baseframe.py:234: ValueError
______________________________ test_transitioner _______________________________
def test_transitioner():
blocks = [ObservingBlock(t, 55 * u.minute, i) for i, t in enumerate(targets)]
slew_rate = 1 * u.deg / u.second
trans = Transitioner(slew_rate=slew_rate)
start_time = Time('2016-02-06 03:00:00')
> transition = trans(blocks[0], blocks[2], start_time, apo)
astroplan/tests/test_scheduling.py:112:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
astroplan/scheduling.py:842: in __call__
sep = aaz[0].separation(aaz[1])[0]
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/utils/misc.py:929: in __getitem__
return self._apply('__getitem__', item)
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/sky_coordinate.py:273: in _apply
self._sky_coord_frame = self_frame._apply(method, *args, **kwargs)
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/baseframe.py:1158: in _apply
value = getattr(self, attr)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <astropy.coordinates.baseframe.TimeFrameAttribute object at 0x7f1a6dcb6990>
instance = <[ValueError("attribute obstime should be scalar or have shape (2, 1), but is has shape (2,) and could not be broadcast.") raised in repr()] SafeRepr object at 0x7f1a69378368>
frame_cls = <class 'astropy.coordinates.builtin_frames.altaz.AltAz'>
def __get__(self, instance, frame_cls=None):
if instance is None:
out = self.default
else:
out = getattr(instance, '_' + self.name, self.default)
if out is None:
out = getattr(instance, self.secondary_attribute, self.default)
out, converted = self.convert_input(out)
if instance is not None:
instance_shape = getattr(instance, 'shape', None)
if instance_shape is not None and (getattr(out, 'size', 1) > 1 and
out.shape != instance_shape):
# If the shapes do not match, try broadcasting.
try:
if isinstance(out, ShapedLikeNDArray):
out = out._apply(np_broadcast_to, shape=instance_shape,
subok=True)
else:
out = np_broadcast_to(out, instance_shape, subok=True)
except ValueError:
# raise more informative exception.
raise ValueError(
"attribute {0} should be scalar or have shape {1}, "
"but is has shape {2} and could not be broadcast."
> .format(self.name, instance_shape, out.shape))
E ValueError: attribute obstime should be scalar or have shape (2, 1), but is has shape (2,) and could not be broadcast.
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/baseframe.py:234: ValueError
___________________________ test_priority_scheduler ____________________________
def test_priority_scheduler():
constraints = [AirmassConstraint(3, boolean_constraint=False)]
blocks = [ObservingBlock(t, 55*u.minute, i) for i, t in enumerate(targets)]
start_time = Time('2016-02-06 03:00:00')
end_time = start_time + 18*u.hour
scheduler = PriorityScheduler(transitioner=default_transitioner,
constraints=constraints, observer=apo,
time_resolution=2*u.minute)
schedule = Schedule(start_time, end_time)
> scheduler(blocks, schedule)
astroplan/tests/test_scheduling.py:144:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
astroplan/scheduling.py:463: in __call__
schedule = self._make_schedule(copied_blocks)
astroplan/scheduling.py:764: in _make_schedule
new_start_time + b.duration, self.observer)
astroplan/scheduling.py:842: in __call__
sep = aaz[0].separation(aaz[1])[0]
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/utils/misc.py:929: in __getitem__
return self._apply('__getitem__', item)
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/sky_coordinate.py:273: in _apply
self._sky_coord_frame = self_frame._apply(method, *args, **kwargs)
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/baseframe.py:1158: in _apply
value = getattr(self, attr)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <astropy.coordinates.baseframe.TimeFrameAttribute object at 0x7f1a6dcb6990>
instance = <[ValueError("attribute obstime should be scalar or have shape (2, 1), but is has shape (2,) and could not be broadcast.") raised in repr()] SafeRepr object at 0x7f1a6a48f6c8>
frame_cls = <class 'astropy.coordinates.builtin_frames.altaz.AltAz'>
def __get__(self, instance, frame_cls=None):
if instance is None:
out = self.default
else:
out = getattr(instance, '_' + self.name, self.default)
if out is None:
out = getattr(instance, self.secondary_attribute, self.default)
out, converted = self.convert_input(out)
if instance is not None:
instance_shape = getattr(instance, 'shape', None)
if instance_shape is not None and (getattr(out, 'size', 1) > 1 and
out.shape != instance_shape):
# If the shapes do not match, try broadcasting.
try:
if isinstance(out, ShapedLikeNDArray):
out = out._apply(np_broadcast_to, shape=instance_shape,
subok=True)
else:
out = np_broadcast_to(out, instance_shape, subok=True)
except ValueError:
# raise more informative exception.
raise ValueError(
"attribute {0} should be scalar or have shape {1}, "
"but is has shape {2} and could not be broadcast."
> .format(self.name, instance_shape, out.shape))
E ValueError: attribute obstime should be scalar or have shape (2, 1), but is has shape (2,) and could not be broadcast.
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/baseframe.py:234: ValueError
__________________________ test_sequential_scheduler ___________________________
def test_sequential_scheduler():
constraints = [AirmassConstraint(2.5, boolean_constraint=False)]
blocks = [ObservingBlock(t, 55 * u.minute, i) for i, t in enumerate(targets)]
start_time = Time('2016-02-06 03:00:00')
end_time = start_time + 18 * u.hour
scheduler = SequentialScheduler(constraints=constraints, observer=apo,
transitioner=default_transitioner,
gap_time=15*u.minute)
schedule = Schedule(start_time, end_time)
> scheduler(blocks, schedule)
astroplan/tests/test_scheduling.py:169:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
astroplan/scheduling.py:463: in __call__
schedule = self._make_schedule(copied_blocks)
astroplan/scheduling.py:560: in _make_schedule
self.observer)
astroplan/scheduling.py:842: in __call__
sep = aaz[0].separation(aaz[1])[0]
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/utils/misc.py:929: in __getitem__
return self._apply('__getitem__', item)
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/sky_coordinate.py:273: in _apply
self._sky_coord_frame = self_frame._apply(method, *args, **kwargs)
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/baseframe.py:1158: in _apply
value = getattr(self, attr)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <astropy.coordinates.baseframe.TimeFrameAttribute object at 0x7f1a6dcb6990>
instance = <[ValueError("attribute obstime should be scalar or have shape (2, 1), but is has shape (2,) and could not be broadcast.") raised in repr()] SafeRepr object at 0x7f1a6a47b128>
frame_cls = <class 'astropy.coordinates.builtin_frames.altaz.AltAz'>
def __get__(self, instance, frame_cls=None):
if instance is None:
out = self.default
else:
out = getattr(instance, '_' + self.name, self.default)
if out is None:
out = getattr(instance, self.secondary_attribute, self.default)
out, converted = self.convert_input(out)
if instance is not None:
instance_shape = getattr(instance, 'shape', None)
if instance_shape is not None and (getattr(out, 'size', 1) > 1 and
out.shape != instance_shape):
# If the shapes do not match, try broadcasting.
try:
if isinstance(out, ShapedLikeNDArray):
out = out._apply(np_broadcast_to, shape=instance_shape,
subok=True)
else:
out = np_broadcast_to(out, instance_shape, subok=True)
except ValueError:
# raise more informative exception.
raise ValueError(
"attribute {0} should be scalar or have shape {1}, "
"but is has shape {2} and could not be broadcast."
> .format(self.name, instance_shape, out.shape))
E ValueError: attribute obstime should be scalar or have shape (2, 1), but is has shape (2,) and could not be broadcast.
/home/travis/miniconda/envs/test/lib/python2.7/site-packages/astropy/coordinates/baseframe.py:234: ValueError
=============== 7 failed, 94 passed, 2 skipped in 183.81 seconds ===============
There are a few test failures with astropy dev, they show up in a few unrelated PRs here, but I think it's better to deal with them (potentially upstream?) in a separate issue: