Skip to content

Commit 12a36e8

Browse files
committed
fix style
1 parent 8a31a69 commit 12a36e8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

astroquery/sdss/core.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,8 @@ def query_region_async(self, coordinates, *, radius=None,
363363
else:
364364
sql_query = sql_query.replace(' ON p.objID = x.objID ORDER BY x.up_id', '')
365365

366-
if (not isinstance(coordinates, list) and
367-
not isinstance(coordinates, Column) and
368-
not (isinstance(coordinates, commons.CoordClasses) and
369-
not coordinates.isscalar)):
366+
if (not isinstance(coordinates, (list, Column, commons.CoordClasses))
367+
and not coordinates.isscalar):
370368
coordinates = [coordinates]
371369
rectangles = list()
372370
for n, target in enumerate(coordinates):
@@ -375,9 +373,13 @@ def query_region_async(self, coordinates, *, radius=None,
375373

376374
ra = target.ra.degree
377375
dec = target.dec.degree
378-
dra = coord.Angle(width).to('degree').value / 2.0
379-
ddec = coord.Angle(height).to('degree').value / 2.0
380-
rectangles.append('((p.ra BETWEEN {0:g} AND {1:g}) AND (p.dec BETWEEN {2:g} AND {3:g}))'.format(ra - dra, ra + dra, dec - ddec, dec + ddec))
376+
dra = Angle(width).to('degree').value / 2.0
377+
ddec = Angle(height).to('degree').value / 2.0
378+
rectangles.append('((p.ra BETWEEN {0:g} AND {1:g}) '
379+
'AND (p.dec BETWEEN {2:g} AND {3:g}))'.format(ra - dra,
380+
ra + dra,
381+
dec - ddec,
382+
dec + ddec))
381383
rect = ' OR '.join(rectangles)
382384
if 'WHERE' in sql_query:
383385
sql_query += f' AND ({rect})'

0 commit comments

Comments
 (0)