Skip to content

Commit 72cc018

Browse files
jespinosaarsnbianco
authored andcommitted
INTEGRALSWRQ-158: pycodestyle fixes
1 parent a8f33df commit 72cc018

File tree

3 files changed

+8
-19
lines changed

3 files changed

+8
-19
lines changed

astroquery/esa/integral/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ def get_long_term_timeseries(self, target_name, *, instrument=None, band=None, p
482482
request_result = esautils.execute_servlet_request(url=conf.ISLA_SERVLET,
483483
tap=self.tap,
484484
query_params=query_params)
485-
if not 'detectors' in request_result or len(request_result['detectors']) == 0:
485+
if 'detectors' not in request_result or len(request_result['detectors']) == 0:
486486
raise ValueError('Please try with different input parameters.')
487487
# Parse the long term timeseries
488488
source_id = request_result['sourceId']
@@ -587,7 +587,7 @@ def get_short_term_timeseries(self, target_name, epoch, instrument=None, band=No
587587
tap=self.tap,
588588
query_params=query_params)
589589

590-
if not 'detectors' in request_result or len(request_result['detectors']) == 0:
590+
if 'detectors' not in request_result or len(request_result['detectors']) == 0:
591591
raise ValueError('Please try with different input parameters.')
592592

593593
# Parse the short term timeseries
@@ -982,7 +982,7 @@ def __validate_epoch(self, epoch, *, target_name=None, instrument=None, band=Non
982982
"""
983983
available_epochs = self.get_epochs(target_name=target_name, instrument=instrument, band=band)
984984

985-
if not epoch in available_epochs['epoch']:
985+
if epoch not in available_epochs['epoch']:
986986
raise ValueError(f"Epoch {epoch} is not available for this target and instrument/band.")
987987

988988
def __get_science_window_parameter(self, science_windows, observation_id, revolution, proposal):

astroquery/esa/integral/tests/test_isla_tap.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99
1010
"""
1111
from astropy.coordinates import SkyCoord
12-
from astropy.io.votable.tree import VOTableFile
13-
from astropy.table import Table
12+
1413
from astroquery.esa.integral import IntegralClass
1514
from astroquery.esa.integral import conf
16-
from unittest.mock import MagicMock, PropertyMock, patch, Mock
15+
from unittest.mock import PropertyMock, patch, Mock
1716
import pytest
18-
from pyvo.dal import DALResults
1917

2018
from requests import HTTPError
2119

astroquery/esa/utils/utils.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,17 @@
99
"""
1010
import getpass
1111
import os
12-
from urllib.parse import urlparse
1312

1413
import numpy as np
15-
import requests
1614
from astropy import log
1715
from astropy.coordinates import SkyCoord
18-
from astropy import units
19-
from astropy.table import Table
2016

2117
from astropy.units import Quantity
22-
from astroquery.exceptions import RemoteServiceError
23-
from astroquery.ipac.ned import Ned
24-
from astroquery.simbad import Simbad
25-
from astroquery.vizier import Vizier
2618
from pyvo.auth.authsession import AuthSession
2719
from astroquery.utils import commons
2820

2921
import matplotlib.pyplot as plt
3022
from requests import Response
31-
import json
3223

3324

3425
TARGET_RESOLVERS = ['ALL', 'SIMBAD', 'NED', 'VIZIER']
@@ -238,7 +229,7 @@ def execute_servlet_request(url, tap, *, query_params=None):
238229
The request with the modified url
239230
"""
240231

241-
if not 'TAPCLIENT' in query_params:
232+
if 'TAPCLIENT' not in query_params:
242233
query_params['TAPCLIENT'] = 'ASTROQUERY'
243234

244235
# Use the TAPService session to perform a custom GET request
@@ -410,7 +401,7 @@ def download_file(url, session, *, filename=None, params=None, verbose=False):
410401
The request with the modified url
411402
"""
412403

413-
if not 'TAPCLIENT' in params:
404+
if 'TAPCLIENT' not in params:
414405
params['TAPCLIENT'] = 'ASTROQUERY'
415406

416407
with session.get(url, stream=True, params=params) as response:
@@ -497,4 +488,4 @@ def resolve_target(url, session, target_name, target_resolver):
497488
dec = target_result['objects'][0]['decDegrees']
498489
return SkyCoord(ra=ra, dec=dec, unit="deg")
499490
except (ValueError, KeyError):
500-
raise ValueError("This target cannot be resolved")
491+
raise ValueError("This target cannot be resolved")

0 commit comments

Comments
 (0)