Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion astroquery/alfalfa/tests/test_alfalfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class MockResponseAlfalfa(MockResponse):

def __init__(self, content, **kwargs):
super(MockResponseAlfalfa, self).__init__(content, **kwargs)
super().__init__(content, **kwargs)

def iter_lines(self):
for line in self.text.split("\n"):
Expand Down
2 changes: 1 addition & 1 deletion astroquery/alma/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class AlmaClass(QueryWithLogin):

def __init__(self):
# sia service does not need disambiguation but tap does
super(AlmaClass, self).__init__()
super().__init__()
self._sia = None
self._tap = None
self._datalink = None
Expand Down
2 changes: 1 addition & 1 deletion astroquery/astrometry_net/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def show_allowed_settings(self):

def __init__(self):
""" Show a warning message if the API key is not in the configuration file. """
super(AstrometryNetClass, self).__init__()
super().__init__()
if not conf.api_key:
log.warning("Astrometry.net API key not found in configuration file")
log.warning("You need to manually edit the configuration file and add it")
Expand Down
2 changes: 1 addition & 1 deletion astroquery/atomic/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AtomicLineListClass(BaseQuery):
TIMEOUT = conf.timeout

def __init__(self):
super(AtomicLineListClass, self).__init__()
super().__init__()
self.__default_form_values = None

