Skip to content

Commit

Permalink
Merge pull request #1656 from cdeil/cleanup2
Browse files Browse the repository at this point in the history
Minor fixes for a unit test in `coordinates` and in `units`
  • Loading branch information
astrofrog committed Oct 24, 2013
2 parents 37b60ae + 9f5ee9b commit 148a87a
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion astropy/coordinates/tests/test_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_distance_is_quantity():

d = Distance([2, 3.1], u.kpc)

d.shape == (2,)
assert d.shape == (2,)

a = d.view(ndarray)
q = d.view(u.Quantity)
Expand Down
8 changes: 4 additions & 4 deletions astropy/io/fits/hdu/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,16 @@ def data(self, data):
self.update()

try:
# Make the ndarrays in the Column objects of the ColDefs
# object of the HDU reference the same ndarray as the HDU's
# FITS_rec object.
# Make the ndarrays in the Column objects of the ColDefs
# object of the HDU reference the same ndarray as the HDU's
# FITS_rec object.
for idx in range(len(self.columns)):
self.columns[idx].array = self.data.field(idx)

# Delete the _arrays attribute so that it is recreated to
# point to the new data placed in the column objects above
del self.columns._arrays
except (TypeError, AttributeError) as e:
except (TypeError, AttributeError):
# This shouldn't happen as long as self.columns._arrays
# is a lazyproperty
pass
Expand Down
6 changes: 3 additions & 3 deletions astropy/tests/pytest_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ def find(self, obj, name=None, module=None, globs=None,
if name is None and hasattr(obj, '__name__'):
name = obj.__name__
else:
raise ValueError("DocTestFinder.find: name must be given "
"when obj.__name__ doesn't exist: %r" %
(type(obj),))
raise ValueError("DocTestFinder.find: name must be given "
"when obj.__name__ doesn't exist: %r" %
(type(obj),))

def test_filter(test):
for pat in getattr(obj, '__doctest_skip__', []):
Expand Down
12 changes: 6 additions & 6 deletions astropy/units/format/cds_parsetab.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@

_lr_action = { }
for _k, _v in _lr_action_items.items():
for _x,_y in zip(_v[0],_v[1]):
if not _x in _lr_action: _lr_action[_x] = { }
_lr_action[_x][_k] = _y
for _x,_y in zip(_v[0],_v[1]):
if not _x in _lr_action: _lr_action[_x] = { }
_lr_action[_x][_k] = _y
del _lr_action_items

_lr_goto_items = {'division_of_units':([0,9,12,26,27,],[2,2,2,2,2,]),'main':([0,],[3,]),'unit_with_power':([0,1,9,12,26,27,],[4,4,4,4,4,4,]),'signed_float':([0,],[6,]),'sign':([0,11,],[7,24,]),'product_of_units':([0,9,12,26,27,],[8,8,8,8,8,]),'signed_int':([10,28,30,],[20,35,36,]),'factor':([0,],[12,]),'unit_expression':([0,1,9,12,26,27,],[13,15,13,13,13,13,]),'numeric_power':([11,],[23,]),'combined_units':([0,9,12,26,27,],[14,19,25,33,34,]),}

_lr_goto = { }
for _k, _v in _lr_goto_items.items():
for _x,_y in zip(_v[0],_v[1]):
if not _x in _lr_goto: _lr_goto[_x] = { }
_lr_goto[_x][_k] = _y
for _x,_y in zip(_v[0],_v[1]):
if not _x in _lr_goto: _lr_goto[_x] = { }
_lr_goto[_x][_k] = _y
del _lr_goto_items
_lr_productions = [
("S' -> main","S'",1,None,None,None),
Expand Down
2 changes: 1 addition & 1 deletion astropy/units/format/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def p_function(p):
if p[1] == 'sqrt':
p[0] = p[3] ** 0.5
else:
raise ValueError(
raise ValueError(
'{0!r} is not a recognized function'.format(p[1]))

def p_error(p):
Expand Down
12 changes: 6 additions & 6 deletions astropy/units/format/generic_parsetab.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@

_lr_action = { }
for _k, _v in _lr_action_items.items():
for _x,_y in zip(_v[0],_v[1]):
if not _x in _lr_action: _lr_action[_x] = { }
_lr_action[_x][_k] = _y
for _x,_y in zip(_v[0],_v[1]):
if not _x in _lr_action: _lr_action[_x] = { }
_lr_action[_x][_k] = _y
del _lr_action_items

_lr_goto_items = {'function':([0,6,7,8,13,23,28,32,],[12,12,12,12,12,12,12,12,]),'division':([0,4,7,25,64,],[13,23,13,23,66,]),'product':([8,],[28,]),'frac':([43,],[57,]),'factor_int':([0,],[19,]),'power':([17,18,34,40,],[36,41,49,53,]),'unit_with_power':([0,6,7,8,13,23,28,32,],[3,3,3,3,3,3,3,3,]),'signed_float':([0,43,],[14,58,]),'product_of_units':([0,6,7,8,28,],[4,24,25,31,47,]),'factor_float':([0,],[15,]),'sign':([0,18,36,41,43,49,53,66,],[2,42,42,42,59,42,42,67,]),'signed_int':([17,34,40,],[39,50,54,]),'division_product_of_units':([0,7,],[5,26,]),'factor':([0,],[7,]),'unit_expression':([0,6,7,8,13,23,28,32,],[8,8,8,8,33,45,8,48,]),'numeric_power':([18,36,41,49,53,],[44,51,55,62,63,]),'main':([0,],[9,]),'paren_expr':([43,],[60,]),'inverse_unit':([0,7,],[10,27,]),'function_name':([0,6,7,8,13,23,28,32,],[11,11,11,11,11,11,11,11,]),}

_lr_goto = { }
for _k, _v in _lr_goto_items.items():
for _x,_y in zip(_v[0],_v[1]):
if not _x in _lr_goto: _lr_goto[_x] = { }
_lr_goto[_x][_k] = _y
for _x,_y in zip(_v[0],_v[1]):
if not _x in _lr_goto: _lr_goto[_x] = { }
_lr_goto[_x][_k] = _y
del _lr_goto_items
_lr_productions = [
("S' -> main","S'",1,None,None,None),
Expand Down
2 changes: 1 addition & 1 deletion astropy/units/tests/test_equivalencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def test_spectraldensity3():
10., 10)


def test_spectraldensity3():
def test_spectraldensity4():
"""PHOTLAM and PHOTNU conversions."""
flam = u.erg / (u.cm ** 2 * u.s * u.AA)
fnu = u.erg / (u.cm ** 2 * u.s * u.Hz)
Expand Down

0 comments on commit 148a87a

Please sign in to comment.