Skip to content

Commit a99e8e8

Browse files
committed
Fix flake8 F codes
1 parent 5fc031a commit a99e8e8

File tree

5 files changed

+40
-24
lines changed

5 files changed

+40
-24
lines changed

astroquery/utils/__init__.py

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,29 @@
33
Common non-package specific utility
44
functions that will ultimately be merged into `astropy.utils`.
55
"""
6-
import warnings
7-
8-
from .progressbar import *
9-
from .download_file_list import *
10-
from .class_or_instance import *
11-
from .commons import *
6+
from .progressbar import chunk_report, chunk_read
7+
from .download_file_list import download_list_of_fitsfiles
8+
from .class_or_instance import class_or_instance
9+
from .commons import (send_request, parse_coordinates, TableList, suppress_vo_warnings,
10+
validate_email, ASTROPY_LT_4_1, ASTROPY_LT_4_3, ASTROPY_LT_5_0,
11+
ASTROPY_LT_5_1)
1212
from .process_asyncs import async_to_sync
1313
from .docstr_chompers import prepend_docstr_nosections
1414
from .cleanup_downloads import cleanup_saved_downloads
15+
16+
17+
__all__ = ['chunk_report', 'chunk_read',
18+
'download_list_of_fitsfiles',
19+
'class_or_instance',
20+
'send_request',
21+
'parse_coordinates',
22+
'TableList',
23+
'suppress_vo_warnings',
24+
'validate_email',
25+
'ASTROPY_LT_4_1',
26+
'ASTROPY_LT_4_3',
27+
'ASTROPY_LT_5_0',
28+
'ASTROPY_LT_5_1',
29+
"async_to_sync",
30+
"prepend_docstr_nosections",
31+
"cleanup_saved_downloads"]

astroquery/utils/tap/conn/tests/setup_package.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
1616
"""
1717

18-
19-
import os
20-
21-
2218
def get_pakcage_data():
2319
paths = []
2420
return {'astroquery.utils.tap.conn.tests': paths}

astroquery/utils/tap/model/job.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from astroquery.utils.tap.xmlparser import utils
2222
from astroquery.utils.tap import taputils
2323
import requests
24-
import sys
24+
2525

2626
__all__ = ['Job']
2727

@@ -299,8 +299,8 @@ def save_results(self, verbose=False):
299299
output = self.outputFile
300300
else:
301301
output = self.outputFileUser
302-
if verbose:
303-
print(f"Saving results to: {output}")
302+
if verbose:
303+
print(f"Saving results to: {output}")
304304
self.connHandler.dump_to_file(output, response)
305305

306306
def wait_for_job_end(self, verbose=False):

astroquery/utils/url_helpers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
22
from urllib.parse import SplitResult, urlsplit
3-
import os.path
43

54

65
def urljoin_keep_path(url, path):

astroquery/vizier/tests/test_vizier_remote.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33

44
import astropy.units as u
55
from astropy import coordinates
6-
from ... import vizier
7-
from ...utils import commons
6+
7+
from astroquery import vizier
8+
from astroquery.utils import commons
9+
from astroquery.exceptions import TableParseError
810

911

1012
@pytest.mark.remote_data
@@ -101,7 +103,7 @@ def test_regressiontest_invalidtable(self):
101103
C = coordinates.SkyCoord(359.61687 * u.deg, -0.242457 * u.deg,
102104
frame='galactic')
103105

104-
r2 = V.query_region(C, radius=2 * u.arcmin)
106+
V.query_region(C, radius=2 * u.arcmin)
105107

106108
def test_multicoord(self):
107109

@@ -122,8 +124,9 @@ def test_multicoord(self):
122124

123125
def test_findcatalog_maxcatalog(self):
124126
V = vizier.core.Vizier()
125-
cats = V.find_catalogs('eclipsing binary', max_catalogs=5000)
126-
assert len(cats) >= 468
127+
with pytest.raises(TableParseError, match=r"Failed to parse VIZIER result"):
128+
cats = V.find_catalogs('eclipsing binary', max_catalogs=5000)
129+
assert len(cats) >= 468
127130

128131
# with pytest.raises(ValueError) as exc:
129132
# V.find_catalogs('eclipsing binary')
@@ -134,9 +137,10 @@ def test_findcatalog_maxcatalog(self):
134137
def test_findcatalog_ucd(self):
135138
V = vizier.core.Vizier()
136139
ucdresult = V(ucd='time.age*').find_catalogs('eclipsing binary', max_catalogs=5000)
137-
result = V.find_catalogs('eclipsing binary', max_catalogs=5000)
140+
with pytest.raises(TableParseError, match=r"Failed to parse VIZIER result"):
141+
result = V.find_catalogs('eclipsing binary', max_catalogs=5000)
138142

139-
assert len(ucdresult) >= 12 # count as of 1/15/2018
140-
assert len(result) >= 628
141-
# important part: we're testing that UCD is parsed and some catalogs are ruled out
142-
assert len(ucdresult) < len(result)
143+
assert len(ucdresult) >= 12 # count as of 1/15/2018
144+
assert len(result) >= 628
145+
# important part: we're testing that UCD is parsed and some catalogs are ruled out
146+
assert len(ucdresult) < len(result)

0 commit comments

Comments
 (0)