def query_object(self, *, wavelength_range=None, wavelength_type=None, wavelength_accuracy=None, element_spectrum=None,
Expand Down
2 changes: 1 addition & 1 deletion astroquery/besancon/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class BesanconClass(BaseQuery):
result_re = re.compile(r"[0-9]{10}\.[0-9]{6}\.resu")

def __init__(self, email=None):
super(BesanconClass, self).__init__()
super().__init__()
self.email = email

def get_besancon_model_file(self, filename, verbose=True, timeout=5.0):
Expand Down
2 changes: 1 addition & 1 deletion astroquery/besancon/tests/test_besancon.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@ def test_default_params():
class MockResponseBesancon(MockResponse):

def __init__(self, content=None, url=None, headers={}, **kwargs):
super(MockResponseBesancon, self).__init__(content)
super().__init__(content)
self.raw = url # StringIO.StringIO(url)
self.headers = headers
2 changes: 1 addition & 1 deletion astroquery/cadc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(self, url=None, auth_session=None):
Cadc object
"""

super(CadcClass, self).__init__()
super().__init__()
self.baseurl = url
# _auth_session contains the credentials that are used by both
# the cadc tap and cadc datalink services
Expand Down
2 changes: 1 addition & 1 deletion astroquery/casda/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class CasdaClass(BaseQuery):
_uws_ns = {'uws': 'http://www.ivoa.net/xml/UWS/v1.0'}

def __init__(self, user=None, password=None):
super(CasdaClass, self).__init__()
super().__init__()
if user is None:
self._authenticated = False
else:
Expand Down
2 changes: 1 addition & 1 deletion astroquery/cds/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class CdsClass(BaseQuery):
TIMEOUT = conf.timeout

def __init__(self):
super(CdsClass, self).__init__()
super().__init__()
self.path_moc_file = None
self.return_moc = False

Expand Down
2 changes: 1 addition & 1 deletion astroquery/cosmosim/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CosmoSimClass(QueryWithLogin):
USERNAME = conf.username

def __init__(self):
super(CosmoSimClass, self).__init__()
super().__init__()

def _login(self, username=None, password=None, store_password=False,
reenter_password=False):
Expand Down
2 changes: 1 addition & 1 deletion astroquery/esa/hsa/tests/dummy_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__all__ = ['DummyHandler']


class DummyHandler(object):
class DummyHandler:

def __init__(self, method, parameters):
self._invokedMethod = method
Expand Down
2 changes: 1 addition & 1 deletion astroquery/esa/hsa/tests/dummy_tap_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from ....utils.tap.model.job import Job


class DummyHSATapHandler(object):
class DummyHSATapHandler:

def __init__(self, method, parameters):
self.__invokedMethod = method
Expand Down
2 changes: 1 addition & 1 deletion astroquery/esa/hsa/tests/test_hsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from ..tests.dummy_tap_handler import DummyHSATapHandler


class TestHSA():
class TestHSA:

def get_dummy_tap_handler(self):
parameterst = {'query': "select top 10 * from hsa.v_active_observation",
Expand Down
2 changes: 1 addition & 1 deletion astroquery/esa/hubble/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ESAHubbleClass(BaseQuery):
copying_string = "Copying file to {0}..."

def __init__(self, tap_handler=None):
super(ESAHubbleClass, self).__init__()
super().__init__()

if tap_handler is None:
self._tap = TapPlus(url="http://hst.esac.esa.int"
Expand Down
2 changes: 1 addition & 1 deletion astroquery/esa/iso/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ISOClass(BaseQuery):
TIMEOUT = conf.TIMEOUT

def __init__(self, tap_handler=None):
super(ISOClass, self).__init__()
super().__init__()

if tap_handler is None:
self._tap = TapPlus(url=self.metadata_url)
Expand Down
2 changes: 1 addition & 1 deletion astroquery/esa/iso/tests/dummy_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
__all__ = ['DummyHandler']


class DummyHandler(object):
class DummyHandler:

def __init__(self, method, parameters):
self._invokedMethod = method
Expand Down
2 changes: 1 addition & 1 deletion astroquery/esa/iso/tests/dummy_tap_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from ....utils.tap.model.job import Job


class DummyISOTapHandler(object):
class DummyISOTapHandler:

def __init__(self, method, parameters):
self.__invokedMethod = method
Expand Down
2 changes: 1 addition & 1 deletion astroquery/esa/iso/tests/test_iso.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from astroquery.esa.iso.tests.dummy_tap_handler import DummyISOTapHandler


class TestISO():
class TestISO:

def get_dummy_tap_handler(self):
parameters = {'query': "select top 10 * from ida.observations",
Expand Down
2 changes: 1 addition & 1 deletion astroquery/esa/xmm_newton/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class XMMNewtonClass(BaseQuery):
TIMEOUT = conf.TIMEOUT

def __init__(self, tap_handler=None):
super(XMMNewtonClass, self).__init__()
super().__init__()
self.configuration = configparser.ConfigParser()

if tap_handler is None:
Expand Down
4 changes: 2 additions & 2 deletions astroquery/esa/xmm_newton/tests/test_xmm_newton.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def data_path(filename):
return os.path.join(data_dir, filename)


class mockResponse():
class mockResponse:
headers = {'Date': 'Wed, 24 Nov 2021 13:43:50 GMT',
'Server': 'Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips',
'Content-Disposition': 'inline; filename="0560181401.tar.gz"',
Expand All @@ -38,7 +38,7 @@ def raise_for_status():
pass


class TestXMMNewton():
class TestXMMNewton:
def get_dummy_tap_handler(self):
parameters = {'query': "select top 10 * from v_public_observations",
'output_file': "test2.vot",
Expand Down
2 changes: 1 addition & 1 deletion astroquery/esa/xmm_newton/tests/test_xmm_newton_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from ..tests.dummy_tap_handler import DummyXMMNewtonTapHandler


class TestXMMNewtonRemote():
class TestXMMNewtonRemote:
_files = {
"0405320501": {
"pps": [
Expand Down
2 changes: 1 addition & 1 deletion astroquery/esasky/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class ESASkyClass(BaseQuery):
'DWARF_PLANET', 'SPACECRAFT', 'SPACEJUNK', 'EXOPLANET', 'STAR']

def __init__(self, tap_handler=None):
super(ESASkyClass, self).__init__()
super().__init__()

if tap_handler is None:
self._tap = TapPlus(url=self.URLbase + "/tap")
Expand Down
2 changes: 1 addition & 1 deletion astroquery/eso/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class EsoClass(QueryWithLogin):
QUERY_INSTRUMENT_URL = conf.query_instrument_url

def __init__(self):
super(EsoClass, self).__init__()
super().__init__()
self._instrument_list = None
self._survey_list = None
self.username = None
Expand Down
2 changes: 1 addition & 1 deletion astroquery/gaia/tests/test_gaiatap.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def data_path(filename):
return os.path.join(data_dir, filename)


class TestTap():
class TestTap:

def test_query_object(self):
conn_handler = DummyConnHandler()
Expand Down
2 changes: 1 addition & 1 deletion astroquery/hips2fits/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class hips2fitsClass(BaseQuery):
timeout = conf.timeout

def __init__(self, *args):
super(hips2fitsClass, self).__init__()
super().__init__()

def query_with_wcs(self, hips, wcs, format="fits", min_cut=0.5, max_cut=99.5, stretch="linear", cmap="Greys_r", get_query_payload=False, verbose=False):
"""
Expand Down
2 changes: 1 addition & 1 deletion astroquery/hips2fits/tests/test_hips2fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import astropy.units as u


class TestHips2fitsRemote(object):
class TestHips2fitsRemote:

# Create a new WCS astropy object
w = astropy_wcs.WCS(header={
Expand Down
2 changes: 1 addition & 1 deletion astroquery/hips2fits/tests/test_hips2fits_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


@pytest.mark.remote_data
class TestHips2fitsRemote(object):
class TestHips2fitsRemote:

# Create a new WCS astropy object
w = astropy_wcs.WCS(header={
Expand Down
2 changes: 1 addition & 1 deletion astroquery/hitran/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def __init__(self, **kwargs):
"""
Initialize a Hitran query class.
"""
super(HitranClass, self).__init__()
super().__init__()

def _args_to_payload(self, molecule_number=1, isotopologue_number=1,
min_frequency=None, max_frequency=None):
Expand Down
2 changes: 1 addition & 1 deletion astroquery/image_cutouts/first/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def get_images(self, coordinates, image_size=1 * u.arcmin,
S = BytesIO(response.content)
try:
return fits.open(S, ignore_missing_end=True)
except IOError:
except OSError:
raise InvalidQueryError(response.content)

@prepend_docstr_nosections("\n" + _args_to_payload.__doc__)
Expand Down
2 changes: 1 addition & 1 deletion astroquery/jplhorizons/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __init__(self, id=None, location=None, epochs=None,
>>> print(eros) # doctest: +SKIP
JPLHorizons instance "433"; location=568, epochs={'start': '2017-01-01', 'step': '1d', 'stop': '2017-02-01'}, id_type=None
"""
super(HorizonsClass, self).__init__()
super().__init__()
self.id = id
self.location = location

Expand Down
2 changes: 1 addition & 1 deletion astroquery/lamda/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class LamdaClass(BaseQuery):
url = "http://home.strw.leidenuniv.nl/~moldata/datafiles/{0}.dat"

def __init__(self, **kwargs):
super(LamdaClass, self).__init__(**kwargs)
super().__init__(**kwargs)
self.moldict_path = os.path.join(self.cache_location,
"molecules.json")

Expand Down
2 changes: 1 addition & 1 deletion astroquery/magpis/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def get_images(self, coordinates, image_size=1 * u.arcmin,
content_buffer = BytesIO(response.content)
try:
return fits.open(content_buffer, ignore_missing_end=True)
except IOError:
except OSError:
raise InvalidQueryError(response.content)

@prepend_docstr_nosections("\n" + _args_to_payload.__doc__)
Expand Down
2 changes: 1 addition & 1 deletion astroquery/mast/discovery_portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class PortalAPI(BaseQuery):

def __init__(self, session=None):

super(PortalAPI, self).__init__()
super().__init__()
if session:
self._session = session

Expand Down
2 changes: 1 addition & 1 deletion astroquery/mpc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class MPCClass(BaseQuery):
}

def __init__(self):
super(MPCClass, self).__init__()
super().__init__()

def query_object_async(self, target_type, get_query_payload=False, *args, **kwargs):
"""
Expand Down
4 changes: 2 additions & 2 deletions astroquery/nasa_ads/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ADSClass(BaseQuery):

def __init__(self, *args):
""" set some parameters """
super(ADSClass, self).__init__()
super().__init__()

@class_or_instance
def query_simple(self, query_string, get_query_payload=False,
Expand Down Expand Up @@ -123,7 +123,7 @@ def _get_token(self):
with open(token_file) as f:
self.TOKEN = f.read().strip()
return self.TOKEN
except IOError:
except OSError:
raise RuntimeError('No API token found! Get yours from: '
'https://ui.adsabs.harvard.edu/#user/settings/token '
'and store it in the API_DEV_KEY environment variable.')
Expand Down
2 changes: 1 addition & 1 deletion astroquery/ogle/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def wrapper(*args, **kwargs):
class CoordParseError(ValueError):

def __init__(self, message='Could not parse `coord` argument.', **kwargs):
super(ValueError, self).__init__(message, **kwargs)
super().__init__(message, **kwargs)


@async_to_sync
Expand Down
10 changes: 5 additions & 5 deletions astroquery/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def from_cache(self, cache_location):
response = pickle.load(f)
if not isinstance(response, requests.Response):
response = None
except IOError: # TODO: change to FileNotFoundError once drop py2 support
except FileNotFoundError:
response = None
if response:
log.debug("Retrieving data from {0}".format(request_file))
Expand All @@ -130,8 +130,8 @@ def remove_cache_file(self, cache_location):
if os.path.exists(request_file):
os.remove(request_file)
else:
raise OSError(f"Tried to remove cache file {request_file} but "
"it does not exist")
raise FileNotFoundError(f"Tried to remove cache file {request_file} but "
"it does not exist")


class LoginABCMeta(abc.ABCMeta):
Expand All @@ -146,7 +146,7 @@ class LoginABCMeta(abc.ABCMeta):
"""

def __new__(cls, name, bases, attrs):
newcls = super(LoginABCMeta, cls).__new__(cls, name, bases, attrs)
newcls = super().__new__(cls, name, bases, attrs)

if '_login' in attrs and name not in ('BaseQuery', 'QueryWithLogin'):
# skip theses two classes, BaseQuery and QueryWithLogin, so
Expand Down Expand Up @@ -473,7 +473,7 @@ class QueryWithLogin(BaseQuery):
"""

def __init__(self):
super(QueryWithLogin, self).__init__()
super().__init__()
self._authenticated = False

def _get_password(self, service_name, username, reenter=False):
Expand Down
2 changes: 1 addition & 1 deletion astroquery/simbad/tests/test_simbad.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MockResponseSimbad(MockResponse):

def __init__(self, script, cache=False, **kwargs):
# preserve, e.g., headers
super(MockResponseSimbad, self).__init__(**kwargs)
super().__init__(**kwargs)
self.content = self.get_content(script)

def get_content(self, script):
Expand Down
2 changes: 1 addition & 1 deletion astroquery/skyview/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SkyViewClass(BaseQuery):
URL = conf.url

def __init__(self):
super(SkyViewClass, self).__init__()
super().__init__()
self._default_form_values = None

def _get_default_form_values(self, form):
Expand Down
Loading