Skip to content

Commit 9c6ff8b

Browse files
committed
getting default timeout value directly from conf
1 parent e0377e5 commit 9c6ff8b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

astroquery/mast/cutouts.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from astropy.table import Table
2626
from astropy.io import fits
2727

28+
from . import conf
2829
from .. import log
2930
from ..exceptions import InputWarning, LargeQueryWarning, NoResultsWarning, InvalidQueryError
3031

@@ -150,11 +151,6 @@ def __init__(self):
150151
}
151152
self._service_api_connection.set_service_params(services, "tesscut")
152153

153-
def _get_default_timeout(self):
154-
""" Gets the default request timeout limit. """
155-
156-
return self._service_api_connection.TIMEOUT
157-
158154
def get_sectors(self, *, coordinates=None, radius=0*u.deg, product='SPOC', objectname=None,
159155
moving_target=False, mt_type=None):
160156

@@ -344,7 +340,7 @@ def download_cutouts(self, *, coordinates=None, size=5, sector=None, product='SP
344340

345341
# Modify TIMEOUT attribute if necessary (usually this is modified for large requests)
346342
if timeout:
347-
default_timeout = self._get_default_timeout()
343+
default_timeout = conf.timeout
348344
self._service_api_connection.TIMEOUT = timeout
349345
log.info(f"Request timeout upper limit is being changed to {self._service_api_connection.TIMEOUT}"
350346
" seconds.")
@@ -488,7 +484,7 @@ def get_cutouts(self, *, coordinates=None, size=5, product='SPOC', sector=None,
488484

489485
# Modify TIMEOUT attribute if necessary (usually this is modified for large requests)
490486
if timeout:
491-
default_timeout = self._get_default_timeout()
487+
default_timeout = conf.timeout
492488
self._service_api_connection.TIMEOUT = timeout
493489
log.info(f"Request timeout upper limit is being changed to {self._service_api_connection.TIMEOUT}"
494490
" seconds.")

0 commit comments

Comments
 (0)