Skip to content

Commit d1470fb

Browse files
committed
clearing unused imports
1 parent e3bfd8e commit d1470fb

File tree

5 files changed

+27
-35
lines changed

5 files changed

+27
-35
lines changed

astroquery/alma/core.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
22
from __future__ import print_function
33
import time
4-
import sys
54
import os.path
6-
import webbrowser
75
import getpass
8-
import warnings
96
import keyring
107
import numpy as np
118
import re
@@ -16,20 +13,19 @@
1613
from bs4 import BeautifulSoup
1714

1815
from astropy.extern.six.moves.urllib_parse import urljoin
19-
from astropy.extern.six import BytesIO,iteritems
16+
from astropy.extern.six import iteritems
2017
from astropy.extern import six
2118
from astropy.table import Table, Column
2219
from astropy import log
2320
from astropy.utils.console import ProgressBar
2421
from astropy import units as u
2522
import astropy.io.votable as votable
2623

27-
from ..exceptions import (LoginError, RemoteServiceError, TableParseError,
24+
from ..exceptions import (RemoteServiceError, TableParseError,
2825
InvalidQueryError)
29-
from ..utils import schema, system_tools
30-
from ..utils import commons
26+
from ..utils import commons, system_tools
3127
from ..utils.process_asyncs import async_to_sync
32-
from ..query import BaseQuery, QueryWithLogin, suspend_cache
28+
from ..query import QueryWithLogin
3329
from . import conf
3430

3531
__doctest_skip__ = ['AlmaClass.*']
@@ -140,13 +136,13 @@ def query_async(self, payload, cache=True, public=True, science=True):
140136
response.raise_for_status()
141137

142138
return response
143-
139+
144140
def validate_query(self, payload, cache=True):
145141
"""
146142
Use the ALMA query validator service to check whether the keywords are
147143
valid
148144
"""
149-
145+
150146
# Check that the keywords specified are allowed
151147
self._validate_payload(payload)
152148

@@ -606,7 +602,7 @@ def download_and_extract_files(self, urls, delete=True, regex='.*\.fits$',
606602
"A partially completed download list is "
607603
"in Alma.partial_file_list")
608604
raise ex
609-
605+
610606
fitsfilelist = self.get_files_from_tarballs([tarball_name],
611607
regex=regex, path=path,
612608
verbose=verbose)
@@ -806,7 +802,7 @@ def _parse_staging_request_page(self, data_list_page):
806802
else 1)
807803
try:
808804
columns['size'].append(float(size)*u.Unit(unit))
809-
except ValueError:
805+
except ValueError:
810806
# size is probably a string?
811807
columns['size'].append(-1*u.byte)
812808
log.log(level=5, msg="Found a new-style entry. "

astroquery/lamda/core.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
22
import os
33
import json
4-
import numpy as np
5-
from astropy.table import Table
64
from astropy import table
75
from astropy import log
86
from astropy.utils.console import ProgressBar
@@ -138,7 +136,7 @@ def get_molecules(self, cache=True):
138136
f.write(s)
139137

140138
return molecule_dict
141-
139+
142140
@property
143141
def molecule_dict(self):
144142
if not hasattr(self, '_molecule_dict'):

astroquery/lcogt/tests/test_lcogt.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from __future__ import print_function
33
import os
44
import re
5-
import requests
65
import numpy as np
76

87
from astropy.tests.helper import pytest

astroquery/nasa_ads/core.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,41 @@
66
77
"""
88

9-
import warnings
9+
from astropy.table import Table
10+
1011
from ..query import BaseQuery
1112
from ..utils import commons, async_to_sync
13+
from ..utils.class_or_instance import class_or_instance
14+
15+
from .utils import _get_data_from_xml
1216
from . import conf
13-
from astropy.table import Table, Column
1417

15-
from ..utils.class_or_instance import class_or_instance
16-
from ..utils import commons, async_to_sync
17-
from .utils import *
1818

1919
from xml.dom import minidom
2020

2121
__all__ = ['ADS', 'ADSClass']
2222

23+
2324
@async_to_sync
2425
class ADSClass(BaseQuery):
2526

2627
SERVER = conf.server
2728
QUERY_ADVANCED_PATH = conf.advanced_path
2829
QUERY_SIMPLE_PATH = conf.simple_path
2930
TIMEOUT = conf.timeout
30-
31+
3132
QUERY_SIMPLE_URL = SERVER + QUERY_SIMPLE_PATH
3233
QUERY_ADVANCED_URL = SERVER + QUERY_ADVANCED_PATH
3334

3435
def __init__(self, *args):
3536
""" set some parameters """
3637
pass
37-
38+
3839
@class_or_instance
3940
def query_simple(self, query_string, get_query_payload=False, get_raw_response=False):
4041
self.query_string = query_string
4142
request_payload = self._args_to_payload(query_string)
42-
43+
4344
response = commons.send_request(self.QUERY_SIMPLE_URL, request_payload, self.TIMEOUT)
4445

4546
# primarily for debug purposes, but also useful if you want to send
@@ -50,17 +51,17 @@ def query_simple(self, query_string, get_query_payload=False, get_raw_response=F
5051
return response
5152
# parse the XML response into AstroPy Table
5253
resulttable = self._parse_response(response.encode(results.encoding).decode('utf-8'))
53-
54+
5455
return resulttable
55-
56+
5657
def _parse_response(self, response):
5758
xmlrepr = minidom.parseString(response.text)
5859
# Check if there are any results!
59-
60+
6061
# get the list of hits
6162
hitlist = xmlrepr.childNodes[0].childNodes
6263
hitlist = hitlist[1::2] # every second hit is a "line break"
63-
64+
6465
# Grab the various fields
6566
titles = _get_data_from_xml(hitlist, 'title')
6667
bibcode = _get_data_from_xml(hitlist, 'bibcode')
@@ -84,13 +85,13 @@ def _parse_response(self, response):
8485
t['page'] = page
8586
t['score'] = score
8687
t['citations'] = citations
87-
t['abstract'] = abstract
88+
t['abstract'] = abstract
8889
t['doi'] = doi
89-
t['eprintid'] = eprintid
90+
t['eprintid'] = eprintid
9091
t['authors'] = authors
91-
92+
9293
return t
93-
94+
9495
def _args_to_payload(self, query_string):
9596
# convert arguments to a valid requests payload
9697
# i.e. a dictionary

astroquery/query.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
import pickle
66
import hashlib
77
import os
8-
import warnings
98
import requests
10-
import itertools
119

1210
from astropy.extern import six
1311
from astropy.config import paths
1412
from astropy import log
15-
from astropy.utils.console import ProgressBar,ProgressBarOrSpinner
13+
from astropy.utils.console import ProgressBarOrSpinner
1614
import astropy.utils.data
1715

1816
from . import version

0 commit comments

Comments
 (0)