Skip to content

Commit 6f7ae8b

Browse files
authored
Merge pull request #2791 from bsipocz/MAINT_fix_new_flake_issues
MAINT: fixing newly issues flake8 errors
2 parents aacaea2 + 5fd4cd7 commit 6f7ae8b

File tree

8 files changed

+23
-24
lines changed

8 files changed

+23
-24
lines changed

astroquery/alma/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
from ..utils import commons
3232
from ..utils.process_asyncs import async_to_sync
3333
from ..query import BaseQuery, QueryWithLogin
34-
from .tapsql import _gen_pos_sql, _gen_str_sql, _gen_numeric_sql,\
35-
_gen_band_list_sql, _gen_datetime_sql, _gen_pol_sql, _gen_pub_sql,\
36-
_gen_science_sql, _gen_spec_res_sql, ALMA_DATE_FORMAT
34+
from .tapsql import (_gen_pos_sql, _gen_str_sql, _gen_numeric_sql,
35+
_gen_band_list_sql, _gen_datetime_sql, _gen_pol_sql, _gen_pub_sql,
36+
_gen_science_sql, _gen_spec_res_sql, ALMA_DATE_FORMAT)
3737
from . import conf, auth_urls
3838
from astroquery.exceptions import CorruptDataWarning
3939

astroquery/atomic/tests/test_atomic.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
from astropy.table import Table
44

5-
from ...atomic import AtomicLineList, Transition, AtomicTransition,\
6-
MultiTransition
5+
from ...atomic import AtomicLineList, Transition, AtomicTransition, MultiTransition
76
from ...atomic.utils import is_valid_transitions_param
87

98

astroquery/esa/xmm_newton/tests/test_xmm_newton.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -403,55 +403,55 @@ def test_get_epic_images(self, tmp_path):
403403
# an instrument
404404
for k, v in res[1].items():
405405
assert k in _instruments
406-
if type(v) == str:
406+
if isinstance(v, str):
407407
f = os.path.split(v)
408408
assert f[1] in self._files["0405320501"]["pps"]
409-
if type(v) == list:
409+
if isinstance(v, list):
410410
for i in v:
411411
f = os.path.split(i)
412412
assert f[1] in self._files["0405320501"]["pps"]
413413
for k, v in res[2].items():
414414
assert k in _instruments
415-
if type(v) == str:
415+
if isinstance(v, str):
416416
f = os.path.split(v)
417417
assert f[1] in self._files["0405320501"]["pps"]
418-
if type(v) == list:
418+
if isinstance(v, list):
419419
for i in v:
420420
f = os.path.split(i)
421421
assert f[1] in self._files["0405320501"]["pps"]
422422
for k, v in res[3].items():
423423
assert k in _instruments
424-
if type(v) == str:
424+
if isinstance(v, str):
425425
f = os.path.split(v)
426426
assert f[1] in self._files["0405320501"]["pps"]
427-
if type(v) == list:
427+
if isinstance(v, list):
428428
for i in v:
429429
f = os.path.split(i)
430430
assert f[1] in self._files["0405320501"]["pps"]
431431
for k, v in res[4].items():
432432
assert k in _instruments
433-
if type(v) == str:
433+
if isinstance(v, str):
434434
f = os.path.split(v)
435435
assert f[1] in self._files["0405320501"]["pps"]
436-
if type(v) == list:
436+
if isinstance(v, list):
437437
for i in v:
438438
f = os.path.split(i)
439439
assert f[1] in self._files["0405320501"]["pps"]
440440
for k, v in res[5].items():
441441
assert k in _instruments
442-
if type(v) == str:
442+
if isinstance(v, str):
443443
f = os.path.split(v)
444444
assert f[1] in self._files["0405320501"]["pps"]
445-
if type(v) == list:
445+
if isinstance(v, list):
446446
for i in v:
447447
f = os.path.split(i)
448448
assert f[1] in self._files["0405320501"]["pps"]
449449
for k, v in res[8].items():
450450
assert k in _instruments
451-
if type(v) == str:
451+
if isinstance(v, str):
452452
f = os.path.split(v)
453453
assert f[1] in self._files["0405320501"]["pps"]
454-
if type(v) == list:
454+
if isinstance(v, list):
455455
for i in v:
456456
f = os.path.split(i)
457457
assert f[1] in self._files["0405320501"]["pps"]
@@ -462,9 +462,9 @@ def test_get_epic_images(self, tmp_path):
462462
assert os.path.isdir(os.path.join(ob, t))
463463
for b in res:
464464
for i in res[b]:
465-
if type(res[b][i]) == str:
465+
if isinstance(res[b][i], str):
466466
assert os.path.isfile(res[b][i])
467-
if type(res[b][i]) == list:
467+
if isinstance(res[b][i], list):
468468
for f in res[b][i]:
469469
assert os.path.isfile(f)
470470

astroquery/imcce/tests/test_skybot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def general_query(patch_request):
108108
a = core.Skybot.cone_search((0, 0), 0.5, 2451200)
109109

110110
assert (len(a) == 141)
111-
assert (type(a['Number'][0]) == int)
111+
assert isinstance(a['Number'][0], int)
112112
assert (a['RA'][0] == 359.94077541666667*u.deg)
113113
assert (a['DEC'][0] == -0.013904166666666667*u.deg)
114114

astroquery/mast/discovery_portal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ def build_filter_set(self, column_config_name, service_name=None, **filters):
453453
if separator:
454454
entry["separator"] = separator
455455
if colType == "continuous":
456-
entry["values"] = [{"min": value[0], "max":value[1]}]
456+
entry["values"] = [{"min": value[0], "max": value[1]}]
457457
else:
458458
entry["values"] = value
459459
if free_text:

astroquery/mocserver/tests/test_mocserver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def test_request_results(patch_get, datafile):
9797
results = MOCServer.query_region(
9898
get_query_payload=False, verbose=True, data=datafile
9999
)
100-
assert type(results) == Table
100+
assert isinstance(results, Table)
101101

102102

103103
"""

astroquery/sdss/tests/test_sdss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def compare_xid_data(xid, data):
155155

156156
def image_tester(images, filetype):
157157
"""Test that an image/spectrum is our fake data."""
158-
assert type(images) == list
158+
assert isinstance(images, list)
159159
with fits.open(data_path(DATA_FILES[filetype])) as data:
160160
assert images[0][0].header == data[0].header
161161
assert images[0][0].data == data[0].data

astroquery/vizier/tests/test_vizier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def test_find_resource_then_get(patch_post):
198198
assert next(iter(result.keys())).startswith(res.name)
199199

200200
resultl = vizier.core.Vizier.get_catalogs([res])
201-
assert type(result) == type(resultl)
201+
assert isinstance(result, type(resultl))
202202
assert len(result) == len(resultl)
203203
assert len(result[0]) == len(resultl[0])
204204

0 commit comments

Comments
 (0)